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. |