This set of tools provides a reasonably secure mechanism for burning ENG on Ethereum, and minting SCRT 1-to-1 on the Enigma chain.
Development tasks:
- Smart contract that burns ENG
- Leader that watches Ethereum, and unsigned tx to the db (mocked tx)
- Operator watches Ethereum and sign the tx (mocked sig)
- Leader ratifies the tx and submits to enigma cli
- Integrate enigmacli into the operator and learder (real tx and sig)
- Frontend React template integrate with Web and the smart contract
- Burn ENG form in frontend
- End-to-end integration test
- Stress test and dry run
- Minter module that authenticates the multisig address (is this needed?)
Operational tasks:
- Vote on operators and leader
- Do we need a Minter module or are coins pre-mined?
- Operators configure their private key in their enigmad
- Leader creates the multigig address and imports operators public keys in enigmad
This repo contains the implementation for the Multisig Setup Proposal
First ensure you are in a new and empty directory.
-
Install the dependencies
yarn
-
In a new terminal session, run ganache:
ganache-cli -d -i 50
-
In another new terminal session, run the database:
docker-compose run --service-ports mongo
-
Compile and migrate the smart contracts:
yarn migrate
-
Run the unit tests (the
yarn test
also migrates). The unit test is more of an integration tests that burns tokens and verifies the leader and operators busines logic.yarn test
-
Start the leader
# Set other environment variables in a .env file in the project root ROLE=leader node ./server.js
-
Start multiple operators
# Set other environment variables in a .env file in the project root ROLE=operator node ./server.js
-
The
client
folder contains a frontend template that gets Web3 and imports theEngSwap
contract. The contract has singleburnFunds(bytes memory _recipient, uint256 _amount)
public function. Usage specs and examples can be found inswap.test.js
. When all the components are online, swaps can be tested by callingburnFunds
using Remix or Web3, or buy creating a page in the frontend.
-
How do I use this with the Ganache-CLI?
It's as easy as modifying the config file! Check out our documentation on adding network configurations. Depending on the port you're using, you'll also need to update line 29 of
client/src/utils/getWeb3.js
.