Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 913 Bytes

README.md

File metadata and controls

44 lines (33 loc) · 913 Bytes

Simple illustration of upgradable smart contracts

  1. Set Current Logic contract in Registry
Registry.at(Registry.address).setLogicContract(LogicOne.address)
  1. Check logic_contract address in Registry
Registry.at(Registry.address).logic_contract()
  1. Update Registry storage from 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()
  1. Change logic layer to LogicTwo
Registry.at(Registry.address).setLogicContract(LogicTwo.address)
  1. Set LogicTwo new value
LogicTwo.at(Registry.address).setVal(2)
// check value: value should be 6
LogicTwo.at(Registry.address).val()
  1. LogicOne should still be able to set the val
LogicOne.at(Registry.address).setVal(2)
// check value: value should be 6. WHY?
LogicOne.at(Registry.address).val()