-
Notifications
You must be signed in to change notification settings - Fork 49
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
10 changed files
with
1,157 additions
and
2,275 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.26; | ||
|
||
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | ||
|
||
import {RevertContext, RevertOptions} from "@zetachain/protocol-contracts/contracts/Revert.sol"; | ||
import "@zetachain/protocol-contracts/contracts/zevm/interfaces/UniversalContract.sol"; | ||
import "@zetachain/protocol-contracts/contracts/zevm/interfaces/IGatewayZEVM.sol"; | ||
import "@zetachain/protocol-contracts/contracts/zevm/GatewayZEVM.sol"; | ||
|
||
contract Hello is UniversalContract { | ||
GatewayZEVM public gateway; | ||
|
||
event HelloEvent(string, string); | ||
event ContextDataRevert(RevertContext); | ||
event RevertEvent(string, RevertContext); | ||
|
||
address constant gatewayAddress = | ||
0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0; | ||
constructor(address payable gatewayAddress) { | ||
gateway = GatewayZEVM(gatewayAddress); | ||
} | ||
|
||
function onCrossChainCall( | ||
zContext calldata context, | ||
address zrc20, | ||
uint256 amount, | ||
bytes calldata message | ||
) external override { | ||
string memory decodedMessage; | ||
if (message.length > 0) { | ||
decodedMessage = abi.decode(message, (string)); | ||
} | ||
emit HelloEvent("Hello from a universal app", decodedMessage); | ||
string memory name = abi.decode(message, (string)); | ||
emit HelloEvent("Hello on ZetaChain", name); | ||
} | ||
|
||
function onRevert(RevertContext calldata revertContext) external override { | ||
emit ContextDataRevert(revertContext); | ||
emit RevertEvent("Revert on ZetaChain", revertContext); | ||
} | ||
} |
This file was deleted.
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
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 |
---|---|---|
|
@@ -2407,10 +2407,10 @@ | |
typescript "5.5.4" | ||
zod "3.22.4" | ||
|
||
"@zetachain/[email protected].2": | ||
version "3.0.2" | ||
resolved "https://registry.yarnpkg.com/@zetachain/localnet/-/localnet-3.0.2.tgz#4b9af86f8b0810a9a528073611c0e3a5ac49c28a" | ||
integrity sha512-nNBAOWWUuebUSuRMTwVnsF9V3W5HcWZ+vTiLSINMXBagbKyOJ4wQAK7nFBBB1UZBTnAcGPyMQVP+ymoEvEpn6g== | ||
"@zetachain/[email protected].3": | ||
version "3.0.3" | ||
resolved "https://registry.yarnpkg.com/@zetachain/localnet/-/localnet-3.0.3.tgz#2d822791c1814690971c35efc43be6b3743045e7" | ||
integrity sha512-s/DGVFzGwURwqw6krkU9jlMCUBYbwgOEQPpYbGwVqBHrMR4YB/EFur8FHz1Sc5VPMDV1VarbSsC253oI99Tulw== | ||
dependencies: | ||
"@inquirer/prompts" "^5.5.0" | ||
"@uniswap/v2-core" "^1.0.1" | ||
|
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 |
---|---|---|
|
@@ -29,7 +29,6 @@ | |
"@typescript-eslint/eslint-plugin": "^5.59.9", | ||
"@typescript-eslint/parser": "^5.59.9", | ||
"@zetachain/localnet": "3.0.2", | ||
"@zetachain/toolkit": "13.0.0-rc3", | ||
"axios": "^1.3.6", | ||
"chai": "^4.2.0", | ||
"dotenv": "^16.0.3", | ||
|
@@ -54,10 +53,10 @@ | |
"packageManager": "[email protected]+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72", | ||
"dependencies": { | ||
"@coral-xyz/anchor": "0.30.0", | ||
"@openzeppelin/contracts": "^4.9.6", | ||
"@solana-developers/helpers": "^2.4.0", | ||
"@solana/spl-memo": "^0.2.5", | ||
"@solana/web3.js": "^1.95.2", | ||
"@zetachain/protocol-contracts": "10.0.0-rc10" | ||
"@zetachain/protocol-contracts": "10.0.0-rc10", | ||
"@zetachain/toolkit": "13.0.0-rc4" | ||
} | ||
} |
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.