├── keys.txt ├── requirements.txt ├── keys.example.txt ├── bridge ├── __pycache__ │ ├── eth_bridge.cpython-311.pyc │ └── usdc_bridge.cpython-311.pyc ├── eth_bridge.py └── usdc_bridge.py ├── README.md ├── abis ├── router_eth_abi.json ├── usdc_abi.json └── router_abi.json ├── use_eth_bridge.py └── use_usdc_bridge.py /keys.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | web3>=6.0.0 2 | -------------------------------------------------------------------------------- /keys.example.txt: -------------------------------------------------------------------------------- 1 | YOUR_PRIVATE_KEY 2 | YOUR_NEXT_PRIVATE_KEY_WITHOUT_COMMA -------------------------------------------------------------------------------- /bridge/__pycache__/eth_bridge.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nazavod777/Stargate-bridge-accounts_delete_logger/HEAD/bridge/__pycache__/eth_bridge.cpython-311.pyc -------------------------------------------------------------------------------- /bridge/__pycache__/usdc_bridge.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nazavod777/Stargate-bridge-accounts_delete_logger/HEAD/bridge/__pycache__/usdc_bridge.cpython-311.pyc -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Stargate Bridger for multiaccounts 2 | 3 | ## Script to bridge on Stargate.finance 4 | 5 | ### You can bridge ETH between arbitrum to optimism, and USDC between polygon and fantom 6 | 7 | Script will loop through wallet and transfer ETH or USDC from the network with from the bigger balance, wait for 8 | minutes and loop once again 9 | --- 10 | ## Before start ## 11 | 12 | 13 | 1. Install python 3.10+ 14 | 2. Clone repository 15 | 3. Install required packages 16 | ```commandline 17 | pip install -r requirements.txt 18 | ``` 19 | 4. Fund your wallets with ETH on arbitrum or optimism if you want to bridget ETH 20 | ### OR 21 | 4. Fund your wallets with USDC on fantom or polygon and a bit of matic/fantom for commission if you want to bridge USDC. 22 | 5. Create a keys.txt file with private keys following the example of keys.example.txt 23 | --- 24 | ## Usage ## 25 | 26 | For using ETH bridge: 27 | 28 | ``` 29 | python use_eth_bridge.py 30 | ``` 31 | 32 | 33 | For using USDC bridge: 34 | 35 | ``` 36 | python use_usdc_bridge.py 37 | ``` 38 | -------------------------------------------------------------------------------- /abis/router_eth_abi.json: -------------------------------------------------------------------------------- 1 | [{"inputs":[{"internalType":"address","name":"_stargateEthVault","type":"address"},{"internalType":"address","name":"_stargateRouter","type":"address"},{"internalType":"uint16","name":"_poolId","type":"uint16"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"addLiquidityETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"poolId","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stargateEthVault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stargateRouter","outputs":[{"internalType":"contract IStargateRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_amountLD","type":"uint256"},{"internalType":"uint256","name":"_minAmountLD","type":"uint256"}],"name":"swapETH","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}] -------------------------------------------------------------------------------- /use_eth_bridge.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | from web3 import Account, Web3 4 | from bridge.eth_bridge import swap_eth_arbitrum_optimism, swap_eth_optimism_arbitrum, get_balance_eth_arbitrum, get_balance_eth_optimism 5 | 6 | 7 | def main(tr): 8 | with open('keys.txt', 'r') as keys_file: 9 | accounts = [Account.from_key(line.replace("\n", "")) for line in keys_file.readlines()] 10 | for _ in range(0, tr): 11 | for account in accounts: 12 | arbitrum_balance = get_balance_eth_arbitrum(account.address) 13 | optimism_balance = get_balance_eth_optimism(account.address) 14 | 15 | if arbitrum_balance + optimism_balance < Web3.to_wei(0.02, 'ether'): 16 | continue 17 | 18 | if arbitrum_balance > optimism_balance: 19 | print("Swapping ETH from Arbitrum to Optimism...") 20 | arbitrum_to_optimism_txs_hash = swap_eth_arbitrum_optimism(account=account, amount=arbitrum_balance - Web3.to_wei(0.01, 'ether')) 21 | print("Waiting for the swap to complete...") 22 | time.sleep(20) 23 | print(f"Transaction: https://arbiscan.io/tx/{arbitrum_to_optimism_txs_hash.hex()}") 24 | else: 25 | print("Swapping ETH from Optimism to Arbitrum...") 26 | optimism_to_arbitrum_txs_hash = swap_eth_optimism_arbitrum(account=account, amount=optimism_balance - Web3.to_wei(0.01, 'ether')) 27 | print("Waiting for the swap to complete...") 28 | time.sleep(20) 29 | print(f"Transaction: https://optimistic.etherscan.io/tx{optimism_to_arbitrum_txs_hash.hex()}") 30 | 31 | print("Sleeping 60 seconds for the next account") 32 | time.sleep(60) 33 | 34 | print("Sleeping 1200 seconds for the next cycle") 35 | time.sleep(1200) 36 | 37 | 38 | if __name__ == '__main__': 39 | total_rounds = 10 40 | main(total_rounds) 41 | -------------------------------------------------------------------------------- /use_usdc_bridge.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | from web3 import Account 4 | from bridge.usdc_bridge import swap_usdc_fantom_to_polygon, swap_usdc_polygon_to_fantom, get_balance_usdc_fantom, get_balance_usdc_polygon 5 | 6 | 7 | def main(tr): 8 | with open('keys.txt', 'r') as keys_file: 9 | accounts = [Account.from_key(line.replace("\n", "")) for line in keys_file.readlines()] 10 | for _ in range(0, tr): 11 | for account in accounts: 12 | 13 | try: 14 | fantom_balance = get_balance_usdc_fantom(account.address) 15 | polygon_balance = get_balance_usdc_polygon(account.address) 16 | 17 | if fantom_balance + polygon_balance < 10 * (10 ** 6): 18 | continue 19 | 20 | if fantom_balance > polygon_balance: 21 | print("Swapping USDC from Fantom to Polygon...") 22 | fantom_to_polygon_txn_hash = swap_usdc_fantom_to_polygon(account=account, amount=fantom_balance) 23 | print("Waiting for the swap to complete...") 24 | time.sleep(20) 25 | print(f"Transaction: https://ftmscan.com/tx/{fantom_to_polygon_txn_hash.hex()}") 26 | else: 27 | print("Swapping USDC from Polygon to Fantom...") 28 | polygon_to_fantom_txn_hash = swap_usdc_polygon_to_fantom(account=account, amount=polygon_balance) 29 | print("Waiting for the swap to complete...") 30 | time.sleep(20) 31 | print(f"Transaction: https://polygonscan.com/tx/{polygon_to_fantom_txn_hash.hex()}") 32 | 33 | print("Sleeping 60 seconds for the next account") 34 | time.sleep(60) 35 | except: 36 | pass 37 | 38 | print("Sleeping 1200 seconds for the next cycle") 39 | time.sleep(1200) 40 | 41 | 42 | if __name__ == '__main__': 43 | total_rounds = 10 44 | main(total_rounds) 45 | -------------------------------------------------------------------------------- /bridge/eth_bridge.py: -------------------------------------------------------------------------------- 1 | import json 2 | import time 3 | from web3 import Web3 4 | from web3.auto import w3 5 | 6 | # enter slippage as shown => 1 = 0.1%, 5 = 0.5%, 10 = 1% 7 | SLIPPAGE = 5 8 | 9 | # RPCs 10 | arbitrum_rpc_url = 'https://rpc.ankr.com/arbitrum' 11 | optimism_rpc_url = 'https://1rpc.io/op' 12 | 13 | arbitrum_w3 = Web3(Web3.HTTPProvider(arbitrum_rpc_url)) 14 | optimism_w3 = Web3(Web3.HTTPProvider(optimism_rpc_url)) 15 | 16 | # Stargate Router 17 | stargate_arbitrum_address = w3.to_checksum_address('0x53Bf833A5d6c4ddA888F69c22C88C9f356a41614') 18 | stargate_optimism_address = w3.to_checksum_address('0xB0D502E938ed5f4df2E681fE6E419ff29631d62b') 19 | 20 | # Stargate ETH Router 21 | stargate_arbitrum_eth_address = w3.to_checksum_address('0xbf22f0f184bCcbeA268dF387a49fF5238dD23E40') 22 | stargate_optimism_eth_address = w3.to_checksum_address('0xB49c4e680174E331CB0A7fF3Ab58afC9738d5F8b') 23 | 24 | # ABIs 25 | router_abi = json.load(open('./abis/router_abi.json')) 26 | router_eth_abi = json.load(open('./abis/router_eth_abi.json')) 27 | 28 | # Init contracts 29 | stargate_arbitrum_router_contract = arbitrum_w3.eth.contract(address=stargate_arbitrum_address, abi=router_abi) 30 | stargate_optimism_router_contract = optimism_w3.eth.contract(address=stargate_optimism_address, abi=router_abi) 31 | 32 | stargate_arbitrum_router_eth_contract = arbitrum_w3.eth.contract(address=stargate_arbitrum_eth_address, 33 | abi=router_eth_abi) 34 | stargate_optimism_router_eth_contract = optimism_w3.eth.contract(address=stargate_optimism_eth_address, 35 | abi=router_eth_abi) 36 | 37 | 38 | def get_balance_eth_arbitrum(address): 39 | return arbitrum_w3.eth.get_balance(address) 40 | 41 | 42 | def get_balance_eth_optimism(address): 43 | return optimism_w3.eth.get_balance(address) 44 | 45 | 46 | def swap_eth_arbitrum_optimism(account, amount): 47 | address = w3.to_checksum_address(account.address) 48 | nonce = arbitrum_w3.eth.get_transaction_count(address) 49 | gas_price = arbitrum_w3.eth.gas_price 50 | fees = stargate_arbitrum_router_contract.functions.quoteLayerZeroFee(111, 51 | 1, 52 | address, 53 | "0x", 54 | [0, 0, address] 55 | ).call() 56 | fee = fees[0] 57 | 58 | amountOutMin = amount - (amount * SLIPPAGE) // 1000 59 | 60 | swap_txn = stargate_arbitrum_router_eth_contract.functions.swapETH( 61 | 111, address, address, amount, amountOutMin 62 | ).build_transaction({ 63 | 'from': address, 64 | 'value': amount + fee, 65 | 'gas': 2000000, 66 | 'gasPrice': gas_price, 67 | 'nonce': nonce, 68 | }) 69 | 70 | signed_swap_txn = arbitrum_w3.eth.account.sign_transaction(swap_txn, account.key) 71 | swap_txn_hash = arbitrum_w3.eth.send_raw_transaction(signed_swap_txn.rawTransaction) 72 | return swap_txn_hash 73 | 74 | 75 | def swap_eth_optimism_arbitrum(account, amount): 76 | address = w3.to_checksum_address(account.address) 77 | nonce = optimism_w3.eth.get_transaction_count(address) 78 | gas_price = optimism_w3.eth.gas_price 79 | fees = stargate_optimism_router_contract.functions.quoteLayerZeroFee(110, 80 | 1, 81 | address, 82 | "0x", 83 | [0, 0, address] 84 | ).call() 85 | fee = fees[0] 86 | 87 | amountOutMin = amount - (amount * SLIPPAGE) // 1000 88 | 89 | swap_txn = stargate_optimism_router_eth_contract.functions.swapETH( 90 | 110, address, address, amount, amountOutMin 91 | ).build_transaction({ 92 | 'from': address, 93 | 'value': amount + fee, 94 | 'gas': 2000000, 95 | 'gasPrice': gas_price, 96 | 'nonce': nonce, 97 | }) 98 | 99 | signed_swap_txn = optimism_w3.eth.account.sign_transaction(swap_txn, account.key) 100 | swap_txn_hash = optimism_w3.eth.send_raw_transaction(signed_swap_txn.rawTransaction) 101 | return swap_txn_hash 102 | -------------------------------------------------------------------------------- /bridge/usdc_bridge.py: -------------------------------------------------------------------------------- 1 | import json 2 | import time 3 | from web3 import Web3 4 | from web3.auto import w3 5 | 6 | # enter slippage as shown => 1 = 0.1%, 5 = 0.5%, 10 = 1% 7 | SLIPPAGE = 5 8 | 9 | # RPCs 10 | polygon_rpc_url = 'https://polygon-rpc.com/' 11 | fantom_rpc_url = 'https://rpc.ftm.tools/' 12 | 13 | polygon_w3 = Web3(Web3.HTTPProvider(polygon_rpc_url)) 14 | fantom_w3 = Web3(Web3.HTTPProvider(fantom_rpc_url)) 15 | 16 | # Stargate Router 17 | stargate_polygon_address = w3.to_checksum_address('0x45A01E4e04F14f7A4a6702c74187c5F6222033cd') 18 | stargate_fantom_address = w3.to_checksum_address('0xAf5191B0De278C7286d6C7CC6ab6BB8A73bA2Cd6') 19 | 20 | # ABIs 21 | stargate_abi = json.load(open('./abis/router_abi.json')) 22 | usdc_abi = json.load(open('./abis/usdc_abi.json')) 23 | 24 | # USDC contracts 25 | usdc_polygon_address = w3.to_checksum_address('0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174') 26 | usdc_fantom_address = w3.to_checksum_address('0x04068DA6C83AFCFA0e13ba15A6696662335D5B75') 27 | 28 | # Init contracts 29 | stargate_polygon_contract = polygon_w3.eth.contract(address=stargate_polygon_address, abi=stargate_abi) 30 | stargate_fantom_contract = fantom_w3.eth.contract(address=stargate_fantom_address, abi=stargate_abi) 31 | usdc_polygon_contract = polygon_w3.eth.contract(address=usdc_polygon_address, abi=usdc_abi) 32 | usdc_fantom_contract = fantom_w3.eth.contract(address=usdc_fantom_address, abi=usdc_abi) 33 | 34 | 35 | # Polygon -> Fantom USDC Bridge 36 | 37 | 38 | def get_balance_usdc_polygon(address): 39 | return usdc_polygon_contract.functions.balanceOf(address).call() 40 | 41 | 42 | def get_balance_usdc_fantom(address): 43 | return usdc_fantom_contract.functions.balanceOf(address).call() 44 | 45 | 46 | def swap_usdc_polygon_to_fantom(account, amount): 47 | address = w3.to_checksum_address(account.address) 48 | nonce = polygon_w3.eth.get_transaction_count(address) 49 | gas_price = polygon_w3.eth.gas_price 50 | fees = stargate_fantom_contract.functions.quoteLayerZeroFee(112, 51 | 1, 52 | "0x0000000000000000000000000000000000001010", 53 | "0x", 54 | [0, 0, "0x0000000000000000000000000000000000000001"] 55 | ).call() 56 | fee = fees[0] 57 | 58 | # Check allowance 59 | allowance = usdc_polygon_contract.functions.allowance(address, stargate_polygon_address).call() 60 | if allowance < amount: 61 | approve_txn = usdc_polygon_contract.functions.approve(stargate_polygon_address, amount).build_transaction({ 62 | 'from': address, 63 | 'gas': 150000, 64 | 'gasPrice': gas_price, 65 | 'nonce': nonce, 66 | }) 67 | signed_approve_txn = polygon_w3.eth.account.sign_transaction(approve_txn, account.key) 68 | approve_txn_hash = polygon_w3.eth.send_raw_transaction(signed_approve_txn.rawTransaction) 69 | 70 | print(f"POLYGON | USDT APPROVED https://polygonscan.com/tx/{approve_txn_hash.hex()}") 71 | nonce += 1 72 | 73 | time.sleep(10) 74 | 75 | # Stargate Swap 76 | chainId = 112 77 | source_pool_id = 1 78 | dest_pool_id = 1 79 | refund_address = account.address 80 | amountIn = amount 81 | amountOutMin = amount - (amount * SLIPPAGE) // 1000 82 | lzTxObj = [0, 0, '0x0000000000000000000000000000000000000001'] 83 | to = account.address 84 | data = '0x' 85 | 86 | swap_txn = stargate_polygon_contract.functions.swap( 87 | chainId, source_pool_id, dest_pool_id, refund_address, amountIn, amountOutMin, lzTxObj, to, data 88 | ).build_transaction({ 89 | 'from': address, 90 | 'value': fee, 91 | 'gas': 2000000, 92 | 'gasPrice': polygon_w3.eth.gas_price, 93 | 'nonce': polygon_w3.eth.get_transaction_count(address), 94 | }) 95 | 96 | signed_swap_txn = polygon_w3.eth.account.sign_transaction(swap_txn, account.key) 97 | swap_txn_hash = polygon_w3.eth.send_raw_transaction(signed_swap_txn.rawTransaction) 98 | return swap_txn_hash 99 | 100 | 101 | # Fantom -> Polygon USDC 102 | def swap_usdc_fantom_to_polygon(account, amount): 103 | address = w3.to_checksum_address(account.address) 104 | nonce = fantom_w3.eth.get_transaction_count(address) 105 | gas_price = fantom_w3.eth.gas_price 106 | fees = stargate_fantom_contract.functions.quoteLayerZeroFee(109, 107 | 1, 108 | "0x0000000000000000000000000000000000000001", 109 | "0x", 110 | [0, 0, "0x0000000000000000000000000000000000000001"] 111 | ).call() 112 | fee = fees[0] 113 | 114 | # Check Allowance 115 | allowance = usdc_fantom_contract.functions.allowance(address, stargate_fantom_address).call() 116 | if allowance < amount: 117 | approve_txn = usdc_fantom_contract.functions.approve(stargate_fantom_address, amount).build_transaction({ 118 | 'from': address, 119 | 'gas': 150000, 120 | 'gasPrice': gas_price, 121 | 'nonce': nonce, 122 | }) 123 | signed_approve_txn = fantom_w3.eth.account.sign_transaction(approve_txn, account.key) 124 | approve_txn_hash = fantom_w3.eth.send_raw_transaction(signed_approve_txn.rawTransaction) 125 | 126 | print(f"FANTOM | USDC APPROVED | https://ftmscan.com/tx/{approve_txn_hash.hex()} ") 127 | nonce += 1 128 | 129 | time.sleep(10) 130 | 131 | # Stargate Swap 132 | chainId = 109 133 | source_pool_id = 1 134 | dest_pool_id = 1 135 | refund_address = account.address 136 | amountIn = amount 137 | amountOutMin = amount - (amount * SLIPPAGE) // 1000 138 | lzTxObj = [0, 0, '0x0000000000000000000000000000000000000001'] 139 | to = account.address 140 | data = '0x' 141 | 142 | swap_txn = stargate_polygon_contract.functions.swap( 143 | chainId, source_pool_id, dest_pool_id, refund_address, amountIn, amountOutMin, lzTxObj, to, data 144 | ).build_transaction({ 145 | 'from': address, 146 | 'value': fee, 147 | 'gas': 2000000, 148 | 'gasPrice': fantom_w3.eth.gas_price, 149 | 'nonce': fantom_w3.eth.get_transaction_count(address), 150 | }) 151 | 152 | signed_swap_txn = fantom_w3.eth.account.sign_transaction(swap_txn, account.key) 153 | swap_txn_hash = fantom_w3.eth.send_raw_transaction(signed_swap_txn.rawTransaction) 154 | return swap_txn_hash 155 | -------------------------------------------------------------------------------- /abis/usdc_abi.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "string", 6 | "name": "_name", 7 | "type": "string" 8 | }, 9 | { 10 | "internalType": "string", 11 | "name": "_symbol", 12 | "type": "string" 13 | }, 14 | { 15 | "internalType": "uint8", 16 | "name": "_decimals", 17 | "type": "uint8" 18 | }, 19 | { 20 | "internalType": "address", 21 | "name": "_owner", 22 | "type": "address" 23 | } 24 | ], 25 | "stateMutability": "nonpayable", 26 | "type": "constructor" 27 | }, 28 | { 29 | "anonymous": false, 30 | "inputs": [ 31 | { 32 | "indexed": true, 33 | "internalType": "address", 34 | "name": "owner", 35 | "type": "address" 36 | }, 37 | { 38 | "indexed": true, 39 | "internalType": "address", 40 | "name": "spender", 41 | "type": "address" 42 | }, 43 | { 44 | "indexed": false, 45 | "internalType": "uint256", 46 | "name": "value", 47 | "type": "uint256" 48 | } 49 | ], 50 | "name": "Approval", 51 | "type": "event" 52 | }, 53 | { 54 | "anonymous": false, 55 | "inputs": [ 56 | { 57 | "indexed": true, 58 | "internalType": "address", 59 | "name": "oldOwner", 60 | "type": "address" 61 | }, 62 | { 63 | "indexed": true, 64 | "internalType": "address", 65 | "name": "newOwner", 66 | "type": "address" 67 | }, 68 | { 69 | "indexed": true, 70 | "internalType": "uint256", 71 | "name": "effectiveTime", 72 | "type": "uint256" 73 | } 74 | ], 75 | "name": "LogChangeDCRMOwner", 76 | "type": "event" 77 | }, 78 | { 79 | "anonymous": false, 80 | "inputs": [ 81 | { 82 | "indexed": true, 83 | "internalType": "bytes32", 84 | "name": "txhash", 85 | "type": "bytes32" 86 | }, 87 | { 88 | "indexed": true, 89 | "internalType": "address", 90 | "name": "account", 91 | "type": "address" 92 | }, 93 | { 94 | "indexed": false, 95 | "internalType": "uint256", 96 | "name": "amount", 97 | "type": "uint256" 98 | } 99 | ], 100 | "name": "LogSwapin", 101 | "type": "event" 102 | }, 103 | { 104 | "anonymous": false, 105 | "inputs": [ 106 | { 107 | "indexed": true, 108 | "internalType": "address", 109 | "name": "account", 110 | "type": "address" 111 | }, 112 | { 113 | "indexed": true, 114 | "internalType": "address", 115 | "name": "bindaddr", 116 | "type": "address" 117 | }, 118 | { 119 | "indexed": false, 120 | "internalType": "uint256", 121 | "name": "amount", 122 | "type": "uint256" 123 | } 124 | ], 125 | "name": "LogSwapout", 126 | "type": "event" 127 | }, 128 | { 129 | "anonymous": false, 130 | "inputs": [ 131 | { 132 | "indexed": true, 133 | "internalType": "address", 134 | "name": "from", 135 | "type": "address" 136 | }, 137 | { 138 | "indexed": true, 139 | "internalType": "address", 140 | "name": "to", 141 | "type": "address" 142 | }, 143 | { 144 | "indexed": false, 145 | "internalType": "uint256", 146 | "name": "value", 147 | "type": "uint256" 148 | } 149 | ], 150 | "name": "Transfer", 151 | "type": "event" 152 | }, 153 | { 154 | "inputs": [], 155 | "name": "DOMAIN_SEPARATOR", 156 | "outputs": [ 157 | { 158 | "internalType": "bytes32", 159 | "name": "", 160 | "type": "bytes32" 161 | } 162 | ], 163 | "stateMutability": "view", 164 | "type": "function" 165 | }, 166 | { 167 | "inputs": [], 168 | "name": "PERMIT_TYPEHASH", 169 | "outputs": [ 170 | { 171 | "internalType": "bytes32", 172 | "name": "", 173 | "type": "bytes32" 174 | } 175 | ], 176 | "stateMutability": "view", 177 | "type": "function" 178 | }, 179 | { 180 | "inputs": [ 181 | { 182 | "internalType": "bytes32", 183 | "name": "txhash", 184 | "type": "bytes32" 185 | }, 186 | { 187 | "internalType": "address", 188 | "name": "account", 189 | "type": "address" 190 | }, 191 | { 192 | "internalType": "uint256", 193 | "name": "amount", 194 | "type": "uint256" 195 | } 196 | ], 197 | "name": "Swapin", 198 | "outputs": [ 199 | { 200 | "internalType": "bool", 201 | "name": "", 202 | "type": "bool" 203 | } 204 | ], 205 | "stateMutability": "nonpayable", 206 | "type": "function" 207 | }, 208 | { 209 | "inputs": [ 210 | { 211 | "internalType": "uint256", 212 | "name": "amount", 213 | "type": "uint256" 214 | }, 215 | { 216 | "internalType": "address", 217 | "name": "bindaddr", 218 | "type": "address" 219 | } 220 | ], 221 | "name": "Swapout", 222 | "outputs": [ 223 | { 224 | "internalType": "bool", 225 | "name": "", 226 | "type": "bool" 227 | } 228 | ], 229 | "stateMutability": "nonpayable", 230 | "type": "function" 231 | }, 232 | { 233 | "inputs": [], 234 | "name": "TRANSFER_TYPEHASH", 235 | "outputs": [ 236 | { 237 | "internalType": "bytes32", 238 | "name": "", 239 | "type": "bytes32" 240 | } 241 | ], 242 | "stateMutability": "view", 243 | "type": "function" 244 | }, 245 | { 246 | "inputs": [ 247 | { 248 | "internalType": "address", 249 | "name": "", 250 | "type": "address" 251 | }, 252 | { 253 | "internalType": "address", 254 | "name": "", 255 | "type": "address" 256 | } 257 | ], 258 | "name": "allowance", 259 | "outputs": [ 260 | { 261 | "internalType": "uint256", 262 | "name": "", 263 | "type": "uint256" 264 | } 265 | ], 266 | "stateMutability": "view", 267 | "type": "function" 268 | }, 269 | { 270 | "inputs": [ 271 | { 272 | "internalType": "address", 273 | "name": "spender", 274 | "type": "address" 275 | }, 276 | { 277 | "internalType": "uint256", 278 | "name": "value", 279 | "type": "uint256" 280 | } 281 | ], 282 | "name": "approve", 283 | "outputs": [ 284 | { 285 | "internalType": "bool", 286 | "name": "", 287 | "type": "bool" 288 | } 289 | ], 290 | "stateMutability": "nonpayable", 291 | "type": "function" 292 | }, 293 | { 294 | "inputs": [ 295 | { 296 | "internalType": "address", 297 | "name": "spender", 298 | "type": "address" 299 | }, 300 | { 301 | "internalType": "uint256", 302 | "name": "value", 303 | "type": "uint256" 304 | }, 305 | { 306 | "internalType": "bytes", 307 | "name": "data", 308 | "type": "bytes" 309 | } 310 | ], 311 | "name": "approveAndCall", 312 | "outputs": [ 313 | { 314 | "internalType": "bool", 315 | "name": "", 316 | "type": "bool" 317 | } 318 | ], 319 | "stateMutability": "nonpayable", 320 | "type": "function" 321 | }, 322 | { 323 | "inputs": [ 324 | { 325 | "internalType": "address", 326 | "name": "", 327 | "type": "address" 328 | } 329 | ], 330 | "name": "balanceOf", 331 | "outputs": [ 332 | { 333 | "internalType": "uint256", 334 | "name": "", 335 | "type": "uint256" 336 | } 337 | ], 338 | "stateMutability": "view", 339 | "type": "function" 340 | }, 341 | { 342 | "inputs": [ 343 | { 344 | "internalType": "address", 345 | "name": "newOwner", 346 | "type": "address" 347 | } 348 | ], 349 | "name": "changeDCRMOwner", 350 | "outputs": [ 351 | { 352 | "internalType": "bool", 353 | "name": "", 354 | "type": "bool" 355 | } 356 | ], 357 | "stateMutability": "nonpayable", 358 | "type": "function" 359 | }, 360 | { 361 | "inputs": [], 362 | "name": "decimals", 363 | "outputs": [ 364 | { 365 | "internalType": "uint8", 366 | "name": "", 367 | "type": "uint8" 368 | } 369 | ], 370 | "stateMutability": "view", 371 | "type": "function" 372 | }, 373 | { 374 | "inputs": [], 375 | "name": "name", 376 | "outputs": [ 377 | { 378 | "internalType": "string", 379 | "name": "", 380 | "type": "string" 381 | } 382 | ], 383 | "stateMutability": "view", 384 | "type": "function" 385 | }, 386 | { 387 | "inputs": [ 388 | { 389 | "internalType": "address", 390 | "name": "", 391 | "type": "address" 392 | } 393 | ], 394 | "name": "nonces", 395 | "outputs": [ 396 | { 397 | "internalType": "uint256", 398 | "name": "", 399 | "type": "uint256" 400 | } 401 | ], 402 | "stateMutability": "view", 403 | "type": "function" 404 | }, 405 | { 406 | "inputs": [], 407 | "name": "owner", 408 | "outputs": [ 409 | { 410 | "internalType": "address", 411 | "name": "", 412 | "type": "address" 413 | } 414 | ], 415 | "stateMutability": "view", 416 | "type": "function" 417 | }, 418 | { 419 | "inputs": [ 420 | { 421 | "internalType": "address", 422 | "name": "target", 423 | "type": "address" 424 | }, 425 | { 426 | "internalType": "address", 427 | "name": "spender", 428 | "type": "address" 429 | }, 430 | { 431 | "internalType": "uint256", 432 | "name": "value", 433 | "type": "uint256" 434 | }, 435 | { 436 | "internalType": "uint256", 437 | "name": "deadline", 438 | "type": "uint256" 439 | }, 440 | { 441 | "internalType": "uint8", 442 | "name": "v", 443 | "type": "uint8" 444 | }, 445 | { 446 | "internalType": "bytes32", 447 | "name": "r", 448 | "type": "bytes32" 449 | }, 450 | { 451 | "internalType": "bytes32", 452 | "name": "s", 453 | "type": "bytes32" 454 | } 455 | ], 456 | "name": "permit", 457 | "outputs": [], 458 | "stateMutability": "nonpayable", 459 | "type": "function" 460 | }, 461 | { 462 | "inputs": [], 463 | "name": "symbol", 464 | "outputs": [ 465 | { 466 | "internalType": "string", 467 | "name": "", 468 | "type": "string" 469 | } 470 | ], 471 | "stateMutability": "view", 472 | "type": "function" 473 | }, 474 | { 475 | "inputs": [], 476 | "name": "totalSupply", 477 | "outputs": [ 478 | { 479 | "internalType": "uint256", 480 | "name": "", 481 | "type": "uint256" 482 | } 483 | ], 484 | "stateMutability": "view", 485 | "type": "function" 486 | }, 487 | { 488 | "inputs": [ 489 | { 490 | "internalType": "address", 491 | "name": "to", 492 | "type": "address" 493 | }, 494 | { 495 | "internalType": "uint256", 496 | "name": "value", 497 | "type": "uint256" 498 | } 499 | ], 500 | "name": "transfer", 501 | "outputs": [ 502 | { 503 | "internalType": "bool", 504 | "name": "", 505 | "type": "bool" 506 | } 507 | ], 508 | "stateMutability": "nonpayable", 509 | "type": "function" 510 | }, 511 | { 512 | "inputs": [ 513 | { 514 | "internalType": "address", 515 | "name": "to", 516 | "type": "address" 517 | }, 518 | { 519 | "internalType": "uint256", 520 | "name": "value", 521 | "type": "uint256" 522 | }, 523 | { 524 | "internalType": "bytes", 525 | "name": "data", 526 | "type": "bytes" 527 | } 528 | ], 529 | "name": "transferAndCall", 530 | "outputs": [ 531 | { 532 | "internalType": "bool", 533 | "name": "", 534 | "type": "bool" 535 | } 536 | ], 537 | "stateMutability": "nonpayable", 538 | "type": "function" 539 | }, 540 | { 541 | "inputs": [ 542 | { 543 | "internalType": "address", 544 | "name": "from", 545 | "type": "address" 546 | }, 547 | { 548 | "internalType": "address", 549 | "name": "to", 550 | "type": "address" 551 | }, 552 | { 553 | "internalType": "uint256", 554 | "name": "value", 555 | "type": "uint256" 556 | } 557 | ], 558 | "name": "transferFrom", 559 | "outputs": [ 560 | { 561 | "internalType": "bool", 562 | "name": "", 563 | "type": "bool" 564 | } 565 | ], 566 | "stateMutability": "nonpayable", 567 | "type": "function" 568 | }, 569 | { 570 | "inputs": [ 571 | { 572 | "internalType": "address", 573 | "name": "target", 574 | "type": "address" 575 | }, 576 | { 577 | "internalType": "address", 578 | "name": "to", 579 | "type": "address" 580 | }, 581 | { 582 | "internalType": "uint256", 583 | "name": "value", 584 | "type": "uint256" 585 | }, 586 | { 587 | "internalType": "uint256", 588 | "name": "deadline", 589 | "type": "uint256" 590 | }, 591 | { 592 | "internalType": "uint8", 593 | "name": "v", 594 | "type": "uint8" 595 | }, 596 | { 597 | "internalType": "bytes32", 598 | "name": "r", 599 | "type": "bytes32" 600 | }, 601 | { 602 | "internalType": "bytes32", 603 | "name": "s", 604 | "type": "bytes32" 605 | } 606 | ], 607 | "name": "transferWithPermit", 608 | "outputs": [ 609 | { 610 | "internalType": "bool", 611 | "name": "", 612 | "type": "bool" 613 | } 614 | ], 615 | "stateMutability": "nonpayable", 616 | "type": "function" 617 | } 618 | ] -------------------------------------------------------------------------------- /abis/router_abi.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "stateMutability": "nonpayable", 5 | "type": "constructor" 6 | }, 7 | { 8 | "anonymous": false, 9 | "inputs": [ 10 | { 11 | "indexed": false, 12 | "internalType": "uint16", 13 | "name": "chainId", 14 | "type": "uint16" 15 | }, 16 | { 17 | "indexed": false, 18 | "internalType": "bytes", 19 | "name": "srcAddress", 20 | "type": "bytes" 21 | }, 22 | { 23 | "indexed": false, 24 | "internalType": "uint256", 25 | "name": "nonce", 26 | "type": "uint256" 27 | }, 28 | { 29 | "indexed": false, 30 | "internalType": "address", 31 | "name": "token", 32 | "type": "address" 33 | }, 34 | { 35 | "indexed": false, 36 | "internalType": "uint256", 37 | "name": "amountLD", 38 | "type": "uint256" 39 | }, 40 | { 41 | "indexed": false, 42 | "internalType": "address", 43 | "name": "to", 44 | "type": "address" 45 | }, 46 | { 47 | "indexed": false, 48 | "internalType": "bytes", 49 | "name": "payload", 50 | "type": "bytes" 51 | }, 52 | { 53 | "indexed": false, 54 | "internalType": "bytes", 55 | "name": "reason", 56 | "type": "bytes" 57 | } 58 | ], 59 | "name": "CachedSwapSaved", 60 | "type": "event" 61 | }, 62 | { 63 | "anonymous": false, 64 | "inputs": [ 65 | { 66 | "indexed": true, 67 | "internalType": "address", 68 | "name": "previousOwner", 69 | "type": "address" 70 | }, 71 | { 72 | "indexed": true, 73 | "internalType": "address", 74 | "name": "newOwner", 75 | "type": "address" 76 | } 77 | ], 78 | "name": "OwnershipTransferred", 79 | "type": "event" 80 | }, 81 | { 82 | "anonymous": false, 83 | "inputs": [ 84 | { 85 | "indexed": false, 86 | "internalType": "uint16", 87 | "name": "srcChainId", 88 | "type": "uint16" 89 | }, 90 | { 91 | "indexed": true, 92 | "internalType": "bytes", 93 | "name": "srcAddress", 94 | "type": "bytes" 95 | }, 96 | { 97 | "indexed": true, 98 | "internalType": "uint256", 99 | "name": "nonce", 100 | "type": "uint256" 101 | }, 102 | { 103 | "indexed": false, 104 | "internalType": "uint256", 105 | "name": "srcPoolId", 106 | "type": "uint256" 107 | }, 108 | { 109 | "indexed": false, 110 | "internalType": "uint256", 111 | "name": "dstPoolId", 112 | "type": "uint256" 113 | }, 114 | { 115 | "indexed": false, 116 | "internalType": "address", 117 | "name": "to", 118 | "type": "address" 119 | }, 120 | { 121 | "indexed": false, 122 | "internalType": "uint256", 123 | "name": "amountSD", 124 | "type": "uint256" 125 | }, 126 | { 127 | "indexed": false, 128 | "internalType": "uint256", 129 | "name": "mintAmountSD", 130 | "type": "uint256" 131 | } 132 | ], 133 | "name": "RedeemLocalCallback", 134 | "type": "event" 135 | }, 136 | { 137 | "anonymous": false, 138 | "inputs": [ 139 | { 140 | "indexed": false, 141 | "internalType": "uint8", 142 | "name": "bridgeFunctionType", 143 | "type": "uint8" 144 | }, 145 | { 146 | "indexed": false, 147 | "internalType": "uint16", 148 | "name": "chainId", 149 | "type": "uint16" 150 | }, 151 | { 152 | "indexed": false, 153 | "internalType": "bytes", 154 | "name": "srcAddress", 155 | "type": "bytes" 156 | }, 157 | { 158 | "indexed": false, 159 | "internalType": "uint256", 160 | "name": "nonce", 161 | "type": "uint256" 162 | } 163 | ], 164 | "name": "Revert", 165 | "type": "event" 166 | }, 167 | { 168 | "anonymous": false, 169 | "inputs": [ 170 | { 171 | "indexed": false, 172 | "internalType": "uint16", 173 | "name": "srcChainId", 174 | "type": "uint16" 175 | }, 176 | { 177 | "indexed": false, 178 | "internalType": "uint256", 179 | "name": "_srcPoolId", 180 | "type": "uint256" 181 | }, 182 | { 183 | "indexed": false, 184 | "internalType": "uint256", 185 | "name": "_dstPoolId", 186 | "type": "uint256" 187 | }, 188 | { 189 | "indexed": false, 190 | "internalType": "bytes", 191 | "name": "to", 192 | "type": "bytes" 193 | }, 194 | { 195 | "indexed": false, 196 | "internalType": "uint256", 197 | "name": "redeemAmountSD", 198 | "type": "uint256" 199 | }, 200 | { 201 | "indexed": false, 202 | "internalType": "uint256", 203 | "name": "mintAmountSD", 204 | "type": "uint256" 205 | }, 206 | { 207 | "indexed": true, 208 | "internalType": "uint256", 209 | "name": "nonce", 210 | "type": "uint256" 211 | }, 212 | { 213 | "indexed": true, 214 | "internalType": "bytes", 215 | "name": "srcAddress", 216 | "type": "bytes" 217 | } 218 | ], 219 | "name": "RevertRedeemLocal", 220 | "type": "event" 221 | }, 222 | { 223 | "inputs": [ 224 | { 225 | "internalType": "uint256", 226 | "name": "_poolId", 227 | "type": "uint256" 228 | }, 229 | { 230 | "internalType": "uint16", 231 | "name": "_dstChainId", 232 | "type": "uint16" 233 | }, 234 | { 235 | "internalType": "uint256", 236 | "name": "_dstPoolId", 237 | "type": "uint256" 238 | } 239 | ], 240 | "name": "activateChainPath", 241 | "outputs": [], 242 | "stateMutability": "nonpayable", 243 | "type": "function" 244 | }, 245 | { 246 | "inputs": [ 247 | { 248 | "internalType": "uint256", 249 | "name": "_poolId", 250 | "type": "uint256" 251 | }, 252 | { 253 | "internalType": "uint256", 254 | "name": "_amountLD", 255 | "type": "uint256" 256 | }, 257 | { 258 | "internalType": "address", 259 | "name": "_to", 260 | "type": "address" 261 | } 262 | ], 263 | "name": "addLiquidity", 264 | "outputs": [], 265 | "stateMutability": "nonpayable", 266 | "type": "function" 267 | }, 268 | { 269 | "inputs": [], 270 | "name": "bridge", 271 | "outputs": [ 272 | { 273 | "internalType": "contract Bridge", 274 | "name": "", 275 | "type": "address" 276 | } 277 | ], 278 | "stateMutability": "view", 279 | "type": "function" 280 | }, 281 | { 282 | "inputs": [ 283 | { 284 | "internalType": "uint16", 285 | "name": "", 286 | "type": "uint16" 287 | }, 288 | { 289 | "internalType": "bytes", 290 | "name": "", 291 | "type": "bytes" 292 | }, 293 | { 294 | "internalType": "uint256", 295 | "name": "", 296 | "type": "uint256" 297 | } 298 | ], 299 | "name": "cachedSwapLookup", 300 | "outputs": [ 301 | { 302 | "internalType": "address", 303 | "name": "token", 304 | "type": "address" 305 | }, 306 | { 307 | "internalType": "uint256", 308 | "name": "amountLD", 309 | "type": "uint256" 310 | }, 311 | { 312 | "internalType": "address", 313 | "name": "to", 314 | "type": "address" 315 | }, 316 | { 317 | "internalType": "bytes", 318 | "name": "payload", 319 | "type": "bytes" 320 | } 321 | ], 322 | "stateMutability": "view", 323 | "type": "function" 324 | }, 325 | { 326 | "inputs": [ 327 | { 328 | "internalType": "uint256", 329 | "name": "_poolId", 330 | "type": "uint256" 331 | }, 332 | { 333 | "internalType": "bool", 334 | "name": "_fullMode", 335 | "type": "bool" 336 | } 337 | ], 338 | "name": "callDelta", 339 | "outputs": [], 340 | "stateMutability": "nonpayable", 341 | "type": "function" 342 | }, 343 | { 344 | "inputs": [ 345 | { 346 | "internalType": "uint16", 347 | "name": "_srcChainId", 348 | "type": "uint16" 349 | }, 350 | { 351 | "internalType": "bytes", 352 | "name": "_srcAddress", 353 | "type": "bytes" 354 | }, 355 | { 356 | "internalType": "uint256", 357 | "name": "_nonce", 358 | "type": "uint256" 359 | } 360 | ], 361 | "name": "clearCachedSwap", 362 | "outputs": [], 363 | "stateMutability": "nonpayable", 364 | "type": "function" 365 | }, 366 | { 367 | "inputs": [ 368 | { 369 | "internalType": "uint256", 370 | "name": "_poolId", 371 | "type": "uint256" 372 | }, 373 | { 374 | "internalType": "uint16", 375 | "name": "_dstChainId", 376 | "type": "uint16" 377 | }, 378 | { 379 | "internalType": "uint256", 380 | "name": "_dstPoolId", 381 | "type": "uint256" 382 | }, 383 | { 384 | "internalType": "uint256", 385 | "name": "_weight", 386 | "type": "uint256" 387 | } 388 | ], 389 | "name": "createChainPath", 390 | "outputs": [], 391 | "stateMutability": "nonpayable", 392 | "type": "function" 393 | }, 394 | { 395 | "inputs": [ 396 | { 397 | "internalType": "uint256", 398 | "name": "_poolId", 399 | "type": "uint256" 400 | }, 401 | { 402 | "internalType": "address", 403 | "name": "_token", 404 | "type": "address" 405 | }, 406 | { 407 | "internalType": "uint8", 408 | "name": "_sharedDecimals", 409 | "type": "uint8" 410 | }, 411 | { 412 | "internalType": "uint8", 413 | "name": "_localDecimals", 414 | "type": "uint8" 415 | }, 416 | { 417 | "internalType": "string", 418 | "name": "_name", 419 | "type": "string" 420 | }, 421 | { 422 | "internalType": "string", 423 | "name": "_symbol", 424 | "type": "string" 425 | } 426 | ], 427 | "name": "createPool", 428 | "outputs": [ 429 | { 430 | "internalType": "address", 431 | "name": "", 432 | "type": "address" 433 | } 434 | ], 435 | "stateMutability": "nonpayable", 436 | "type": "function" 437 | }, 438 | { 439 | "inputs": [ 440 | { 441 | "internalType": "uint16", 442 | "name": "_dstChainId", 443 | "type": "uint16" 444 | }, 445 | { 446 | "internalType": "uint256", 447 | "name": "_dstPoolId", 448 | "type": "uint256" 449 | }, 450 | { 451 | "internalType": "uint256", 452 | "name": "_srcPoolId", 453 | "type": "uint256" 454 | }, 455 | { 456 | "components": [ 457 | { 458 | "internalType": "uint256", 459 | "name": "credits", 460 | "type": "uint256" 461 | }, 462 | { 463 | "internalType": "uint256", 464 | "name": "idealBalance", 465 | "type": "uint256" 466 | } 467 | ], 468 | "internalType": "struct Pool.CreditObj", 469 | "name": "_c", 470 | "type": "tuple" 471 | } 472 | ], 473 | "name": "creditChainPath", 474 | "outputs": [], 475 | "stateMutability": "nonpayable", 476 | "type": "function" 477 | }, 478 | { 479 | "inputs": [], 480 | "name": "factory", 481 | "outputs": [ 482 | { 483 | "internalType": "contract Factory", 484 | "name": "", 485 | "type": "address" 486 | } 487 | ], 488 | "stateMutability": "view", 489 | "type": "function" 490 | }, 491 | { 492 | "inputs": [ 493 | { 494 | "internalType": "uint16", 495 | "name": "_srcPoolId", 496 | "type": "uint16" 497 | }, 498 | { 499 | "internalType": "uint256", 500 | "name": "_amountLP", 501 | "type": "uint256" 502 | }, 503 | { 504 | "internalType": "address", 505 | "name": "_to", 506 | "type": "address" 507 | } 508 | ], 509 | "name": "instantRedeemLocal", 510 | "outputs": [ 511 | { 512 | "internalType": "uint256", 513 | "name": "amountSD", 514 | "type": "uint256" 515 | } 516 | ], 517 | "stateMutability": "nonpayable", 518 | "type": "function" 519 | }, 520 | { 521 | "inputs": [], 522 | "name": "mintFeeOwner", 523 | "outputs": [ 524 | { 525 | "internalType": "address", 526 | "name": "", 527 | "type": "address" 528 | } 529 | ], 530 | "stateMutability": "view", 531 | "type": "function" 532 | }, 533 | { 534 | "inputs": [], 535 | "name": "owner", 536 | "outputs": [ 537 | { 538 | "internalType": "address", 539 | "name": "", 540 | "type": "address" 541 | } 542 | ], 543 | "stateMutability": "view", 544 | "type": "function" 545 | }, 546 | { 547 | "inputs": [], 548 | "name": "protocolFeeOwner", 549 | "outputs": [ 550 | { 551 | "internalType": "address", 552 | "name": "", 553 | "type": "address" 554 | } 555 | ], 556 | "stateMutability": "view", 557 | "type": "function" 558 | }, 559 | { 560 | "inputs": [ 561 | { 562 | "internalType": "uint16", 563 | "name": "_dstChainId", 564 | "type": "uint16" 565 | }, 566 | { 567 | "internalType": "uint8", 568 | "name": "_functionType", 569 | "type": "uint8" 570 | }, 571 | { 572 | "internalType": "bytes", 573 | "name": "_toAddress", 574 | "type": "bytes" 575 | }, 576 | { 577 | "internalType": "bytes", 578 | "name": "_transferAndCallPayload", 579 | "type": "bytes" 580 | }, 581 | { 582 | "components": [ 583 | { 584 | "internalType": "uint256", 585 | "name": "dstGasForCall", 586 | "type": "uint256" 587 | }, 588 | { 589 | "internalType": "uint256", 590 | "name": "dstNativeAmount", 591 | "type": "uint256" 592 | }, 593 | { 594 | "internalType": "bytes", 595 | "name": "dstNativeAddr", 596 | "type": "bytes" 597 | } 598 | ], 599 | "internalType": "struct IStargateRouter.lzTxObj", 600 | "name": "_lzTxParams", 601 | "type": "tuple" 602 | } 603 | ], 604 | "name": "quoteLayerZeroFee", 605 | "outputs": [ 606 | { 607 | "internalType": "uint256", 608 | "name": "", 609 | "type": "uint256" 610 | }, 611 | { 612 | "internalType": "uint256", 613 | "name": "", 614 | "type": "uint256" 615 | } 616 | ], 617 | "stateMutability": "view", 618 | "type": "function" 619 | }, 620 | { 621 | "inputs": [ 622 | { 623 | "internalType": "uint16", 624 | "name": "_dstChainId", 625 | "type": "uint16" 626 | }, 627 | { 628 | "internalType": "uint256", 629 | "name": "_srcPoolId", 630 | "type": "uint256" 631 | }, 632 | { 633 | "internalType": "uint256", 634 | "name": "_dstPoolId", 635 | "type": "uint256" 636 | }, 637 | { 638 | "internalType": "address payable", 639 | "name": "_refundAddress", 640 | "type": "address" 641 | }, 642 | { 643 | "internalType": "uint256", 644 | "name": "_amountLP", 645 | "type": "uint256" 646 | }, 647 | { 648 | "internalType": "bytes", 649 | "name": "_to", 650 | "type": "bytes" 651 | }, 652 | { 653 | "components": [ 654 | { 655 | "internalType": "uint256", 656 | "name": "dstGasForCall", 657 | "type": "uint256" 658 | }, 659 | { 660 | "internalType": "uint256", 661 | "name": "dstNativeAmount", 662 | "type": "uint256" 663 | }, 664 | { 665 | "internalType": "bytes", 666 | "name": "dstNativeAddr", 667 | "type": "bytes" 668 | } 669 | ], 670 | "internalType": "struct IStargateRouter.lzTxObj", 671 | "name": "_lzTxParams", 672 | "type": "tuple" 673 | } 674 | ], 675 | "name": "redeemLocal", 676 | "outputs": [], 677 | "stateMutability": "payable", 678 | "type": "function" 679 | }, 680 | { 681 | "inputs": [ 682 | { 683 | "internalType": "uint16", 684 | "name": "_srcChainId", 685 | "type": "uint16" 686 | }, 687 | { 688 | "internalType": "bytes", 689 | "name": "_srcAddress", 690 | "type": "bytes" 691 | }, 692 | { 693 | "internalType": "uint256", 694 | "name": "_nonce", 695 | "type": "uint256" 696 | }, 697 | { 698 | "internalType": "uint256", 699 | "name": "_srcPoolId", 700 | "type": "uint256" 701 | }, 702 | { 703 | "internalType": "uint256", 704 | "name": "_dstPoolId", 705 | "type": "uint256" 706 | }, 707 | { 708 | "internalType": "address", 709 | "name": "_to", 710 | "type": "address" 711 | }, 712 | { 713 | "internalType": "uint256", 714 | "name": "_amountSD", 715 | "type": "uint256" 716 | }, 717 | { 718 | "internalType": "uint256", 719 | "name": "_mintAmountSD", 720 | "type": "uint256" 721 | } 722 | ], 723 | "name": "redeemLocalCallback", 724 | "outputs": [], 725 | "stateMutability": "nonpayable", 726 | "type": "function" 727 | }, 728 | { 729 | "inputs": [ 730 | { 731 | "internalType": "uint16", 732 | "name": "_srcChainId", 733 | "type": "uint16" 734 | }, 735 | { 736 | "internalType": "bytes", 737 | "name": "_srcAddress", 738 | "type": "bytes" 739 | }, 740 | { 741 | "internalType": "uint256", 742 | "name": "_nonce", 743 | "type": "uint256" 744 | }, 745 | { 746 | "internalType": "uint256", 747 | "name": "_srcPoolId", 748 | "type": "uint256" 749 | }, 750 | { 751 | "internalType": "uint256", 752 | "name": "_dstPoolId", 753 | "type": "uint256" 754 | }, 755 | { 756 | "internalType": "uint256", 757 | "name": "_amountSD", 758 | "type": "uint256" 759 | }, 760 | { 761 | "internalType": "bytes", 762 | "name": "_to", 763 | "type": "bytes" 764 | } 765 | ], 766 | "name": "redeemLocalCheckOnRemote", 767 | "outputs": [], 768 | "stateMutability": "nonpayable", 769 | "type": "function" 770 | }, 771 | { 772 | "inputs": [ 773 | { 774 | "internalType": "uint16", 775 | "name": "_dstChainId", 776 | "type": "uint16" 777 | }, 778 | { 779 | "internalType": "uint256", 780 | "name": "_srcPoolId", 781 | "type": "uint256" 782 | }, 783 | { 784 | "internalType": "uint256", 785 | "name": "_dstPoolId", 786 | "type": "uint256" 787 | }, 788 | { 789 | "internalType": "address payable", 790 | "name": "_refundAddress", 791 | "type": "address" 792 | }, 793 | { 794 | "internalType": "uint256", 795 | "name": "_amountLP", 796 | "type": "uint256" 797 | }, 798 | { 799 | "internalType": "uint256", 800 | "name": "_minAmountLD", 801 | "type": "uint256" 802 | }, 803 | { 804 | "internalType": "bytes", 805 | "name": "_to", 806 | "type": "bytes" 807 | }, 808 | { 809 | "components": [ 810 | { 811 | "internalType": "uint256", 812 | "name": "dstGasForCall", 813 | "type": "uint256" 814 | }, 815 | { 816 | "internalType": "uint256", 817 | "name": "dstNativeAmount", 818 | "type": "uint256" 819 | }, 820 | { 821 | "internalType": "bytes", 822 | "name": "dstNativeAddr", 823 | "type": "bytes" 824 | } 825 | ], 826 | "internalType": "struct IStargateRouter.lzTxObj", 827 | "name": "_lzTxParams", 828 | "type": "tuple" 829 | } 830 | ], 831 | "name": "redeemRemote", 832 | "outputs": [], 833 | "stateMutability": "payable", 834 | "type": "function" 835 | }, 836 | { 837 | "inputs": [], 838 | "name": "renounceOwnership", 839 | "outputs": [], 840 | "stateMutability": "nonpayable", 841 | "type": "function" 842 | }, 843 | { 844 | "inputs": [ 845 | { 846 | "internalType": "uint16", 847 | "name": "_srcChainId", 848 | "type": "uint16" 849 | }, 850 | { 851 | "internalType": "bytes", 852 | "name": "_srcAddress", 853 | "type": "bytes" 854 | }, 855 | { 856 | "internalType": "uint256", 857 | "name": "_nonce", 858 | "type": "uint256" 859 | } 860 | ], 861 | "name": "retryRevert", 862 | "outputs": [], 863 | "stateMutability": "payable", 864 | "type": "function" 865 | }, 866 | { 867 | "inputs": [ 868 | { 869 | "internalType": "uint16", 870 | "name": "", 871 | "type": "uint16" 872 | }, 873 | { 874 | "internalType": "bytes", 875 | "name": "", 876 | "type": "bytes" 877 | }, 878 | { 879 | "internalType": "uint256", 880 | "name": "", 881 | "type": "uint256" 882 | } 883 | ], 884 | "name": "revertLookup", 885 | "outputs": [ 886 | { 887 | "internalType": "bytes", 888 | "name": "", 889 | "type": "bytes" 890 | } 891 | ], 892 | "stateMutability": "view", 893 | "type": "function" 894 | }, 895 | { 896 | "inputs": [ 897 | { 898 | "internalType": "uint16", 899 | "name": "_dstChainId", 900 | "type": "uint16" 901 | }, 902 | { 903 | "internalType": "bytes", 904 | "name": "_srcAddress", 905 | "type": "bytes" 906 | }, 907 | { 908 | "internalType": "uint256", 909 | "name": "_nonce", 910 | "type": "uint256" 911 | }, 912 | { 913 | "internalType": "address payable", 914 | "name": "_refundAddress", 915 | "type": "address" 916 | }, 917 | { 918 | "components": [ 919 | { 920 | "internalType": "uint256", 921 | "name": "dstGasForCall", 922 | "type": "uint256" 923 | }, 924 | { 925 | "internalType": "uint256", 926 | "name": "dstNativeAmount", 927 | "type": "uint256" 928 | }, 929 | { 930 | "internalType": "bytes", 931 | "name": "dstNativeAddr", 932 | "type": "bytes" 933 | } 934 | ], 935 | "internalType": "struct IStargateRouter.lzTxObj", 936 | "name": "_lzTxParams", 937 | "type": "tuple" 938 | } 939 | ], 940 | "name": "revertRedeemLocal", 941 | "outputs": [], 942 | "stateMutability": "payable", 943 | "type": "function" 944 | }, 945 | { 946 | "inputs": [ 947 | { 948 | "internalType": "uint16", 949 | "name": "_dstChainId", 950 | "type": "uint16" 951 | }, 952 | { 953 | "internalType": "uint256", 954 | "name": "_srcPoolId", 955 | "type": "uint256" 956 | }, 957 | { 958 | "internalType": "uint256", 959 | "name": "_dstPoolId", 960 | "type": "uint256" 961 | }, 962 | { 963 | "internalType": "address payable", 964 | "name": "_refundAddress", 965 | "type": "address" 966 | } 967 | ], 968 | "name": "sendCredits", 969 | "outputs": [], 970 | "stateMutability": "payable", 971 | "type": "function" 972 | }, 973 | { 974 | "inputs": [ 975 | { 976 | "internalType": "contract Bridge", 977 | "name": "_bridge", 978 | "type": "address" 979 | }, 980 | { 981 | "internalType": "contract Factory", 982 | "name": "_factory", 983 | "type": "address" 984 | } 985 | ], 986 | "name": "setBridgeAndFactory", 987 | "outputs": [], 988 | "stateMutability": "nonpayable", 989 | "type": "function" 990 | }, 991 | { 992 | "inputs": [ 993 | { 994 | "internalType": "uint256", 995 | "name": "_poolId", 996 | "type": "uint256" 997 | }, 998 | { 999 | "internalType": "bool", 1000 | "name": "_batched", 1001 | "type": "bool" 1002 | }, 1003 | { 1004 | "internalType": "uint256", 1005 | "name": "_swapDeltaBP", 1006 | "type": "uint256" 1007 | }, 1008 | { 1009 | "internalType": "uint256", 1010 | "name": "_lpDeltaBP", 1011 | "type": "uint256" 1012 | }, 1013 | { 1014 | "internalType": "bool", 1015 | "name": "_defaultSwapMode", 1016 | "type": "bool" 1017 | }, 1018 | { 1019 | "internalType": "bool", 1020 | "name": "_defaultLPMode", 1021 | "type": "bool" 1022 | } 1023 | ], 1024 | "name": "setDeltaParam", 1025 | "outputs": [], 1026 | "stateMutability": "nonpayable", 1027 | "type": "function" 1028 | }, 1029 | { 1030 | "inputs": [ 1031 | { 1032 | "internalType": "uint256", 1033 | "name": "_poolId", 1034 | "type": "uint256" 1035 | }, 1036 | { 1037 | "internalType": "address", 1038 | "name": "_feeLibraryAddr", 1039 | "type": "address" 1040 | } 1041 | ], 1042 | "name": "setFeeLibrary", 1043 | "outputs": [], 1044 | "stateMutability": "nonpayable", 1045 | "type": "function" 1046 | }, 1047 | { 1048 | "inputs": [ 1049 | { 1050 | "internalType": "uint256", 1051 | "name": "_poolId", 1052 | "type": "uint256" 1053 | }, 1054 | { 1055 | "internalType": "uint256", 1056 | "name": "_mintFeeBP", 1057 | "type": "uint256" 1058 | } 1059 | ], 1060 | "name": "setFees", 1061 | "outputs": [], 1062 | "stateMutability": "nonpayable", 1063 | "type": "function" 1064 | }, 1065 | { 1066 | "inputs": [ 1067 | { 1068 | "internalType": "address", 1069 | "name": "_owner", 1070 | "type": "address" 1071 | } 1072 | ], 1073 | "name": "setMintFeeOwner", 1074 | "outputs": [], 1075 | "stateMutability": "nonpayable", 1076 | "type": "function" 1077 | }, 1078 | { 1079 | "inputs": [ 1080 | { 1081 | "internalType": "address", 1082 | "name": "_owner", 1083 | "type": "address" 1084 | } 1085 | ], 1086 | "name": "setProtocolFeeOwner", 1087 | "outputs": [], 1088 | "stateMutability": "nonpayable", 1089 | "type": "function" 1090 | }, 1091 | { 1092 | "inputs": [ 1093 | { 1094 | "internalType": "uint256", 1095 | "name": "_poolId", 1096 | "type": "uint256" 1097 | }, 1098 | { 1099 | "internalType": "bool", 1100 | "name": "_swapStop", 1101 | "type": "bool" 1102 | } 1103 | ], 1104 | "name": "setSwapStop", 1105 | "outputs": [], 1106 | "stateMutability": "nonpayable", 1107 | "type": "function" 1108 | }, 1109 | { 1110 | "inputs": [ 1111 | { 1112 | "internalType": "uint256", 1113 | "name": "_poolId", 1114 | "type": "uint256" 1115 | }, 1116 | { 1117 | "internalType": "uint16", 1118 | "name": "_dstChainId", 1119 | "type": "uint16" 1120 | }, 1121 | { 1122 | "internalType": "uint256", 1123 | "name": "_dstPoolId", 1124 | "type": "uint256" 1125 | }, 1126 | { 1127 | "internalType": "uint16", 1128 | "name": "_weight", 1129 | "type": "uint16" 1130 | } 1131 | ], 1132 | "name": "setWeightForChainPath", 1133 | "outputs": [], 1134 | "stateMutability": "nonpayable", 1135 | "type": "function" 1136 | }, 1137 | { 1138 | "inputs": [ 1139 | { 1140 | "internalType": "uint16", 1141 | "name": "_dstChainId", 1142 | "type": "uint16" 1143 | }, 1144 | { 1145 | "internalType": "uint256", 1146 | "name": "_srcPoolId", 1147 | "type": "uint256" 1148 | }, 1149 | { 1150 | "internalType": "uint256", 1151 | "name": "_dstPoolId", 1152 | "type": "uint256" 1153 | }, 1154 | { 1155 | "internalType": "address payable", 1156 | "name": "_refundAddress", 1157 | "type": "address" 1158 | }, 1159 | { 1160 | "internalType": "uint256", 1161 | "name": "_amountLD", 1162 | "type": "uint256" 1163 | }, 1164 | { 1165 | "internalType": "uint256", 1166 | "name": "_minAmountLD", 1167 | "type": "uint256" 1168 | }, 1169 | { 1170 | "components": [ 1171 | { 1172 | "internalType": "uint256", 1173 | "name": "dstGasForCall", 1174 | "type": "uint256" 1175 | }, 1176 | { 1177 | "internalType": "uint256", 1178 | "name": "dstNativeAmount", 1179 | "type": "uint256" 1180 | }, 1181 | { 1182 | "internalType": "bytes", 1183 | "name": "dstNativeAddr", 1184 | "type": "bytes" 1185 | } 1186 | ], 1187 | "internalType": "struct IStargateRouter.lzTxObj", 1188 | "name": "_lzTxParams", 1189 | "type": "tuple" 1190 | }, 1191 | { 1192 | "internalType": "bytes", 1193 | "name": "_to", 1194 | "type": "bytes" 1195 | }, 1196 | { 1197 | "internalType": "bytes", 1198 | "name": "_payload", 1199 | "type": "bytes" 1200 | } 1201 | ], 1202 | "name": "swap", 1203 | "outputs": [], 1204 | "stateMutability": "payable", 1205 | "type": "function" 1206 | }, 1207 | { 1208 | "inputs": [ 1209 | { 1210 | "internalType": "uint16", 1211 | "name": "_srcChainId", 1212 | "type": "uint16" 1213 | }, 1214 | { 1215 | "internalType": "bytes", 1216 | "name": "_srcAddress", 1217 | "type": "bytes" 1218 | }, 1219 | { 1220 | "internalType": "uint256", 1221 | "name": "_nonce", 1222 | "type": "uint256" 1223 | }, 1224 | { 1225 | "internalType": "uint256", 1226 | "name": "_srcPoolId", 1227 | "type": "uint256" 1228 | }, 1229 | { 1230 | "internalType": "uint256", 1231 | "name": "_dstPoolId", 1232 | "type": "uint256" 1233 | }, 1234 | { 1235 | "internalType": "uint256", 1236 | "name": "_dstGasForCall", 1237 | "type": "uint256" 1238 | }, 1239 | { 1240 | "internalType": "address", 1241 | "name": "_to", 1242 | "type": "address" 1243 | }, 1244 | { 1245 | "components": [ 1246 | { 1247 | "internalType": "uint256", 1248 | "name": "amount", 1249 | "type": "uint256" 1250 | }, 1251 | { 1252 | "internalType": "uint256", 1253 | "name": "eqFee", 1254 | "type": "uint256" 1255 | }, 1256 | { 1257 | "internalType": "uint256", 1258 | "name": "eqReward", 1259 | "type": "uint256" 1260 | }, 1261 | { 1262 | "internalType": "uint256", 1263 | "name": "lpFee", 1264 | "type": "uint256" 1265 | }, 1266 | { 1267 | "internalType": "uint256", 1268 | "name": "protocolFee", 1269 | "type": "uint256" 1270 | }, 1271 | { 1272 | "internalType": "uint256", 1273 | "name": "lkbRemove", 1274 | "type": "uint256" 1275 | } 1276 | ], 1277 | "internalType": "struct Pool.SwapObj", 1278 | "name": "_s", 1279 | "type": "tuple" 1280 | }, 1281 | { 1282 | "internalType": "bytes", 1283 | "name": "_payload", 1284 | "type": "bytes" 1285 | } 1286 | ], 1287 | "name": "swapRemote", 1288 | "outputs": [], 1289 | "stateMutability": "nonpayable", 1290 | "type": "function" 1291 | }, 1292 | { 1293 | "inputs": [ 1294 | { 1295 | "internalType": "address", 1296 | "name": "newOwner", 1297 | "type": "address" 1298 | } 1299 | ], 1300 | "name": "transferOwnership", 1301 | "outputs": [], 1302 | "stateMutability": "nonpayable", 1303 | "type": "function" 1304 | }, 1305 | { 1306 | "inputs": [ 1307 | { 1308 | "internalType": "uint256", 1309 | "name": "_poolId", 1310 | "type": "uint256" 1311 | }, 1312 | { 1313 | "internalType": "address", 1314 | "name": "_to", 1315 | "type": "address" 1316 | } 1317 | ], 1318 | "name": "withdrawMintFee", 1319 | "outputs": [], 1320 | "stateMutability": "nonpayable", 1321 | "type": "function" 1322 | }, 1323 | { 1324 | "inputs": [ 1325 | { 1326 | "internalType": "uint256", 1327 | "name": "_poolId", 1328 | "type": "uint256" 1329 | }, 1330 | { 1331 | "internalType": "address", 1332 | "name": "_to", 1333 | "type": "address" 1334 | } 1335 | ], 1336 | "name": "withdrawProtocolFee", 1337 | "outputs": [], 1338 | "stateMutability": "nonpayable", 1339 | "type": "function" 1340 | } 1341 | ] --------------------------------------------------------------------------------