Skip to content

Commit

Permalink
Merge pull request #287 from KomodoPlatform/add/gas-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
gcharang authored Sep 9, 2024
2 parents 05eeeb0 + fbb85df commit 5265dd8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
1 change: 1 addition & 0 deletions filepathSlugs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3799,6 +3799,7 @@
"utxo-coin-example",
"antara-smartchain-example",
"1c-evm-like-tokens-eth-erc-20-matic-plg-20-bnb-bep-20",
"gas-limit-options",
"erc-20-token-example",
"bep-20-token-example",
"1d-qrc-20-tokens",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,28 @@ The token's contract **must** have `approve` and `transferFrom` methods. Additio
* Protocol `"type"` field: `"ETH"` or `"ERC20"`
* Protocol `"protocol_data"` field (ERC20 only): `"platform"` - `"ETH"`, `"ETC"` or other Ethereum forks. `"contract_address"` - ERC20 token [checksummed](https://coincodex.com/article/2078/ethereum-address-checksum-explained/) smart contract address.

| Parameter | Type | Description |
| ----------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| chain\_id | integer | To find the EVM chain ID, see [Chainlist](https://chainlist.org/) |
| protocol.type | string | Platform / protocol - e.g `ETH` for Ethereum, `ERC20` for ERC20 tokens on the Ethereum network |
| protocol.protocol\_data | object | Required for tokens only. |
| protocol.protocol\_data.platform | string | The parent coin of the token's platform - e.g `MATIC` for PLG20 tokens |
| protocol.protocol\_data.contract\_address | string | **Must be mixed case** The indentifying hex string for the token's contract. Can be found on sites like [EthScan](https://etherscan.io/), [BscScan](https://bscscan.com/) & [PolygonScan](https://polygonscan.com/) |
| Parameter | Type | Description |
| ----------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| chain\_id | integer | To find the EVM chain ID, see [Chainlist](https://chainlist.org/) |
| gas\_limit | object | Optional, required for tokens only. Defines more precise gas prices for swap or transaction operations. Some tokens are called over proxy contracts which often require more gas, though users may be able to choose higher/lower values than the default where required. See the `Gas Limit Options` table below for more information. |
| protocol.type | string | Platform / protocol - e.g `ETH` for Ethereum, `ERC20` for ERC20 tokens on the Ethereum network |
| protocol.protocol\_data | object | Required for tokens only. |
| protocol.protocol\_data.platform | string | The parent coin of the token's platform - e.g `MATIC` for PLG20 tokens |
| protocol.protocol\_data.contract\_address | string | **Must be mixed case** The identifying hex string for the token's contract. Can be found on sites like [EthScan](https://etherscan.io/), [BscScan](https://bscscan.com/) & [PolygonScan](https://polygonscan.com/) |

### Gas Limit Options

| Parameter | Type | Description |
| ---------------------- | ------- | ------------------------------------------------------- |
| eth\_send\_coins | integer | Gas limit for sending coins. |
| eth\_send\_erc20 | integer | Gas limit for sending ERC20 tokens. |
| eth\_payment | integer | Gas limit for swap payment tx with coins. |
| erc20\_payment | integer | Gas limit for swap payment tx with ERC20 tokens. |
| eth\_receiver\_spend | integer | Gas limit for swap receiver spend tx with coins. |
| erc20\_receiver\_spend | integer | Gas limit for swap receiver spend tx with ERC20 tokens. |
| eth\_sender\_refund | integer | Gas limit for swap refund tx with coins. |
| erc20\_sender\_refund | integer | Gas limit for swap refund tx with with ERC20 tokens. |
| eth\_max\_trade\_gas | integer | Gas limit for other operations. |

### ERC20 token example

Expand All @@ -152,6 +167,17 @@ The token's contract **must** have `approve` and `transferFrom` methods. Additio
"platform": "ETH",
"contract_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
}
},
"gas_limit": {
"eth_send_coins": 21000,
"eth_send_erc20": 65000,
"eth_payment": 75000,
"erc20_payment": 120000,
"eth_receiver_spend": 55000,
"erc20_receiver_spend": 130000,
"eth_sender_refund": 110000,
"erc20_sender_refund": 110000,
"eth_max_trade_gas": 150000
}
}
```
Expand Down

0 comments on commit 5265dd8

Please sign in to comment.