-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
800 additions
and
585 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ import "../../zevm/interfaces/IWZETA.sol"; | |
// The GatewayZEVM contract is the endpoint to call smart contracts on omnichain | ||
// The contract doesn't hold any funds and should never have active allowances | ||
contract GatewayZEVM is IGatewayZEVMEvents, IGatewayZEVMErrors, Initializable, OwnableUpgradeable, UUPSUpgradeable, ReentrancyGuard { | ||
error ZeroAddress(); | ||
|
||
address public constant FUNGIBLE_MODULE_ADDRESS = 0x735b14BB79463307AAcBED86DAf3322B1e6226aB; | ||
address public zetaToken; | ||
|
||
|
@@ -23,6 +25,10 @@ contract GatewayZEVM is IGatewayZEVMEvents, IGatewayZEVMErrors, Initializable, O | |
} | ||
|
||
function initialize(address _zetaToken) public initializer { | ||
Check warning Code scanning / Slither Conformance to Solidity naming conventions Warning
Parameter GatewayZEVM.initialize(address)._zetaToken is not in mixedCase
|
||
if (_zetaToken == address(0)) { | ||
revert ZeroAddress(); | ||
} | ||
|
||
__Ownable_init(); | ||
__UUPSUpgradeable_init(); | ||
zetaToken = _zetaToken; | ||
|
@@ -46,7 +52,7 @@ contract GatewayZEVM is IGatewayZEVMEvents, IGatewayZEVMErrors, Initializable, O | |
} | ||
|
||
function _transferZETA(uint256 amount, address to) internal { | ||
if (!IWETH9(zetaToken).transferFrom(msg.sender, address(this), amount)) revert ZetaTokenTransferFailed(); | ||
if (!IWETH9(zetaToken).transferFrom(msg.sender, address(this), amount)) revert FailedZetaSent(); | ||
IWETH9(zetaToken).withdraw(amount); | ||
(bool sent, ) = to.call{value: amount}(""); | ||
if (!sent) revert FailedZetaSent(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
290 changes: 145 additions & 145 deletions
290
...onnectorneweth.sol/zetaconnectorneweth.go → ...onnectornative.sol/zetaconnectornative.go
Large diffs are not rendered by default.
Oops, something went wrong.
290 changes: 145 additions & 145 deletions
290
...ornewnoneth.sol/zetaconnectornewnoneth.go → ...ornonnative.sol/zetaconnectornonnative.go
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
pkg/contracts/prototypes/zevm/igatewayzevm.sol/igatewayzevmerrors.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.