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

chore: Update solidity contract for multi-asset-delegation pallet #855

Merged
merged 2 commits into from
Dec 20, 2024
Merged
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
30 changes: 18 additions & 12 deletions precompiles/multi-asset-delegation/MultiAssetDelegation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,42 +46,48 @@ interface MultiAssetDelegation {
function goOnline() external returns (uint8);

/// @dev Deposit an amount of an asset.
/// @param assetId The ID of the asset.
/// @param assetId The ID of the asset (0 for ERC20).
/// @param tokenAddress The address of the ERC20 token (if assetId is 0).
/// @param amount The amount to deposit.
function deposit(uint256 assetId, uint256 amount) external returns (uint8);
function deposit(uint256 assetId, address tokenAddress, uint256 amount) external returns (uint8);

/// @dev Schedule a withdrawal of an amount of an asset.
/// @param assetId The ID of the asset.
/// @param assetId The ID of the asset (0 for ERC20).
/// @param tokenAddress The address of the ERC20 token (if assetId is 0).
/// @param amount The amount to withdraw.
function scheduleWithdraw(uint256 assetId, uint256 amount) external returns (uint8);
function scheduleWithdraw(uint256 assetId, address tokenAddress, uint256 amount) external returns (uint8);

/// @dev Execute the scheduled withdrawal.
function executeWithdraw() external returns (uint8);

/// @dev Cancel the scheduled withdrawal.
/// @param assetId The ID of the asset.
/// @param assetId The ID of the asset (0 for ERC20).
/// @param tokenAddress The address of the ERC20 token (if assetId is 0).
/// @param amount The amount to cancel withdrawal.
function cancelWithdraw(uint256 assetId, uint256 amount) external returns (uint8);
function cancelWithdraw(uint256 assetId, address tokenAddress, uint256 amount) external returns (uint8);

/// @dev Delegate an amount of an asset to an operator.
/// @param operator The address of the operator.
/// @param assetId The ID of the asset.
/// @param assetId The ID of the asset (0 for ERC20).
/// @param tokenAddress The address of the ERC20 token (if assetId is 0).
/// @param amount The amount to delegate.
/// @param blueprintSelection The blueprint selection.
function delegate(bytes32 operator, uint256 assetId, uint256 amount, uint64[] memory blueprintSelection) external returns (uint8);
function delegate(bytes32 operator, uint256 assetId, address tokenAddress, uint256 amount, uint64[] memory blueprintSelection) external returns (uint8);

/// @dev Schedule an unstake of an amount of an asset as a delegator.
/// @param operator The address of the operator.
/// @param assetId The ID of the asset.
/// @param assetId The ID of the asset (0 for ERC20).
/// @param tokenAddress The address of the ERC20 token (if assetId is 0).
/// @param amount The amount to unstake.
function scheduleDelegatorUnstake(bytes32 operator, uint256 assetId, uint256 amount) external returns (uint8);
function scheduleDelegatorUnstake(bytes32 operator, uint256 assetId, address tokenAddress, uint256 amount) external returns (uint8);

/// @dev Execute the scheduled unstake as a delegator.
function executeDelegatorUnstake() external returns (uint8);

/// @dev Cancel the scheduled unstake as a delegator.
/// @param operator The address of the operator.
/// @param assetId The ID of the asset.
/// @param assetId The ID of the asset (0 for ERC20).
/// @param tokenAddress The address of the ERC20 token (if assetId is 0).
/// @param amount The amount to cancel unstake.
function cancelDelegatorUnstake(bytes32 operator, uint256 assetId, uint256 amount) external returns (uint8);
function cancelDelegatorUnstake(bytes32 operator, uint256 assetId, address tokenAddress, uint256 amount) external returns (uint8);
}
Loading