Verify contract
Last updated
Was this helpful?
Last updated
Was this helpful?
To verify that the B3TR contract deployed at a specific address is the official one (i.e: is the official smart contract written by the VeChain Foundation), you can follow the next steps: 1) Clone the public repository: https://github.com/vechain/vebetterdao-contracts
2) Run yarn install
to install the dependencies
3) Run the following command to verify if the B3TR contract deployed at a specific address has the same code of the contract created and audited by VeChain Foundation:
This command will check that the bytecode of the contract deployed at the given address is the same as the source code in the repo.
To achieve this, it will:
Fetch the bytecode of the deployed contract mainnet
Deploy the B3TR contract on the hardhat local network
Compare the 2 bytecodes: they must match
Deploying the contract on the hardhat network is necessary because there is something wrong with the compiled bytecode, some bytes are different between the actual deployed contract, maybe due to the way VeChainThor is deploying contracts.
This solution isn't perfect, but it's a quick way to verify that the deployed contract is the same as the one compiled in the repository.