Conversation
…xy (including ProxyAdmin) from OpenZeppelin
… into CCIP-9118/add-transparent-upgradable-proxy
CORA - Pending ReviewersAll codeowners have approved! ✅ Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown For more details, see the full review summary. |
|
I see you updated files related to
|
…github.com/smartcontractkit/chainlink into CCIP-9118/add-transparent-upgradable-proxy
deployment/ccip/changeset/v1_5/cs_burn_mint_erc20_transparent.go
Outdated
Show resolved
Hide resolved
deployment/ccip/changeset/v1_6_1/cs_transparent_upgradeable_proxy_test.go
Show resolved
Hide resolved
|
|
||
| cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" | ||
| cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" | ||
| "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/1_5_0/burn_mint_erc20_transparent" |
There was a problem hiding this comment.
does this have to be in 1.5? or was it already present in 1.5?
Just because the previous version gethwrappers are hard to generate :( would be great if we can move it to the latest versions
| "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" | ||
| ) | ||
|
|
||
| var _ cldf.ChangeSet[BurnMintERC20TransparentChangesetConfig] = DeployBurnMintERC20Transparent |
There was a problem hiding this comment.
Can we move this to the changeset v2 version instead of legacy, separate apply & validate methods, would be easier to work with orchestrator changesets ( i think)
| for token, config := range tokens { | ||
| if config.PreMint == nil { | ||
| config.PreMint = big.NewInt(0) | ||
| tokens[token] = config |
There was a problem hiding this comment.
it would be ideal if we dont instantiate config in the validate method, we have had trouble before with similar patterns in the Token Pool deployments
There was a problem hiding this comment.
We intentionally left PreMint as optional. Although we don't plan to use it ourselves (ever), we want to support the feature for potential clients. Keeping it optional allows us to satisfy those edge cases without complicating the default deployment.
| "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" | ||
|
|
||
| "github.com/smartcontractkit/ccip-contract-examples/chains/evm/gobindings/generated/latest/token_governor" | ||
| "github.com/smartcontractkit/ccip-contract-examples/chains/evm/gobindings/generated/1_6_1/token_governor" |
There was a problem hiding this comment.
nice catch, did not know when the latest one was added
| return r, nil | ||
| } | ||
|
|
||
| return [32]byte{}, nil |
There was a problem hiding this comment.
better to return error for default case instead of empty?
There was a problem hiding this comment.
I agree, I will add error and remove check if it returns [32]byte32{}.
| state.SignerRegistry = signerRegistry | ||
| state.ABIByAddress[address] = signer_registry.SignerRegistryABI | ||
| case cldf.NewTypeAndVersion(ccipshared.TransparentUpgradeableProxy, deployment.Version1_6_1).String(): | ||
| token, err := burn_mint_erc20_transparent.NewBurnMintERC20Transparent(common.HexToAddress(address), chain.Client) |
There was a problem hiding this comment.
is it mandatory to have a NewBurnMintERC20Transparent associated with TransparentUpgradeableProxy?
it seems the deploy function of TransparentUpgradeableProxy could have deployment independent of NewBurnMintERC20Transparent with !initialize?
we may have to solidify this assumption
There was a problem hiding this comment.
Hey @simsonraj, let me try to explain the reasoning behind it and if we need to make loading state differently.
- The Implementation (
BurnMintERC20Transparent): This contract serves purely as a logic library. Its own storage is never initialized, so if we query it directly,symbol()returns an empty string. - The ProxyAdmin: This contract is strictly for administrative tasks (upgrades) and does not store any token metadata (like the symbol).
Because neither of these contracts holds the state (only the TUP Proxy does), we cannot fetch the symbol from them directly during state loading. I am using EIP-1967 storage slot lookups on the Proxy to deterministically link these addresses together, as that is the only reliable on-chain method to associate them without relying on event logs."
… into CCIP-9118/add-transparent-upgradable-proxy
|




This PR implements the full deployment for the
BurnMintERC20Transparenttoken using the standard OpenZeppelin Transparent Upgradeable Proxy (TUP) pattern.Contracts
Transparent Proxy Pattern: Adopted OpenZeppelin v5 TransparentUpgradeableProxy:
BurnMintERC20Transparent(Implementation)ProxyAdmin(automatically deployed to manage upgrades).PR: smartcontractkit/ccip-contract-examples#10
CLD
The following changes will be added to durable pipeline, when calling changesets: