zeta-chain / protocol-contracts

Protocol contracts implementing the core logic of the protocol, deployed on ZetaChain and on connected chains
MIT License
68 stars 55 forks source link

Rewrite `ZRC20` to allow setting Gateway address #279

Closed lumtis closed 1 month ago

lumtis commented 2 months ago

Rewrite the ZRC20 contract and add the Gateway address part of its data.

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.