Go to file
Kirill Fedoseev f46a9d54ef Initial commit 2020-08-13 12:42:19 +07:00
.github/workflows Initial commit 2020-08-13 12:42:19 +07:00
contracts Initial commit 2020-08-13 12:42:19 +07:00
deploy Initial commit 2020-08-13 12:42:19 +07:00
scripts Initial commit 2020-08-13 12:42:19 +07:00
test Initial commit 2020-08-13 12:42:19 +07:00
.dockerignore Initial commit 2020-08-13 12:42:19 +07:00
.editorconfig Initial commit 2020-08-13 12:42:19 +07:00
.eslintignore Initial commit 2020-08-13 12:42:19 +07:00
.eslintrc Initial commit 2020-08-13 12:42:19 +07:00
.gitattributes Initial commit 2020-08-13 12:42:19 +07:00
.gitignore Initial commit 2020-08-13 12:42:19 +07:00
.nvmrc Initial commit 2020-08-13 12:42:19 +07:00
.prettierrc Initial commit 2020-08-13 12:42:19 +07:00
.solhint.json Initial commit 2020-08-13 12:42:19 +07:00
CODE_OF_CONDUCT.md Initial commit 2020-08-13 12:42:19 +07:00
CONTRIBUTING.md Initial commit 2020-08-13 12:42:19 +07:00
Dockerfile Initial commit 2020-08-13 12:42:19 +07:00
Dockerfile.dev Initial commit 2020-08-13 12:42:19 +07:00
LICENSE Initial commit 2020-08-13 12:42:19 +07:00
README.md Initial commit 2020-08-13 12:42:19 +07:00
codechecks.yml Initial commit 2020-08-13 12:42:19 +07:00
deploy.sh Initial commit 2020-08-13 12:42:19 +07:00
docker-compose.yml Initial commit 2020-08-13 12:42:19 +07:00
flatten.sh Initial commit 2020-08-13 12:42:19 +07:00
package-lock.json Initial commit 2020-08-13 12:42:19 +07:00
package.json Initial commit 2020-08-13 12:42:19 +07:00
truffle-config.js Initial commit 2020-08-13 12:42:19 +07:00

README.md

Join the chat at https://gitter.im/poanetwork/poa-bridge Build Status Coverage Status

AMB Mediators Smart Contracts

These contracts provide the functionality for mediators intended to work on top of the AMB bridge.

Usage

There are two ways to deploy contracts:

  • install and use NodeJS
  • use Docker to deploy

Deployment with NodeJS

Install Dependencies

npm install

Deploy

Please read the README.md in the deploy folder for instructions and .env file configuration

Test

npm test

Run coverage tests

npm run coverage

The results can be found in the coverage directory.

Flatten

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.

Deployment in the Docker environment

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.

Prepare the docker container

docker-compose up --build

Note: The container must be rebuilt every time the code in a contract or deployment script is changed.

Deploy the contracts

  1. Create the .env file in the deploy directory as described in the deployment README.md.
  2. Run deployment process:
    docker-compose run amb-mediators deploy.sh
    
    or with Linux:
    ./deploy.sh
    

Copy flatten sources (if needed)

  1. Discover the container name:
    docker-compose images amb-mediators
    
  2. 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 ./
    

Test contract and run coverage (if needed)

$ docker-compose run dev bash
$ npm test
$ npm run coverage

Shutdown the container

If the container is no longer needed, it can be shutdown:

docker-compose down

Contributing

See the CONTRIBUTING document for contribution, testing and pull request protocol.

License

License: GPL v3.0

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.