Skip to content

Latest commit

 

History

History
63 lines (43 loc) · 1.98 KB

README.md

File metadata and controls

63 lines (43 loc) · 1.98 KB

drawing

Proxy @ v1

npm version License

Overview

Swaap Protocol is building the first market neutral AMM. This repository contains its proxy smart contract.

Proxy contract enables a user to create custom pools, join existing ones, and batchswap/multihop trades on multiple pools.

For an in-depth documentation of Swaap, see our docs.

Get Started

Build and Test

$ yarn # install all dependencies
$ yarn build # compile all contracts
$ yarn testrpc # run ganache and fork polygon mainnet
$ yarn test # run all tests (the tests are based on few polygon deployed SCs)

Deployment

To deploy the Proxy contract to an EVM-compatible chain:

$ yarn deploy:$NETWORK

Where $NETWORK corresponds to a target network as defined in the truffle-config.js file. The deployment script won't deploy the factory except when running tests.

Ecosystem

Using Swaap interfaces

The Swaap Proxy v1 interfaces are available for import into solidity smart contracts via the npm artifact @swaap-labs/swaap-proxy-v1, e.g.:

import '@swaap-labs/swaap-proxy-v1/contracts/interfaces/IProxy.sol';

contract MyContract {
  IProxy swaapProxy;

  function doSomethingWithPool() {
    // swaapProxy.joinPool(...);
  }
}

Error codes

Error messages are formated as PROOXY#$ERROR_ID strings.

Corresponding human readable messages can be found here: contracts/ProxyErrors.sol.

Security

Upgradability

All smart contracts are immutable, and cannot be upgraded.

Licensing

Solidity source code is licensed under the GNU General Public License Version 3 (GPL v3): see LICENSE.