BTC -> WBTC Aggregator Implementation
GitHub Repo
The TSAggregatorCornSiloWbtc implementation is available on the following repo.
Overview
- Inherits:
TSAggregator
- Deposits received WBTC into the CornSilo on the user's behalf with no swap required.
- No parallel functionality for swapping into the Thorchain network.
State Variables
IERC20 public immutable wbtc
ICornSilo public immutable cornSilo
Functions
constructor
Initializes the contract by setting up WBTC and CornSilo addresses and linking to the TSAggregator.
constructor(address _ttp, address _wBTC, address _cornSilo) TSAggregator(_ttp);
Parameters
Name | Type | Description |
---|---|---|
_ttp | address | Address of the Token Transfer Proxy. |
_wBTC | address | Address of the WBTC token contract. |
_cornSilo | address | Address of the CornSilo contract. |
swapOut
Swaps BTC to WBTC and deposits atomically into CornSilo.
function swapOut(address token, address to, uint256 amountOutMin) public nonReentrant;
Parameters
Name | Type | Description |
---|---|---|
token | address | The token address to swap from (must be WBTC). |
to | address | The recipient address of the WBTC. |
amountOutMin | uint256 | The minimum amount of WBTC to swap for. |