Skip to content

Commit

Permalink
approve xtoken when register (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Mar 27, 2024
1 parent b1b9d13 commit 43f726e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions helix-contract/contracts/xtoken/v3/base/XTokenIssuing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ contract XTokenIssuing is XTokenBridgeBase {
}
xTokens[salt] = _xToken;
originalTokens[_xToken] = OriginalTokenInfo(_originalChainId, _originalToken);
require(IXToken(_xToken).approve(address(this), type(uint256).max) == true, "approve xtoken failed");
emit IssuingERC20Updated(_originalChainId, _originalToken, _xToken, oldxToken);
}

Expand Down
1 change: 1 addition & 0 deletions helix-contract/contracts/xtoken/v3/interfaces/IXToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ interface IXToken {
function acceptOwnership() external;
function mint(address account, uint256 amount) external;
function burn(address account, uint256 amount) external;
function approve(address spender, uint256 value) external returns (bool);
}

0 comments on commit 43f726e

Please sign in to comment.