The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
hyperlane-monorepo/solidity/contracts/token/extensions/HypXERC20Collateral.sol

27 lines
793 B

// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
import {IXERC20} from "../interfaces/IXERC20.sol";
import {HypERC20Collateral} from "../HypERC20Collateral.sol";
contract HypXERC20Collateral is HypERC20Collateral {
constructor(
address _xerc20,
address _mailbox
) HypERC20Collateral(_xerc20, _mailbox) {}
function _transferFromSender(
uint256 _amountOrId
) internal override returns (bytes memory metadata) {
IXERC20(address(wrappedToken)).burn(msg.sender, _amountOrId);
return "";
}
function _transferTo(
address _recipient,
uint256 _amountOrId,
bytes calldata /*metadata*/
) internal override {
IXERC20(address(wrappedToken)).mint(_recipient, _amountOrId);
}
}