You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rewrite the ZRC20 contract and add the Gateway address part of its data.
Add a gatewayAddress as part of its field
WARNING: we will upgrade the contract bytecode with MsgUpdateBytecode, we must carefully ensure we add a new field and we don't modify any of the existing field
Add a updateGatewayAddress callable by fungible address
Add gatewayAddress checks in deposit as the Gateway will be authorized to perform deposit to contracts.
To consider:
Solve some of the discrepancies we have in the contract like the non-constant field in all uppercase. Changing field name should not create any issues for bytecode upgrades.
Note: in the future we will proceed with a full refactoring of the ZRC20 contract with complete migration. Here we can give gateway privilege to deposit because we don't have arbitrary smart contract calls from gateway. In the future, when implementing arbitrary smart contract call on ZetaChain from Gateway, similar to EVM, privilege will need to be removed from the gateway like deposit. There will therefore be a full refactoring to do with new ZRC20 contracts. We will also in the future use OpenZeppelin for the ERC20 which is a better practice. Now let's just rewrite the current contract.
The text was updated successfully, but these errors were encountered:
Rewrite the ZRC20 contract and add the Gateway address part of its data.
Add a
gatewayAddress
as part of its fieldMsgUpdateBytecode
, we must carefully ensure we add a new field and we don't modify any of the existing fieldAdd a
updateGatewayAddress
callable by fungible addressAdd gatewayAddress checks in
deposit
as the Gateway will be authorized to perform deposit to contracts.To consider:
Note: in the future we will proceed with a full refactoring of the ZRC20 contract with complete migration. Here we can give
gateway
privilege to deposit because we don't have arbitrary smart contract calls from gateway. In the future, when implementing arbitrary smart contract call on ZetaChain from Gateway, similar to EVM, privilege will need to be removed from the gateway like deposit. There will therefore be a full refactoring to do with new ZRC20 contracts. We will also in the future use OpenZeppelin for the ERC20 which is a better practice. Now let's just rewrite the current contract.The text was updated successfully, but these errors were encountered: