Skip to content

Commit

Permalink
add onAccept events
Browse files Browse the repository at this point in the history
  • Loading branch information
seunlanlege committed Oct 11, 2023
1 parent 84a5c2d commit f0b0263
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions evm/src/modules/TokenGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ contract TokenGateway is IIsmpModule {
address private host;
address private admin;

// User has received some assets, source chain & nonce
event AssetReceived(bytes source, uint256 nonce);

// restricts call to `dispatcher`
modifier onlyIsmpHost() {
if (msg.sender != host || msg.sender != admin) {
Expand Down Expand Up @@ -59,6 +62,8 @@ contract TokenGateway is IIsmpModule {
(address _from, address to, uint256 amount, address tokenContract) = abi.decode(request.body, (address, address, uint256, address));

IERC6160Ext20(tokenContract).mint(to, amount, "");

emit AssetReceived(request.source, request.nonce);
}

function onPostTimeout(PostRequest memory request) public onlyIsmpHost {
Expand Down

0 comments on commit f0b0263

Please sign in to comment.