文件名称:Upgradable-Proxy-Smart-Contract:真正可靠的可升级智能合约
文件大小:25KB
文件格式:ZIP
更新时间:2024-06-06 08:30:13
JavaScript
可升级智能合约的简单说明 在注册表中设置“当前逻辑”合同 Registry.at(Registry.address).setLogicContract(LogicOne.address) 检查注册表中的logic_contract地址 Registry.at(Registry.address).logic_contract() 从LogicOne更新注册表存储 LogicOne.at(Registry.address).setVal(2) // Check value: value should be 4 LogicOne.at(Registry.address).val() // check owner val Registry.at(Registry.address).owner() 将逻辑层更改为LogicTwo Registry.at(Registry.address).
【文件预览】:
Upgradable-Proxy-Smart-Contract-master
----.gitignore(8B)
----README.md(913B)
----migrations()
--------2_registry.js(123B)
--------4_logic_two.js(247B)
--------1_initial_migration.js(129B)
--------3_logic_one.js(247B)
----truffle.js(154B)
----truffle-config.js(135B)
----build()
--------contracts()
----contracts()
--------LogicOne.sol(201B)
--------Migrations.sol(515B)
--------Ownable.sol(199B)
--------Storage.sol(68B)
--------Registry.sol(1KB)
--------LogicTwo.sol(200B)