Proxy in Solidity II

Solidity Programming Language
3 min readFeb 17, 2022

--

(DELEGATECALL VERSION)

Code: https://github.com/grandzero/SecureumBootcamp/blob/main/solidity101/ProxyContract.sol

Thank you GrandZero

My short code is the above

1- Deploy “LogicContract”

2- Deploy the “Proxy”

3- Copy the address of the “LogicContract” and paste this address to the setProxyAddr in “Proxy”

4- Take the the address of “Proxy”

5-Choose the “LogicContract” and paste this address to the At Address section. Click the “At Address” button.

6- We have a new contract. You use “changeUint” function in the last contract and you can control “number” variable in proxy contract.

More compact version

If we update “LogicContract”, what will happen

1- COMPILE and DEPLOY new contract .Remember also we have 3 contract.

2-Now we have 4 contracts. New contract is updated in changeUnit function.

3-Please copy the adress of new contract(4)

4-Go to the Proxy contract(2)

5- Paste this address to the setProxyAddr in “Proxy”

6- This is çokomelli !

You use “changeUint” function in the third contract(NOT LAST CONTRACT)and you can control “number” variable in proxy contract.

Thanks to Grandzero

Sign up to discover human stories that deepen your understanding of the world.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Solidity Programming Language
Solidity Programming Language

Written by Solidity Programming Language

Solidity basics for beginners: Learn the fundamentals of smart contract development and build your first DApp! #Solidity #Foundry #Ethereum #Opcodes #DApps

Responses (2)

Write a response