-
Notifications
You must be signed in to change notification settings - Fork 108
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
65 changed files
with
926 additions
and
581 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
/// @title An agent contract that acts on behalf of a consensus system on Polkadot | ||
/// @dev Instances of this contract act as an agents for arbitrary consensus systems on Polkadot. These consensus systems | ||
|
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,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {AgentExecuteCommand, ParaID} from "./Types.sol"; | ||
import {SubstrateTypes} from "./SubstrateTypes.sol"; | ||
|
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,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {IERC20} from "./interfaces/IERC20.sol"; | ||
import {IGateway} from "./interfaces/IGateway.sol"; | ||
|
@@ -17,12 +17,6 @@ library Assets { | |
using Address for address; | ||
using SafeTokenTransferFrom for IERC20; | ||
|
||
/// @dev Emitted once the funds are locked and a message is successfully queued. | ||
event TokenSent( | ||
address indexed token, address indexed sender, ParaID destinationChain, bytes destinationAddress, uint128 amount | ||
); | ||
event TokenRegistrationSent(address token); | ||
|
||
/* Errors */ | ||
error InvalidToken(); | ||
error InvalidAmount(); | ||
|
@@ -49,13 +43,13 @@ library Assets { | |
|
||
_transferToAgent(assetHubAgent, token, sender, amount); | ||
if (destinationChain == assetHubParaID) { | ||
payload = SubstrateTypes.SendToken(address(this), token, destinationAddress, amount); | ||
payload = SubstrateTypes.SendToken(token, destinationAddress, amount); | ||
} else { | ||
payload = SubstrateTypes.SendToken(address(this), token, destinationChain, destinationAddress, amount); | ||
payload = SubstrateTypes.SendToken(token, destinationChain, destinationAddress, amount); | ||
} | ||
extraFee = $.sendTokenFee; | ||
|
||
emit TokenSent(sender, token, destinationChain, abi.encodePacked(destinationAddress), amount); | ||
emit IGateway.TokenSent(sender, token, destinationChain, abi.encodePacked(destinationAddress), amount); | ||
} | ||
|
||
function sendToken( | ||
|
@@ -77,7 +71,7 @@ library Assets { | |
|
||
payload = SubstrateTypes.SendToken(address(this), token, destinationChain, destinationAddress, amount); | ||
extraFee = $.sendTokenFee; | ||
emit TokenSent(sender, token, destinationChain, abi.encodePacked(destinationAddress), amount); | ||
emit IGateway.TokenSent(sender, token, destinationChain, abi.encodePacked(destinationAddress), amount); | ||
} | ||
|
||
/// @dev transfer tokens from the sender to the specified | ||
|
@@ -102,9 +96,9 @@ library Assets { | |
revert InvalidToken(); | ||
} | ||
|
||
payload = SubstrateTypes.RegisterToken(address(this), token); | ||
payload = SubstrateTypes.RegisterToken(token); | ||
extraFee = $.registerTokenFee; | ||
|
||
emit TokenRegistrationSent(token); | ||
emit IGateway.TokenRegistrationSent(token); | ||
} | ||
} |
Oops, something went wrong.