-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update gateway to registry * fixed test * fmt * make agents relative to the relaychain * use address(this) * fmt * log out reciept and drop sent amount * update cumulus * use real agent ids * create agents on initialize * Revert "create agents on initialize" This reverts commit e53557d. * update agents and fix abi encode * encode with enum * fmt * update cumulus * fix encoding * fix tests * update cumulus * rustfmt * remove duplicate enum * generate bindings * remove tuple * use framebenchmarking v2 * updated cumulus
- Loading branch information
1 parent
c9c98ef
commit b0f922c
Showing
23 changed files
with
535 additions
and
257 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
|
||
import {ParaID} from "./Types.sol"; | ||
import {AgentExecuteCommand, ParaID} from "./Types.sol"; | ||
import {SubstrateTypes} from "./SubstrateTypes.sol"; | ||
|
||
import {IERC20} from "./interfaces/IERC20.sol"; | ||
|
@@ -12,11 +12,9 @@ contract AgentExecutor { | |
using SafeTokenTransfer for IERC20; | ||
using SafeNativeTransfer for address payable; | ||
|
||
bytes32 internal constant COMMAND_TRANSFER_TOKEN = keccak256("transferToken"); | ||
|
||
function execute(address, bytes memory data) external { | ||
(bytes32 command, bytes memory params) = abi.decode(data, (bytes32, bytes)); | ||
if (command == COMMAND_TRANSFER_TOKEN) { | ||
(AgentExecuteCommand command, bytes memory params) = abi.decode(data, (AgentExecuteCommand, bytes)); | ||
if (command == AgentExecuteCommand.TransferToken) { | ||
(address token, address recipient, uint128 amount) = abi.decode(params, (address, address, uint128)); | ||
_transferToken(token, recipient, amount); | ||
} | ||
|
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 |
---|---|---|
|
@@ -55,3 +55,5 @@ enum Command { | |
SetOperatingMode, | ||
TransferNativeFromAgent | ||
} | ||
|
||
enum AgentExecuteCommand {TransferToken} |
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
Submodule cumulus
updated
5 files
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Oops, something went wrong.