function swapExactETHForTokens( uint _amountOutMin, address[] calldata _path, address _to, uint _deadline) external virtual payable ensure(_deadline) returns (uint[] memory amounts)
์ฝ์ธ->ํ ํฐ์ผ๋ก swap (FROM->TO)
โป ์ฝ์ธ์ msg.value ํํ๋ก ์ถ๊ฐ
Parameters
Example
// 5000 ETH swapconst overrides = { gasLimit: 9999999, value : 5000}// ํ ํฐ ๊ฑฐ๋์ ๋ํ ํ์ฉawait mockToken0Contract.approve(routerContract.address, MaxUint256)// swapawait swapRouterContract.swapExactETHForTokens( 0, [WMATICContract.address, mockToken0Contract.address], accounts[0].address, MaxUint256, overrides)
2022.12.22