Hi all, Does anyone know how to get source code of solidity contract from bytecode?
Jun 29, 2022, 4:23 AM
Imposible
:(
Jun 29, 2022, 5:25 AM
ty
Jun 29, 2022, 5:25 AM
It's possible
Hello, @everyone
How to verify the upgradeable smart contract with truffle?
How to verify the upgradeable smart contract with truffle?
Jun 29, 2022, 12:07 PM
Just like other contracts
Truffle will detect proxy automatically and will verify the implementation
Jun 29, 2022, 12:53 PM
Hi, Thank you for your message.
I got this error message when I tried to verify the implement contract
——————————
Verifying TransparentUpgradeableProxy
Verifying proxy implementation at 0x4aa591bd7fc14530b5167cd1fba1634540690f59
Invalid constructor arguments provided. Please verify that they are in ABI-encoded format
Failed to verify 1 contract(s): TransparentUpgradeableProxy
I got this error message when I tried to verify the implement contract
——————————
Verifying TransparentUpgradeableProxy
Verifying proxy implementation at 0x4aa591bd7fc14530b5167cd1fba1634540690f59
Invalid constructor arguments provided. Please verify that they are in ABI-encoded format
Failed to verify 1 contract(s): TransparentUpgradeableProxy
Jun 29, 2022, 12:56 PM
Try passing constructor args explicitly
Tbh I haven't seen this error on proxies...
Did you migrated the contract without truffle?
Jun 29, 2022, 12:59 PM
await deployer.deploy(TransparentUpgradeableProxy, tokenEth.address, proxyAdmin.address, [])
used truffle
truffle run verify TransparentUpgradeableProxy 0x4aa591bD7FC14530B5167CD1Fba1634540690f59 0x0fcBECa3B6fCF87830f9352B2b2996b9a828e74b [] --network rinkeby
truffle run verify TransparentUpgradeableProxy 0x4aa591bD7FC14530B5167CD1Fba1634540690f59 0x0fcBECa3B6fCF87830f9352B2b2996b9a828e74b [] --network rinkeby
Is this wrong?
Jun 29, 2022, 12:59 PM
Oh this is not how to deploy proxy...
Import truffle upgrades and use that
Jun 29, 2022, 1:00 PM
This is my code
Jun 29, 2022, 1:01 PM
Truffle have an easy way to deploy proxies
Jun 29, 2022, 1:01 PM
Could you please the link so that I can easy deploy proxy?
Jun 29, 2022, 1:02 PM
https://docs.openzeppelin.com/upgrades-plugins/1.x/truffle-upgrades
Jun 29, 2022, 1:02 PM
COOL
Let me check.
-this is old code
await deployer.deploy(TokenEth);
const tokenEth = await TokenEth.deployed();
await deployer.deploy(ProxyAdmin);
const proxyAdmin = await ProxyAdmin.deployed();
await deployer.deploy(TransparentUpgradeableProxy, tokenEth.address, proxyAdmin.address, []);
const trans = await TransparentUpgradeableProxy.deployed();
const proxyExo = await TokenEth.at(trans.address);
await proxyExo.initialize();
—————————————————————————————————————-
-this is new code
const _tokenEth = await deployProxy(TokenEth, { deployer });
const _trans = await upgradeProxy(tokenEth1.address, proxyAdmin, { deployer });
Do I have to write like this?
await deployer.deploy(TokenEth);
const tokenEth = await TokenEth.deployed();
await deployer.deploy(ProxyAdmin);
const proxyAdmin = await ProxyAdmin.deployed();
await deployer.deploy(TransparentUpgradeableProxy, tokenEth.address, proxyAdmin.address, []);
const trans = await TransparentUpgradeableProxy.deployed();
const proxyExo = await TokenEth.at(trans.address);
await proxyExo.initialize();
—————————————————————————————————————-
-this is new code
const _tokenEth = await deployProxy(TokenEth, { deployer });
const _trans = await upgradeProxy(tokenEth1.address, proxyAdmin, { deployer });
Do I have to write like this?
Jun 29, 2022, 1:12 PM