diff --git a/omnichain/swap/contracts/Swap.sol b/omnichain/swap/contracts/Swap.sol index de53d39..629680f 100644 --- a/omnichain/swap/contracts/Swap.sol +++ b/omnichain/swap/contracts/Swap.sol @@ -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); } @@ -68,5 +76,13 @@ contract Swap is zContract { recipientAddress, outputAmount - gasFee ); + + // Emit the SwapCompleted event + emit SwapCompleted( + zrc20, + targetTokenAddress, + outputAmount, + recipientAddress + ); } } diff --git a/omnichain/swap/goldsky.json b/omnichain/swap/goldsky.json new file mode 100644 index 0000000..b850540 --- /dev/null +++ b/omnichain/swap/goldsky.json @@ -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 + } + ] +} \ No newline at end of file