可升級合約

使用 delegate call 搭配 solidity 的 fallback function 傳入 calldata。呼叫時會呼叫 proxy contract 然後指向實際的邏輯合約。

HardHat 範例:

https://blog.logrocket.com/using-uups-proxy-pattern-upgrade-smart-contracts/

原理

DelegateCall 用法

Call v.s delegateCall:

https://ethereum.stackexchange.com/a/3672/30691

encodeWithSignature v.s encodeWithSelector: https://ethereum.stackexchange.com/q/91826/30691

Last updated

Was this helpful?