Skip to content

bernardpeh/Upgradable-Proxy-Smart-Contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

About

Really basic upgradable smart contract in solidity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published