These contracts provide the functionality for mediators intended to work on top of the AMB bridge.
There are two ways to deploy contracts:
- install and use NodeJS
- use Docker to deploy
npm install
Please read the README.md in the deploy
folder for instructions and .env file configuration
npm test
npm run coverage
The results can be found in the coverage
directory.
Fattened contracts can be used to verify the contract code in a block explorer like BlockScout or Etherscan. The following command will prepare flattened version of the contracts:
npm run flatten
The flattened contracts can be found in the flats
directory.
Docker and Docker Compose can be used to deploy contracts without NodeJS installed on the system.
If you are on Linux, we recommend you create a docker group and add your user to it, so that you can use the CLI without sudo
.
docker-compose up --build
Note: The container must be rebuilt every time the code in a contract or deployment script is changed.
- Create the
.env
file in thedeploy
directory as described in the deployment README.md. - Run deployment process:
or with Linux:
docker-compose run amb-mediators deploy.sh
./deploy.sh
- Discover the container name:
docker-compose images amb-mediators
- In the following command, use the container name to copy the flattened contracts code to the current working directory. The contracts will be located in the
flats
directory.docker cp name-of-your-container:/contracts/flats ./
$ docker-compose run dev bash
$ npm test
$ npm run coverage
If the container is no longer needed, it can be shutdown:
docker-compose down
See the CONTRIBUTING document for contribution, testing and pull request protocol.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.