-
Notifications
You must be signed in to change notification settings - Fork 47
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
Predictor #440
base: development
Are you sure you want to change the base?
Predictor #440
Conversation
Loan token enhancements v1.20.0
@@ -0,0 +1,59 @@ | |||
# WHAT IS THIS SCRIPT SET FOR? | |||
|
|||
This set of scripts is intended to help devs to find out if the contracts of a given commit / branch in a repo will reproduce exactly the contracts deployed in the blockchain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This set of scripts is intended to help devs to find out if the contracts ABI of a given commit / branch in a repo correspond to the contracts deployed in the blockchain.
|
||
This set of scripts is intended to help devs to find out if the contracts of a given commit / branch in a repo will reproduce exactly the contracts deployed in the blockchain. | ||
These scripts are categorized into four .js files for convenient separate execution. | ||
This can be used as a tool to predict if the contract code in certain repo / branch / commit will verify in a block explorer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be used as a tool to predict if the contract code in certain repo / branch / commit will verify in a block explorer. | |
This can be used as a tool to identify if the contract code in certain repo / branch / commit will verify in a block explorer. |
|
||
The folder ./scripts/predictor have four .js files and may have several .json files, but one them is invariant: contract_config.json | ||
|
||
These scripts will work only provided that there exist a folder in the repo named ./scripts/contractInteraction contentive of the .json files listing all the Sovryn's deployed contracts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These scripts will work only provided that there exist a folder in the repo named ./scripts/contractInteraction contentive of the .json files listing all the Sovryn's deployed contracts. | |
These scripts will work only provided that there exists a folder in the repo named ./scripts/contractInteraction contentive of the .json files listing all the Sovryn's deployed contracts. |
pls consider putting all settings - paths etc. in e.g. .deployment-verifier.json or .ts/.js
## How to Use These Scripts | ||
|
||
1. Clone locally the smart contracts git repo. | ||
2. Install the dependencies as instructed in the RAEADME.md file of that repo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Install the dependencies as instructed in the RAEADME.md file of that repo. | |
2. Install the dependencies as instructed in the README.md file of that repo. |
$ node createJSON | ||
``` | ||
|
||
After this, files like `m_deployed_compiled.json` mut be present. Be ware that if there was a previous .json file with that name, this script will overwrite it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls consider adding it as parameter to cover cases when you can add an external ABI manually and those won't be overwritten
$ node createJSON | ||
``` | ||
|
||
After this, files like `m_deployed_compiled.json` mut be present. Be ware that if there was a previous .json file with that name, this script will overwrite it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this, files like `m_deployed_compiled.json` mut be present. Be ware that if there was a previous .json file with that name, this script will overwrite it. | |
After this, files like `m_deployed_compiled.json` mut be present. Beware that if there was a previous .json file with that name, this script will overwrite it. |
``` | ||
$ node findFiles | ||
``` | ||
This will fill the dump files with the paths of the files with the conpiled bytecodes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fill the dump files with the paths of the files with the conpiled bytecodes. | |
This will fill the dump files with the paths of the files with the compiled bytecodes. |
4. `./scripts/predictor/contract_config.json` can be edited to extend it. Be ware that the info must be precise or the script may fail with unexpected errors. | ||
5. Check the info in folder `./scripts/contractInteraction` and make sure that at least that the files `mainnet_contracts.json` and `testnet_contracts.json` are present with the relevant info. These files are expected to contain as accurate and complete information as possible, about contract deployments on chain. | ||
6. Go to the folder `./scripts/predictor` and execute: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls consider adding paths to a config like .deployment-verifier.json
# WHAT IS THIS SCRIPT SET FOR? | ||
|
||
This set of scripts is intended to help devs to find out if the contracts of a given commit / branch in a repo will reproduce exactly the contracts deployed in the blockchain. | ||
These scripts are categorized into four .js files for convenient separate execution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls add a high level schematic description of how it works as a sequence of steps like
- provide/generate ABIs and bytecodes of the contracts you want to verify
- provide contracts addresses
- run comparator script on a blockchain (provide as parameter) to get the list of contracts which ABIs correspond to the deployed contracts meaning that they will be successfully verified in the blockchain explorers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw can it be extended with automatic verifier? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls see inline comments
also pls run the README.md text through grammarly or similar to tackle typos
Links to:
Need for this PR
Description how it works
Script to help to predict if a bytecode in a deployed contract will correspond to the locally compiled bytecode.