Scroll Router
Functions
swap
Paramaters
RouteParam
Parameter name | Type | Description |
---|---|---|
token_in | address | contract address of token to sell |
token_out | address | contract address of token to buy |
amount_in | u256 | amount of token to sell |
min_received | u256 | minimum received amount of user get |
destination | address | The receiver address for the output token |
swap_type | enum(SwapType) | swap type |
SwapType(Enum)
Parameter name | Value | Description |
---|---|---|
ethToToken | 0 | swap Eth to erc20 token |
tokenToEth | 1 | swap erc20 token to Eth |
tokenToToken | 2 | swap erc20 to erc20 token |
SwapParams
Parameter name | Type | Description |
---|---|---|
token_in | address | contract address of token to sell |
token_out | address | contract address of token to buy |
rate | u32 | rate * 10**4 gives 4 precision points |
protocol_id | u32 | procotol id |
pool_address | address | pool contract address |
swap_tpe | enum(SwapType) | swap type |
extra_data | Array<felt252> | extra data for route |
Events
Swap
Parameter name | Type | Description |
---|---|---|
sender | address | address that execute the transaction. |
token_in | address | contract address of token to sell |
token_out | address | contract address of token to buy |
amount_in | u256 | amount of token to sold |
amount_out | u256 | amount of token to bought. |
destination | address | receiver address for the output token |
Last updated