Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re write deployment verification code #451

Open
ilanDoron opened this issue Oct 23, 2019 · 1 comment
Open

re write deployment verification code #451

ilanDoron opened this issue Oct 23, 2019 · 1 comment

Comments

@ilanDoron
Copy link
Contributor

current contract verification code is in file:
readVerifyDeployment.js
in web3deployment folder.
https://github.com/KyberNetwork/smart-contracts/blob/master/web3deployment/readVerifyDeployment.js

This file does many checks on our setup.
most of those checks are already done in other places.

so we should rewrite the file and structure it.
the main purpose should be to verify the deployed contracts kyber is connected to are only contracts we expect.
Example: a reserve manager can set sanity rate contract pointer to a totally different file and do some logic that attacks users or other reserves.

So what should be done.
iterate all contracts connected to kyber network.
get byteCode from the chain and verify it.
this is already done in old file.
but one change is required. since folder structure changed, we should save sha3 of the bytecode and compare on chain sha3 to saved sha3. before structure changed, could compile contract and compare compilation result. but bytecode includes some data on the source test file. so any change in text causes the compilation result to slightly change.

@ilanDoron
Copy link
Contributor Author

as opposed to current verification code, can consider doing async calls to fetch on chain bytecode.

@ilanDoron ilanDoron changed the title re write contract verification code re write deployment verification code Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant