zeta-chain / protocol-contracts

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

Add a modifier to `UniversalContract` that prevents it from being called by anyone except gateway #341

Open fadeev opened 2 months ago

fadeev commented 2 months ago

The gateway equivalent to the onlySystem modifier.

https://github.com/zeta-chain/example-contracts/blob/ae9e49fd46f4d7c24321fa958ae3488d6dc4df1b/omnichain/swap/contracts/Swap.sol#L28

https://github.com/zeta-chain/toolkit/blob/748d3778fcefdd028ea38cc59de675d754149bdc/contracts/OnlySystem.sol

fadeev commented 2 months ago

Also, a modifier that can be used on EVM to allow a function to only be called by the gateway. Will be useful for https://github.com/zeta-chain/protocol-contracts/issues/344