You will need a MacOS or Linux system.
- Install the latest version of
parity
. - Install the latest version of
solc
. - Install the latest version of
npm
.
Local development is worked against TestRPC (which will be installed via npm
). Parity is used to test against a local dev-chain (see parity-spec.json
) and can also be used to test agains Ropsten TestNet or the Public MainNet.
- Explorer URL: https://explorer.metronome.io
- Auction Board URL: https://metronome.io
Version: autonomoussoftware/metronome#35a6cd3
Contract | Address | Description |
---|---|---|
Auctions | 0x9d9BcDd249E439AAaB545F59a33812E39A8e3072 | Use for purchasing newly minted MET |
AutonomousConverter | 0x686e5ac50D9236A9b7406791256e47feDDB26AbA | Use for exchanging MET/ETH after initial auction is over |
METToken | 0xa3d58c4E56fedCae3a7c43A725aeE9A71F0ece4e | Use this address for MET ERC20 functions and third-party wallets |
npm install
to install all module dependenciesnpm test
to compile all the contracts and run the entire test suite agains TestRPCTESTFILE=test/<testfile>.js npm run testrpc:single
to compile and run a single test file
./deploy
to compile all the contracts and deploy them to a local parity dev-chain (this script will automatically start Parity)geth attach --preload js/metronome.js,js/const.js,js/initMetronome.js
to open a geth console and start metronomegeth attach --preload js/metronome.js,js/const.js,js/initPostAuction.js
to open a geth console and start metronme (bypassing the initial auction)
Here geth console commands to emulate auction transactions
loadScript('js/testStart.js')
to load a geth test script for auction buys- call
pingBuy()
to simulate a buy (this will also initiate a buy every 30 seconds)
Sample code of how to interact with the smart contracts can be viewed in the Truffle tests.
shared
folder contains utility code shared amongs multiple test casesauctions.js
tests for the Auction contractdeployment.js
tests for emulating actual deployment process for all the contractserc-compliance.js
tests for ERC20 and ERC827 compliancefixedMath.js
tests for the Fixed Math contract (internal functions used by Metronome)formula.js
tests for the Formula contract (math for minting calculations)metronome.js
tests for Metronome use cases involving the AutonomousConvertermtnToken.js
tests for MET Token use cases (i.e., transfering tokens)owned.js
tests for Ownership operations (i.e., changeOwnership)pricer.js
tests for Pricer contract (internal functions used by Metronome)proceeds.js
tests for Proceeds contract to manage ETH fundssmartToken.js
tests for internal SmartToken contract used by AutonomousConvertertokenLocker.js
tests used for time locking founder tokenstokenPorter.js
tests for exporting MET tokens to be imported to another chain
Simuating time proved to be a challenge, so we had to migrate a seperate suite of tests so that we can take advantage of evm_increaseTime
. This allowed us to better test targeted scenarios that depended on system time.
ac.js
timed tests for AutonomousConverterauctions.js
timed tests for Auctionsproceeds.js
timed tests for Proceedssubscriptions.js
timed tests for MET Token subscriptionstokenLocker.js
timed tests for TokenLocker withdraws