Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Goldsky config #98

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions omnichain/swap/contracts/Swap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ contract Swap is zContract {
error WrongGasContract();
error NotEnoughToPayGasFee();

// Define the SwapCompleted event
event SwapCompleted(
address indexed zrc20,
address indexed targetToken,
uint256 amount,
bytes recipient
);

constructor(address systemContractAddress) {
systemContract = SystemContract(systemContractAddress);
}
Expand Down Expand Up @@ -68,5 +76,13 @@ contract Swap is zContract {
recipientAddress,
outputAmount - gasFee
);

// Emit the SwapCompleted event
emit SwapCompleted(
zrc20,
targetTokenAddress,
outputAmount,
recipientAddress
);
}
}
20 changes: 20 additions & 0 deletions omnichain/swap/goldsky.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": "1",
"name": "swap",
"abis": {
"swap": {
"path": "artifacts/contracts/Swap.sol/Swap.json"
}
},
"chains": [
"zetachain-testnet"
],
"instances": [
{
"abi": "swap",
"address": "0x507D87b4Ce1Afd0C33C3AF2Ff0963d2d29BeE642",
"chain": "zetachain-testnet",
"startBlock": 2773831
}
]
}
Loading