Stake Manager

Coverage Status

build the contracts

yarn run build

note: sometimes tests fail if your network connection is a little slow at the time and are running for the first time after a fresh install or deleting the cache

run tests

yarn run foundry:test
yarn run test
yarn run test --trace-error # with error traces

Run Traces

npx hardhat trace --hash 0xdeadbeef... # tx hash

Local Development

to run a node locally, simply run

npx hardhat node

then, in another terminal, you can run the local-development script to fund your deploy mnemonic (env: DEPLOY_MNEMONIC)

./local-development

in the case of the hexpay.day developers, they may wish to provide the following series of envs and run the local development script as noted above in order to test in a browser

# where stakes will be ended / managed from
TEST_ADDRESS=0xE971e07BF9917e91DFbeD9165f2ea8e6FF876880
# where contracts will be deployed from
# must be first address of `DEPLOY_MNEMONIC`
DEPLOY_ADDRESS=0x73CaB6c9EDA8aBc28099aF9F5dBd100Aa998Ae72

Auditors

The contracts that need to be reviewed are in the contracts folder and excludes the references and interfaces folders. The contracts folder is ~2400 sloc. The reference contract (HEX.sol) is ~1640 SLOC, but has been modified from the original source so can only be used as a logical reference, not a byte for byte copy reference. Original can be found on etherscan. The HEDRON and HSIM contracts are also available on etherscan and are ~2700 sloc combined.

NOTE: the contracts in this repo do not care about any tokens except for the ones listed above and the maximus perpetuals (custodial contract for a hex stake). That being said, it would be great if you familiarized yourself with the quirks of these 3 token contracts as they do break common practices.