This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement token swaps in the SDK (#35)
* Hey cool we can _swap tokens_ now, man. * Forgot to commit abigen * dedupe code * Make deadline a param * cleanup * Really refactor the hell out of this. * EVEN MORE * src/swaps => src/tokenswap * Fix imports * Move detailedTokenSwapMap to TokenSwap namespace
- Loading branch information
Showing
27 changed files
with
6,583 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,386 @@ | ||
const ABI = { | ||
"abi": [ | ||
{ | ||
"inputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "constructor" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "bytes32", | ||
"name": "role", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "bytes32", | ||
"name": "previousAdminRole", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "bytes32", | ||
"name": "newAdminRole", | ||
"type": "bytes32" | ||
} | ||
], | ||
"name": "RoleAdminChanged", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "bytes32", | ||
"name": "role", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "account", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "sender", | ||
"type": "address" | ||
} | ||
], | ||
"name": "RoleGranted", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "bytes32", | ||
"name": "role", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "account", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "sender", | ||
"type": "address" | ||
} | ||
], | ||
"name": "RoleRevoked", | ||
"type": "event" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "BRIDGEMANAGER_ROLE", | ||
"outputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "", | ||
"type": "bytes32" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "DEFAULT_ADMIN_ROLE", | ||
"outputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "", | ||
"type": "bytes32" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "tokenAddress", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "chainID", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "getPoolConfig", | ||
"outputs": [ | ||
{ | ||
"components": [ | ||
{ | ||
"internalType": "address", | ||
"name": "tokenAddress", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "chainId", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "address", | ||
"name": "poolAddress", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "bool", | ||
"name": "metaswap", | ||
"type": "bool" | ||
} | ||
], | ||
"internalType": "struct PoolConfig.Pool", | ||
"name": "", | ||
"type": "tuple" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "role", | ||
"type": "bytes32" | ||
} | ||
], | ||
"name": "getRoleAdmin", | ||
"outputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "", | ||
"type": "bytes32" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "role", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "index", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "getRoleMember", | ||
"outputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "", | ||
"type": "address" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "role", | ||
"type": "bytes32" | ||
} | ||
], | ||
"name": "getRoleMemberCount", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "role", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "address", | ||
"name": "account", | ||
"type": "address" | ||
} | ||
], | ||
"name": "grantRole", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "role", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "address", | ||
"name": "account", | ||
"type": "address" | ||
} | ||
], | ||
"name": "hasRole", | ||
"outputs": [ | ||
{ | ||
"internalType": "bool", | ||
"name": "", | ||
"type": "bool" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "role", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "address", | ||
"name": "account", | ||
"type": "address" | ||
} | ||
], | ||
"name": "renounceRole", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes32", | ||
"name": "role", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"internalType": "address", | ||
"name": "account", | ||
"type": "address" | ||
} | ||
], | ||
"name": "revokeRole", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "tokenAddress", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "chainID", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "address", | ||
"name": "poolAddress", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "bool", | ||
"name": "metaswap", | ||
"type": "bool" | ||
} | ||
], | ||
"name": "setPoolConfig", | ||
"outputs": [ | ||
{ | ||
"components": [ | ||
{ | ||
"internalType": "address", | ||
"name": "tokenAddress", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "chainId", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "address", | ||
"name": "poolAddress", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "bool", | ||
"name": "metaswap", | ||
"type": "bool" | ||
} | ||
], | ||
"internalType": "struct PoolConfig.Pool", | ||
"name": "", | ||
"type": "tuple" | ||
} | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
], | ||
"devdoc": { | ||
"kind": "dev", | ||
"methods": { | ||
"getRoleAdmin(bytes32)": { | ||
"details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." | ||
}, | ||
"getRoleMember(bytes32,uint256)": { | ||
"details": "Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information." | ||
}, | ||
"getRoleMemberCount(bytes32)": { | ||
"details": "Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role." | ||
}, | ||
"grantRole(bytes32,address)": { | ||
"details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role." | ||
}, | ||
"hasRole(bytes32,address)": { | ||
"details": "Returns `true` if `account` has been granted `role`." | ||
}, | ||
"renounceRole(bytes32,address)": { | ||
"details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`." | ||
}, | ||
"revokeRole(bytes32,address)": { | ||
"details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role." | ||
} | ||
}, | ||
"version": 1 | ||
}, | ||
"userdoc": { | ||
"kind": "user", | ||
"methods": {}, | ||
"version": 1 | ||
} | ||
} | ||
|
||
export default ABI |
Oops, something went wrong.