This commit is contained in:
0xMochan
2024-03-01 14:41:00 -05:00
parent 5301131720
commit cad782f467
32 changed files with 32923 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
# ABIs
`get_abis.py` is a simple python script using the etherscan API (free plan) to gather ABIs for all of the contracts we are tracking!
We then can define all of the abis via `substreams_ethereum::Abigen::new` in our `build.rs`.
## Recommendation
It would be apt to convert (maybe through copilot) the python code into the `build.rs` file and then automate the `Abigen` functionality.
## Usage
Requires `python 3.8+`,
```bash
cd abi
python get_abis.py
```
This will populate the files in the `abi` folder.
When the `build.rs` file runs (when `rust-analyzer` activates or `cargo build` is manually ran), Abigen will generate new rust src files from the abis in the `src/abi` folder.

View File

@@ -0,0 +1,635 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "token",
"type": "address"
},
{
"indexed": false,
"name": "coins",
"type": "address[2]"
},
{
"indexed": false,
"name": "A",
"type": "uint256"
},
{
"indexed": false,
"name": "gamma",
"type": "uint256"
},
{
"indexed": false,
"name": "mid_fee",
"type": "uint256"
},
{
"indexed": false,
"name": "out_fee",
"type": "uint256"
},
{
"indexed": false,
"name": "allowed_extra_profit",
"type": "uint256"
},
{
"indexed": false,
"name": "fee_gamma",
"type": "uint256"
},
{
"indexed": false,
"name": "adjustment_step",
"type": "uint256"
},
{
"indexed": false,
"name": "admin_fee",
"type": "uint256"
},
{
"indexed": false,
"name": "ma_half_time",
"type": "uint256"
},
{
"indexed": false,
"name": "initial_price",
"type": "uint256"
},
{
"indexed": false,
"name": "deployer",
"type": "address"
}
],
"name": "CryptoPoolDeployed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "pool",
"type": "address"
},
{
"indexed": false,
"name": "token",
"type": "address"
},
{
"indexed": false,
"name": "gauge",
"type": "address"
}
],
"name": "LiquidityGaugeDeployed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "_old_fee_receiver",
"type": "address"
},
{
"indexed": false,
"name": "_new_fee_receiver",
"type": "address"
}
],
"name": "UpdateFeeReceiver",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "_old_pool_implementation",
"type": "address"
},
{
"indexed": false,
"name": "_new_pool_implementation",
"type": "address"
}
],
"name": "UpdatePoolImplementation",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "_old_token_implementation",
"type": "address"
},
{
"indexed": false,
"name": "_new_token_implementation",
"type": "address"
}
],
"name": "UpdateTokenImplementation",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "_old_gauge_implementation",
"type": "address"
},
{
"indexed": false,
"name": "_new_gauge_implementation",
"type": "address"
}
],
"name": "UpdateGaugeImplementation",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "_old_owner",
"type": "address"
},
{
"indexed": false,
"name": "_new_owner",
"type": "address"
}
],
"name": "TransferOwnership",
"type": "event"
},
{
"inputs": [
{
"name": "_fee_receiver",
"type": "address"
},
{
"name": "_pool_implementation",
"type": "address"
},
{
"name": "_token_implementation",
"type": "address"
},
{
"name": "_gauge_implementation",
"type": "address"
},
{
"name": "_weth",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"name": "_name",
"type": "string"
},
{
"name": "_symbol",
"type": "string"
},
{
"name": "_coins",
"type": "address[2]"
},
{
"name": "A",
"type": "uint256"
},
{
"name": "gamma",
"type": "uint256"
},
{
"name": "mid_fee",
"type": "uint256"
},
{
"name": "out_fee",
"type": "uint256"
},
{
"name": "allowed_extra_profit",
"type": "uint256"
},
{
"name": "fee_gamma",
"type": "uint256"
},
{
"name": "adjustment_step",
"type": "uint256"
},
{
"name": "admin_fee",
"type": "uint256"
},
{
"name": "ma_half_time",
"type": "uint256"
},
{
"name": "initial_price",
"type": "uint256"
}
],
"name": "deploy_pool",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "deploy_gauge",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_fee_receiver",
"type": "address"
}
],
"name": "set_fee_receiver",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_pool_implementation",
"type": "address"
}
],
"name": "set_pool_implementation",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_token_implementation",
"type": "address"
}
],
"name": "set_token_implementation",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_gauge_implementation",
"type": "address"
}
],
"name": "set_gauge_implementation",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_addr",
"type": "address"
}
],
"name": "commit_transfer_ownership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "accept_transfer_ownership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
}
],
"name": "find_pool_for_coins",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
},
{
"name": "i",
"type": "uint256"
}
],
"name": "find_pool_for_coins",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_coins",
"outputs": [
{
"name": "",
"type": "address[2]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_decimals",
"outputs": [
{
"name": "",
"type": "uint256[2]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_balances",
"outputs": [
{
"name": "",
"type": "uint256[2]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
}
],
"name": "get_coin_indices",
"outputs": [
{
"name": "",
"type": "uint256"
},
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_gauge",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_eth_index",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_token",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "admin",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "future_admin",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "fee_receiver",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pool_implementation",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "token_implementation",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gauge_implementation",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pool_count",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"name": "pool_list",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
]

View File

@@ -0,0 +1,751 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "pool",
"type": "address"
}
],
"name": "PoolAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "basepool",
"type": "address"
}
],
"name": "BasePoolAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "pool",
"type": "address"
}
],
"name": "PoolRemoved",
"type": "event"
},
{
"inputs": [
{
"name": "_address_provider",
"type": "address"
},
{
"name": "_base_pool_registry",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
}
],
"name": "find_pool_for_coins",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
},
{
"name": "i",
"type": "uint256"
}
],
"name": "find_pool_for_coins",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_n_coins",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_n_underlying_coins",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_coins",
"outputs": [
{
"name": "",
"type": "address[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_underlying_coins",
"outputs": [
{
"name": "",
"type": "address[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_decimals",
"outputs": [
{
"name": "",
"type": "uint256[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_underlying_decimals",
"outputs": [
{
"name": "",
"type": "uint256[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_gauges",
"outputs": [
{
"name": "",
"type": "address[10]"
},
{
"name": "",
"type": "int128[10]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_balances",
"outputs": [
{
"name": "",
"type": "uint256[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_underlying_balances",
"outputs": [
{
"name": "",
"type": "uint256[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_token",
"type": "address"
}
],
"name": "get_virtual_price_from_lp_token",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_A",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_D",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_gamma",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_fees",
"outputs": [
{
"name": "",
"type": "uint256[4]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_admin_balances",
"outputs": [
{
"name": "",
"type": "uint256[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
}
],
"name": "get_coin_indices",
"outputs": [
{
"name": "",
"type": "int128"
},
{
"name": "",
"type": "int128"
},
{
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "is_meta",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_base_pool",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_pool_name",
"outputs": [
{
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_lp_token",
"type": "address"
},
{
"name": "_gauge",
"type": "address"
},
{
"name": "_zap",
"type": "address"
},
{
"name": "_n_coins",
"type": "uint256"
},
{
"name": "_name",
"type": "string"
}
],
"name": "add_pool",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_lp_token",
"type": "address"
},
{
"name": "_gauge",
"type": "address"
},
{
"name": "_zap",
"type": "address"
},
{
"name": "_n_coins",
"type": "uint256"
},
{
"name": "_name",
"type": "string"
},
{
"name": "_base_pool",
"type": "address"
}
],
"name": "add_pool",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_lp_token",
"type": "address"
},
{
"name": "_gauge",
"type": "address"
},
{
"name": "_zap",
"type": "address"
},
{
"name": "_n_coins",
"type": "uint256"
},
{
"name": "_name",
"type": "string"
},
{
"name": "_base_pool",
"type": "address"
},
{
"name": "_has_positive_rebasing_tokens",
"type": "bool"
}
],
"name": "add_pool",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "remove_pool",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_liquidity_gauges",
"type": "address[10]"
}
],
"name": "set_liquidity_gauges",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_pools",
"type": "address[10]"
},
{
"name": "_liquidity_gauges",
"type": "address[10]"
}
],
"name": "batch_set_liquidity_gauges",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "address_provider",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "base_pool_registry",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"name": "pool_list",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pool_count",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "base_pool_count",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"name": "get_coin",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "coin_count",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"name": "get_pool_from_lp_token",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"name": "get_lp_token",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"name": "get_zap",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "last_updated",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]

View File

@@ -0,0 +1,48 @@
#!/usr/bin/python
import json
import os
import re
import time
import urllib.request
# Exports contract ABI in JSON
abis = {
# Factories
"CryptoSwapRegistry": "0x9a32aF1A11D9c937aEa61A3790C2983257eA8Bc0",
"MainRegistry": "0x90E00ACe148ca3b23Ac1bC8C240C2a7Dd9c2d7f5",
"MetaPoolFactory": "0xB9fC157394Af804a3578134A6585C0dc9cc990d4",
"CryptoPoolFactory": "0xF18056Bbd320E96A48e3Fbf8bC061322531aac99",
# pool
"Pool": "0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7",
}
ABI_ENDPOINT = (
"https://api.etherscan.io/api?module=contract&action=getabi&address={address}"
)
if etherscan_key := os.environ.get("ETHERSCAN_API_TOKEN"):
print("API KEY Loaded!")
ABI_ENDPOINT += f"&apikey={etherscan_key}"
def __main__():
for name, addr in abis.items():
normalized_name = "_".join(re.findall(r"[A-Z]+[a-z]*", name)).lower()
print(f"Getting ABI for {name} at {addr} ({normalized_name})")
try:
with urllib.request.urlopen(ABI_ENDPOINT.format(address=addr)) as response:
response_json = json.loads(response.read().decode())
abi_json = json.loads(response_json["result"])
result = json.dumps(abi_json, indent=4, sort_keys=True)
with open(f"{normalized_name}.json", "w") as f:
f.write(result)
except Exception as err:
print(response.content)
raise err
time.sleep(0.25)
if __name__ == "__main__":
__main__()

View File

@@ -0,0 +1,940 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "pool",
"type": "address"
},
{
"indexed": false,
"name": "rate_method_id",
"type": "bytes"
}
],
"name": "PoolAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "pool",
"type": "address"
}
],
"name": "PoolRemoved",
"type": "event"
},
{
"inputs": [
{
"name": "_address_provider",
"type": "address"
},
{
"name": "_gauge_controller",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
}
],
"name": "find_pool_for_coins",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
},
{
"name": "i",
"type": "uint256"
}
],
"name": "find_pool_for_coins",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 1521,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_n_coins",
"outputs": [
{
"name": "",
"type": "uint256[2]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 12102,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_coins",
"outputs": [
{
"name": "",
"type": "address[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 12194,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_underlying_coins",
"outputs": [
{
"name": "",
"type": "address[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 7874,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_decimals",
"outputs": [
{
"name": "",
"type": "uint256[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 7966,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_underlying_decimals",
"outputs": [
{
"name": "",
"type": "uint256[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 36992,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_rates",
"outputs": [
{
"name": "",
"type": "uint256[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 20157,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_gauges",
"outputs": [
{
"name": "",
"type": "address[10]"
},
{
"name": "",
"type": "int128[10]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 16583,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_balances",
"outputs": [
{
"name": "",
"type": "uint256[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 162842,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_underlying_balances",
"outputs": [
{
"name": "",
"type": "uint256[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 1927,
"inputs": [
{
"name": "_token",
"type": "address"
}
],
"name": "get_virtual_price_from_lp_token",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 1045,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_A",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 6305,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_parameters",
"outputs": [
{
"name": "A",
"type": "uint256"
},
{
"name": "future_A",
"type": "uint256"
},
{
"name": "fee",
"type": "uint256"
},
{
"name": "admin_fee",
"type": "uint256"
},
{
"name": "future_fee",
"type": "uint256"
},
{
"name": "future_admin_fee",
"type": "uint256"
},
{
"name": "future_owner",
"type": "address"
},
{
"name": "initial_A",
"type": "uint256"
},
{
"name": "initial_A_time",
"type": "uint256"
},
{
"name": "future_A_time",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 1450,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_fees",
"outputs": [
{
"name": "",
"type": "uint256[2]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 36454,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_admin_balances",
"outputs": [
{
"name": "",
"type": "uint256[8]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 27131,
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
}
],
"name": "get_coin_indices",
"outputs": [
{
"name": "",
"type": "int128"
},
{
"name": "",
"type": "int128"
},
{
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 32004,
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
}
],
"name": "estimate_gas_used",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 1900,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "is_meta",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 8323,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_pool_name",
"outputs": [
{
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 1951,
"inputs": [
{
"name": "_coin",
"type": "address"
}
],
"name": "get_coin_swap_count",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2090,
"inputs": [
{
"name": "_coin",
"type": "address"
},
{
"name": "_index",
"type": "uint256"
}
],
"name": "get_coin_swap_complement",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2011,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "get_pool_asset_type",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 61485845,
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_n_coins",
"type": "uint256"
},
{
"name": "_lp_token",
"type": "address"
},
{
"name": "_rate_info",
"type": "bytes32"
},
{
"name": "_decimals",
"type": "uint256"
},
{
"name": "_underlying_decimals",
"type": "uint256"
},
{
"name": "_has_initial_A",
"type": "bool"
},
{
"name": "_is_v1",
"type": "bool"
},
{
"name": "_name",
"type": "string"
}
],
"name": "add_pool",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 31306062,
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_n_coins",
"type": "uint256"
},
{
"name": "_lp_token",
"type": "address"
},
{
"name": "_rate_info",
"type": "bytes32"
},
{
"name": "_decimals",
"type": "uint256"
},
{
"name": "_use_rates",
"type": "uint256"
},
{
"name": "_has_initial_A",
"type": "bool"
},
{
"name": "_is_v1",
"type": "bool"
},
{
"name": "_name",
"type": "string"
}
],
"name": "add_pool_without_underlying",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_n_coins",
"type": "uint256"
},
{
"name": "_lp_token",
"type": "address"
},
{
"name": "_decimals",
"type": "uint256"
},
{
"name": "_name",
"type": "string"
}
],
"name": "add_metapool",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_n_coins",
"type": "uint256"
},
{
"name": "_lp_token",
"type": "address"
},
{
"name": "_decimals",
"type": "uint256"
},
{
"name": "_name",
"type": "string"
},
{
"name": "_base_pool",
"type": "address"
}
],
"name": "add_metapool",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 779731418758,
"inputs": [
{
"name": "_pool",
"type": "address"
}
],
"name": "remove_pool",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 390460,
"inputs": [
{
"name": "_addr",
"type": "address[5]"
},
{
"name": "_amount",
"type": "uint256[2][5]"
}
],
"name": "set_pool_gas_estimates",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 392047,
"inputs": [
{
"name": "_addr",
"type": "address[10]"
},
{
"name": "_amount",
"type": "uint256[10]"
}
],
"name": "set_coin_gas_estimates",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 72629,
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_estimator",
"type": "address"
}
],
"name": "set_gas_estimate_contract",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 400675,
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_liquidity_gauges",
"type": "address[10]"
}
],
"name": "set_liquidity_gauges",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 72667,
"inputs": [
{
"name": "_pool",
"type": "address"
},
{
"name": "_asset_type",
"type": "uint256"
}
],
"name": "set_pool_asset_type",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 1173447,
"inputs": [
{
"name": "_pools",
"type": "address[32]"
},
{
"name": "_asset_types",
"type": "uint256[32]"
}
],
"name": "batch_set_pool_asset_type",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 2048,
"inputs": [],
"name": "address_provider",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2078,
"inputs": [],
"name": "gauge_controller",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2217,
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"name": "pool_list",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2138,
"inputs": [],
"name": "pool_count",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2168,
"inputs": [],
"name": "coin_count",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2307,
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"name": "get_coin",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2443,
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"name": "get_pool_from_lp_token",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2473,
"inputs": [
{
"name": "arg0",
"type": "address"
}
],
"name": "get_lp_token",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2288,
"inputs": [],
"name": "last_updated",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,838 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "buyer",
"type": "address"
},
{
"indexed": false,
"name": "sold_id",
"type": "int128"
},
{
"indexed": false,
"name": "tokens_sold",
"type": "uint256"
},
{
"indexed": false,
"name": "bought_id",
"type": "int128"
},
{
"indexed": false,
"name": "tokens_bought",
"type": "uint256"
}
],
"name": "TokenExchange",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "provider",
"type": "address"
},
{
"indexed": false,
"name": "token_amounts",
"type": "uint256[3]"
},
{
"indexed": false,
"name": "fees",
"type": "uint256[3]"
},
{
"indexed": false,
"name": "invariant",
"type": "uint256"
},
{
"indexed": false,
"name": "token_supply",
"type": "uint256"
}
],
"name": "AddLiquidity",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "provider",
"type": "address"
},
{
"indexed": false,
"name": "token_amounts",
"type": "uint256[3]"
},
{
"indexed": false,
"name": "fees",
"type": "uint256[3]"
},
{
"indexed": false,
"name": "token_supply",
"type": "uint256"
}
],
"name": "RemoveLiquidity",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "provider",
"type": "address"
},
{
"indexed": false,
"name": "token_amount",
"type": "uint256"
},
{
"indexed": false,
"name": "coin_amount",
"type": "uint256"
}
],
"name": "RemoveLiquidityOne",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "provider",
"type": "address"
},
{
"indexed": false,
"name": "token_amounts",
"type": "uint256[3]"
},
{
"indexed": false,
"name": "fees",
"type": "uint256[3]"
},
{
"indexed": false,
"name": "invariant",
"type": "uint256"
},
{
"indexed": false,
"name": "token_supply",
"type": "uint256"
}
],
"name": "RemoveLiquidityImbalance",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "deadline",
"type": "uint256"
},
{
"indexed": true,
"name": "admin",
"type": "address"
}
],
"name": "CommitNewAdmin",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "admin",
"type": "address"
}
],
"name": "NewAdmin",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "deadline",
"type": "uint256"
},
{
"indexed": false,
"name": "fee",
"type": "uint256"
},
{
"indexed": false,
"name": "admin_fee",
"type": "uint256"
}
],
"name": "CommitNewFee",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "fee",
"type": "uint256"
},
{
"indexed": false,
"name": "admin_fee",
"type": "uint256"
}
],
"name": "NewFee",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "old_A",
"type": "uint256"
},
{
"indexed": false,
"name": "new_A",
"type": "uint256"
},
{
"indexed": false,
"name": "initial_time",
"type": "uint256"
},
{
"indexed": false,
"name": "future_time",
"type": "uint256"
}
],
"name": "RampA",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "A",
"type": "uint256"
},
{
"indexed": false,
"name": "t",
"type": "uint256"
}
],
"name": "StopRampA",
"type": "event"
},
{
"inputs": [
{
"name": "_owner",
"type": "address"
},
{
"name": "_coins",
"type": "address[3]"
},
{
"name": "_pool_token",
"type": "address"
},
{
"name": "_A",
"type": "uint256"
},
{
"name": "_fee",
"type": "uint256"
},
{
"name": "_admin_fee",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"gas": 5227,
"inputs": [],
"name": "A",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 1133537,
"inputs": [],
"name": "get_virtual_price",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 4508776,
"inputs": [
{
"name": "amounts",
"type": "uint256[3]"
},
{
"name": "deposit",
"type": "bool"
}
],
"name": "calc_token_amount",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 6954858,
"inputs": [
{
"name": "amounts",
"type": "uint256[3]"
},
{
"name": "min_mint_amount",
"type": "uint256"
}
],
"name": "add_liquidity",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 2673791,
"inputs": [
{
"name": "i",
"type": "int128"
},
{
"name": "j",
"type": "int128"
},
{
"name": "dx",
"type": "uint256"
}
],
"name": "get_dy",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2673474,
"inputs": [
{
"name": "i",
"type": "int128"
},
{
"name": "j",
"type": "int128"
},
{
"name": "dx",
"type": "uint256"
}
],
"name": "get_dy_underlying",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2818066,
"inputs": [
{
"name": "i",
"type": "int128"
},
{
"name": "j",
"type": "int128"
},
{
"name": "dx",
"type": "uint256"
},
{
"name": "min_dy",
"type": "uint256"
}
],
"name": "exchange",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 192846,
"inputs": [
{
"name": "_amount",
"type": "uint256"
},
{
"name": "min_amounts",
"type": "uint256[3]"
}
],
"name": "remove_liquidity",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 6951851,
"inputs": [
{
"name": "amounts",
"type": "uint256[3]"
},
{
"name": "max_burn_amount",
"type": "uint256"
}
],
"name": "remove_liquidity_imbalance",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 1102,
"inputs": [
{
"name": "_token_amount",
"type": "uint256"
},
{
"name": "i",
"type": "int128"
}
],
"name": "calc_withdraw_one_coin",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 4025523,
"inputs": [
{
"name": "_token_amount",
"type": "uint256"
},
{
"name": "i",
"type": "int128"
},
{
"name": "min_amount",
"type": "uint256"
}
],
"name": "remove_liquidity_one_coin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 151919,
"inputs": [
{
"name": "_future_A",
"type": "uint256"
},
{
"name": "_future_time",
"type": "uint256"
}
],
"name": "ramp_A",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 148637,
"inputs": [],
"name": "stop_ramp_A",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 110461,
"inputs": [
{
"name": "new_fee",
"type": "uint256"
},
{
"name": "new_admin_fee",
"type": "uint256"
}
],
"name": "commit_new_fee",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 97242,
"inputs": [],
"name": "apply_new_fee",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 21895,
"inputs": [],
"name": "revert_new_parameters",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 74572,
"inputs": [
{
"name": "_owner",
"type": "address"
}
],
"name": "commit_transfer_ownership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 60710,
"inputs": [],
"name": "apply_transfer_ownership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 21985,
"inputs": [],
"name": "revert_transfer_ownership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 3481,
"inputs": [
{
"name": "i",
"type": "uint256"
}
],
"name": "admin_balances",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 21502,
"inputs": [],
"name": "withdraw_admin_fees",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 111389,
"inputs": [],
"name": "donate_admin_fees",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 37998,
"inputs": [],
"name": "kill_me",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 22135,
"inputs": [],
"name": "unkill_me",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"gas": 2220,
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"name": "coins",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2250,
"inputs": [
{
"name": "arg0",
"type": "uint256"
}
],
"name": "balances",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2171,
"inputs": [],
"name": "fee",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2201,
"inputs": [],
"name": "admin_fee",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2231,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2261,
"inputs": [],
"name": "initial_A",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2291,
"inputs": [],
"name": "future_A",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2321,
"inputs": [],
"name": "initial_A_time",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2351,
"inputs": [],
"name": "future_A_time",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2381,
"inputs": [],
"name": "admin_actions_deadline",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2411,
"inputs": [],
"name": "transfer_ownership_deadline",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2441,
"inputs": [],
"name": "future_fee",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2471,
"inputs": [],
"name": "future_admin_fee",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"gas": 2501,
"inputs": [],
"name": "future_owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
]