From 89b9898a13c0125b5c2e97ff39d996a304e32bf2 Mon Sep 17 00:00:00 2001 From: Noisekit Date: Fri, 18 Aug 2023 20:09:21 +0800 Subject: [PATCH] Automate Smart Contracts documentation publishing (#1779) * Enable docgen for legacy market * Delete pre-generated docs * Add docs dirs to gitignore * Remove diff check * Enable legacy market docs in combined file * Disable tests * CCI docgen * Store docgen in artifacts * git * Run docgen * Enable tests * ABIs are now moved to synthetix docs v3 repo * Halt if no changes to docs * Generate ABIs and docs page * Cache SOLC * Remove TOC as gitbook auto-generates it * Use local IPFS with cannon * Fail on errors * Deps * Fix missing deployments folder * Install Foundry and Anvil * Less verbose --- .circleci/config.yml | 205 + .github/workflows/docgen.yml | 21 - .github/workflows/test.yml | 3 + .gitignore | 1 + docs/Contracts.md | 6291 ----------------- markets/legacy-market/package.json | 2 +- markets/perps-market/docs/index.md | 1115 --- markets/spot-market/docs/index.md | 1449 ---- package.json | 4 +- protocol/governance/docs/index.md | 1117 --- protocol/oracle-manager/docs/index.md | 251 - protocol/synthetix/docs/index.md | 2333 ------ utils/docgen/.gitignore | 3 + utils/docgen/abis.js | 268 +- utils/docgen/abis/1-OracleManager.json | 495 -- utils/docgen/abis/1-SynthetixCore.json | 4587 ------------ utils/docgen/abis/1-snxAccountNFT.json | 815 --- utils/docgen/abis/1-snxUSDToken.json | 847 --- utils/docgen/abis/10-OracleManager.json | 495 -- utils/docgen/abis/10-SpotMarket.json | 3757 ---------- utils/docgen/abis/10-SynthetixCore.json | 4649 ------------ utils/docgen/abis/10-snxAccountNFT.json | 815 --- utils/docgen/abis/10-snxUSDToken.json | 847 --- utils/docgen/abis/11155111-OracleManager.json | 495 -- utils/docgen/abis/11155111-SynthetixCore.json | 4649 ------------ utils/docgen/abis/11155111-snxAccountNFT.json | 815 --- utils/docgen/abis/11155111-snxUSDToken.json | 847 --- utils/docgen/abis/420-OracleManager.json | 495 -- utils/docgen/abis/420-PerpsAccountNFT.json | 815 --- utils/docgen/abis/420-PerpsMarket.json | 3372 --------- utils/docgen/abis/420-SpotMarket.json | 3757 ---------- utils/docgen/abis/420-SynthetixCore.json | 4649 ------------ utils/docgen/abis/420-snxAccountNFT.json | 815 --- utils/docgen/abis/420-snxUSDToken.json | 847 --- utils/docgen/abis/5-OracleManager.json | 495 -- utils/docgen/abis/5-SynthetixCore.json | 4649 ------------ utils/docgen/abis/5-snxAccountNFT.json | 815 --- utils/docgen/abis/5-snxUSDToken.json | 847 --- utils/docgen/abis/84531-OracleManager.json | 495 -- utils/docgen/abis/84531-SynthetixCore.json | 4649 ------------ utils/docgen/abis/84531-snxAccountNFT.json | 815 --- utils/docgen/abis/84531-snxUSDToken.json | 847 --- utils/docgen/addresses-+-abis.md | 9 + utils/docgen/docgen-abis.sh | 45 + ...ocgen:contracts.sh => docgen-contracts.sh} | 29 +- utils/docgen/package.json | 8 +- 46 files changed, 472 insertions(+), 65157 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 .github/workflows/docgen.yml delete mode 100644 docs/Contracts.md delete mode 100644 markets/perps-market/docs/index.md delete mode 100644 markets/spot-market/docs/index.md delete mode 100644 protocol/governance/docs/index.md delete mode 100644 protocol/oracle-manager/docs/index.md delete mode 100644 protocol/synthetix/docs/index.md create mode 100644 utils/docgen/.gitignore mode change 100644 => 100755 utils/docgen/abis.js delete mode 100644 utils/docgen/abis/1-OracleManager.json delete mode 100644 utils/docgen/abis/1-SynthetixCore.json delete mode 100644 utils/docgen/abis/1-snxAccountNFT.json delete mode 100644 utils/docgen/abis/1-snxUSDToken.json delete mode 100644 utils/docgen/abis/10-OracleManager.json delete mode 100644 utils/docgen/abis/10-SpotMarket.json delete mode 100644 utils/docgen/abis/10-SynthetixCore.json delete mode 100644 utils/docgen/abis/10-snxAccountNFT.json delete mode 100644 utils/docgen/abis/10-snxUSDToken.json delete mode 100644 utils/docgen/abis/11155111-OracleManager.json delete mode 100644 utils/docgen/abis/11155111-SynthetixCore.json delete mode 100644 utils/docgen/abis/11155111-snxAccountNFT.json delete mode 100644 utils/docgen/abis/11155111-snxUSDToken.json delete mode 100644 utils/docgen/abis/420-OracleManager.json delete mode 100644 utils/docgen/abis/420-PerpsAccountNFT.json delete mode 100644 utils/docgen/abis/420-PerpsMarket.json delete mode 100644 utils/docgen/abis/420-SpotMarket.json delete mode 100644 utils/docgen/abis/420-SynthetixCore.json delete mode 100644 utils/docgen/abis/420-snxAccountNFT.json delete mode 100644 utils/docgen/abis/420-snxUSDToken.json delete mode 100644 utils/docgen/abis/5-OracleManager.json delete mode 100644 utils/docgen/abis/5-SynthetixCore.json delete mode 100644 utils/docgen/abis/5-snxAccountNFT.json delete mode 100644 utils/docgen/abis/5-snxUSDToken.json delete mode 100644 utils/docgen/abis/84531-OracleManager.json delete mode 100644 utils/docgen/abis/84531-SynthetixCore.json delete mode 100644 utils/docgen/abis/84531-snxAccountNFT.json delete mode 100644 utils/docgen/abis/84531-snxUSDToken.json create mode 100644 utils/docgen/addresses-+-abis.md create mode 100755 utils/docgen/docgen-abis.sh rename utils/docgen/{docgen:contracts.sh => docgen-contracts.sh} (55%) diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..3519d597b9 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,205 @@ +version: 2.1 + +parameters: + node-version: + type: string + default: "16.20.1" + +commands: + yarn-install: + steps: + - run: yarn install --immutable --immutable-cache + + install-foundry: + steps: + - restore_cache: + keys: + - foundry-{{ .Environment.FOUNDRY_CACHE_VERSION }} + + - run: + name: "Install Foundry" + working_directory: ~/ + environment: + SHELL: /bin/bash + command: |- + export PATH="$PATH:$HOME/.foundry/bin" + echo 'export PATH=$PATH:$HOME/.foundry/bin' >> $BASH_ENV + + if command -v anvil; then + echo "Anvil already installed" + anvil --version + else + curl -L https://foundry.paradigm.xyz | bash + foundryup + fi + + - save_cache: + key: foundry-{{ .Environment.FOUNDRY_CACHE_VERSION }} + paths: + - "~/.foundry" + + install-ipfs: + steps: + - restore_cache: + keys: + - ipfs-{{ .Environment.IPFS_CACHE_VERSION }} + + - run: + name: "Install IPFS" + working_directory: ~/ + command: | + export PATH="$PATH:$HOME/go-ipfs" + echo 'export PATH=$PATH:$HOME/go-ipfs' >> $BASH_ENV + + if command -v ipfs; then + echo "IPFS already installed" + ipfs version + ipfs id + else + LATEST_VERSION=$(curl -sSL https://dist.ipfs.tech/go-ipfs/versions | tail -n 1) + LATEST_VERSION_NUMBER=${LATEST_VERSION#*v} + DOWNLOAD_URL="https://dist.ipfs.tech/go-ipfs/${LATEST_VERSION}/go-ipfs_${LATEST_VERSION}_linux-amd64.tar.gz" + echo "DOWNLOAD_URL=$DOWNLOAD_URL" + curl -sSL -o ipfs.tar.gz $DOWNLOAD_URL + tar -xzf ipfs.tar.gz + rm -rf ~/.ipfs + ipfs init + fi + + - save_cache: + key: ipfs-{{ .Environment.IPFS_CACHE_VERSION }} + paths: + - "~/go-ipfs" + - "~/.ipfs" + + run-ipfs-daemon: + steps: + - run: + command: ipfs daemon + background: true + + wait-for-ipfs: + steps: + - run: + name: "Wait for IPFS daemon to start" + command: wget --retry-connrefused --waitretry=20 --read-timeout=20 --timeout=15 -t 10 --post-data '' "http://localhost:5001/api/v0/version" + +jobs: + docgen: + docker: + - image: cimg/node:<< pipeline.parameters.node-version >> + environment: + - CANNON_IPFS_URL: "http://127.0.0.1:5001" + - CANNON_PUBLISH_IPFS_URL: "http://127.0.0.1:5001" + - GIT_PAGER: cat + working_directory: ~/synthetix-v3 + steps: + - add_ssh_keys: + fingerprints: "46:05:bf:bf:84:e8:af:09:35:05:89:09:62:45:84:7c" + - run: + working_directory: ~/ + name: "Checkout docs" + command: | + ssh-keyscan github.com >> ~/.ssh/known_hosts + git clone git@github.com:Synthetixio/Synthetix-Gitbook-v3.git --verbose --depth 1 --no-tags --single-branch synthetix-gitbook-v3 + + - checkout + + - install-ipfs + - run-ipfs-daemon + - install-foundry + - yarn-install + - wait-for-ipfs + + - run: + name: "Build TS" + command: yarn workspaces foreach --topological-dev --verbose run build:ts + + - restore_cache: + keys: + - hardhat-{{ .Environment.SOLC_VERSION }} + - run: + name: "Generate docs for each contract" + command: yarn workspaces foreach --verbose run docgen + - save_cache: + key: hardhat-{{ .Environment.SOLC_VERSION }} + paths: + - "~/.cache/hardhat-nodejs" + + - run: + name: "Generate combined smart-contracts.md" + working_directory: ~/synthetix-v3/utils/docgen + command: ./docgen-contracts.sh + + - run: + name: "Generate combined addresses-+-abis.md" + working_directory: ~/synthetix-v3/utils/docgen + command: ./docgen-abis.sh + + - store_artifacts: + path: "docs" + destination: "." + + - run: + working_directory: ~/synthetix-gitbook-v3 + name: "Update docs and push to smart-contracts branch" + command: | + cp ~/synthetix-v3/docs/smart-contracts.md ./for-developers/smart-contracts.md + cp ~/synthetix-v3/docs/addresses-+-abis.md ./for-developers/addresses-+-abis.md + cp ~/synthetix-v3/docs/abis/*.json ./for-developers/abis/ + + STATUS=$(git status) + if [[ $STATUS == *"nothing to commit, working tree clean"* ]]; then + echo "SKIP. Working tree is clean. No changes to Smart Contracts docs" + exit 0 + fi + + git branch smart-contracts + git checkout smart-contracts + + git config --global user.email nikita@cc.snxdao.io + git config --global user.name Noisekit + + git add ./for-developers/smart-contracts.md + git add ./for-developers/addresses-+-abis.md + git add ./for-developers/abis + git commit -m "Update Smart Contracts" + git push --set-upstream --force origin smart-contracts + + PR_URL=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ + https://api.github.com/repos/Synthetixio/Synthetix-Gitbook-v3/pulls?state=open | \ + jq -r '.[] | select(.head.ref=="smart-contracts") | .html_url') + + # If no PR exists with the branch "smart-contracts", create one + # If PR already exists it would be updated with the most recent docs via forced push + if [ -z "$PR_URL" ]; then + curl -s -X POST -H "Authorization: token $GITHUB_TOKEN" \ + https://api.github.com/repos/Synthetixio/Synthetix-Gitbook-v3/pulls \ + -d '{ + "title": "Update Smart Contracts", + "head": "smart-contracts", + "base": "en" + }' + else + echo "Pull Request already exists: $PR_URL" + fi + +workflows: + version: 2.1 + + docgen: + jobs: + - docgen: + name: "docgen-release" + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/ + - docgen: + name: "docgen-dev" + filters: + tags: + ignore: /.*/ + branches: + only: /docgen/ diff --git a/.github/workflows/docgen.yml b/.github/workflows/docgen.yml deleted file mode 100644 index 57675078d8..0000000000 --- a/.github/workflows/docgen.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Docgen - -on: - push: - branches: - - "docgen" - -jobs: - docgen: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: "18.16.0" - cache: "yarn" - - run: yarn --version - - run: yarn install --immutable --immutable-cache - - run: yarn workspaces foreach --topological-dev --verbose run build:ts - - run: yarn docgen - - run: git diff --exit-code diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb6b9e0048..4e7a3d5ebb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,9 @@ name: Test on: pull_request: {} + push: + branches: + - "test" jobs: test: diff --git a/.gitignore b/.gitignore index 82c9dbb99a..7d50628093 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ node_modules Router.sol typechain-types lerna-debug.log +docs/ # Yarn v3 .yarn/* diff --git a/docs/Contracts.md b/docs/Contracts.md deleted file mode 100644 index 909f6f220b..0000000000 --- a/docs/Contracts.md +++ /dev/null @@ -1,6291 +0,0 @@ -# Smart Contracts - -- [Synthetix Core](#synthetix-core) -- [Spot Market](#spot-market) -- [Perps Market](#perps-market) -- [Governance](#governance) -- [Oracle Manager](#oracle-manager) - -## Synthetix Core - -### Account Module - -#### getAccountPermissions - - ```solidity - function getAccountPermissions(uint128 accountId) external view returns (struct IAccountModule.AccountPermissions[] accountPerms) - ``` - - Returns an array of `AccountPermission` for the provided `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose permissions are being retrieved. - -**Returns** -* `accountPerms` (*struct IAccountModule.AccountPermissions[]*) - An array of AccountPermission objects describing the permissions granted to the account. -#### createAccount - - ```solidity - function createAccount(uint128 requestedAccountId) external - ``` - - Mints an account token with id `requestedAccountId` to `msg.sender`. - -**Parameters** -* `requestedAccountId` (*uint128*) - The id requested for the account being created. Reverts if id already exists. Requirements: - `requestedAccountId` must not already be minted. - `requestedAccountId` must be less than type(uint128).max / 2 Emits a {AccountCreated} event. - -#### createAccount - - ```solidity - function createAccount() external returns (uint128 accountId) - ``` - - Mints an account token with an available id to `msg.sender`. - -Emits a {AccountCreated} event. - -#### notifyAccountTransfer - - ```solidity - function notifyAccountTransfer(address to, uint128 accountId) external - ``` - - Called by AccountTokenModule to notify the system when the account token is transferred. - - Resets user permissions and assigns ownership of the account token to the new holder. - -**Parameters** -* `to` (*address*) - The new holder of the account NFT. -* `accountId` (*uint128*) - The id of the account that was just transferred. Requirements: - `msg.sender` must be the account token. - -#### grantPermission - - ```solidity - function grantPermission(uint128 accountId, bytes32 permission, address user) external - ``` - - Grants `permission` to `user` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that granted the permission. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. -* `user` (*address*) - The target address that received the permission. Requirements: - `msg.sender` must own the account token with ID `accountId` or have the "admin" permission. Emits a {PermissionGranted} event. - -#### revokePermission - - ```solidity - function revokePermission(uint128 accountId, bytes32 permission, address user) external - ``` - - Revokes `permission` from `user` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that revoked the permission. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. -* `user` (*address*) - The target address that no longer has the permission. Requirements: - `msg.sender` must own the account token with ID `accountId` or have the "admin" permission. Emits a {PermissionRevoked} event. - -#### renouncePermission - - ```solidity - function renouncePermission(uint128 accountId, bytes32 permission) external - ``` - - Revokes `permission` from `msg.sender` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose permission was renounced. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. Emits a {PermissionRevoked} event. - -#### hasPermission - - ```solidity - function hasPermission(uint128 accountId, bytes32 permission, address user) external view returns (bool hasPermission) - ``` - - Returns `true` if `user` has been granted `permission` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose permission is being queried. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. -* `user` (*address*) - The target address whose permission is being queried. - -**Returns** -* `hasPermission` (*bool*) - A boolean with the response of the query. -#### isAuthorized - - ```solidity - function isAuthorized(uint128 accountId, bytes32 permission, address target) external view returns (bool isAuthorized) - ``` - - Returns `true` if `target` is authorized to `permission` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose permission is being queried. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. -* `target` (*address*) - The target address whose permission is being queried. - -**Returns** -* `isAuthorized` (*bool*) - A boolean with the response of the query. -#### getAccountTokenAddress - - ```solidity - function getAccountTokenAddress() external view returns (address accountNftToken) - ``` - - Returns the address for the account token used by the module. - -**Returns** -* `accountNftToken` (*address*) - The address of the account token. -#### getAccountOwner - - ```solidity - function getAccountOwner(uint128 accountId) external view returns (address owner) - ``` - - Returns the address that owns a given account, as recorded by the system. - -**Parameters** -* `accountId` (*uint128*) - The account id whose owner is being retrieved. - -**Returns** -* `owner` (*address*) - The owner of the given account id. -#### getAccountLastInteraction - - ```solidity - function getAccountLastInteraction(uint128 accountId) external view returns (uint256 timestamp) - ``` - - Returns the last unix timestamp that a permissioned action was taken with this account - -**Parameters** -* `accountId` (*uint128*) - The account id to check - -**Returns** -* `timestamp` (*uint256*) - The unix timestamp of the last time a permissioned action occured with the account - -#### AccountCreated - - ```solidity - event AccountCreated(uint128 accountId, address owner) - ``` - - Emitted when an account token with id `accountId` is minted to `sender`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account. -* `owner` (*address*) - The address that owns the created account. - -#### PermissionGranted - - ```solidity - event PermissionGranted(uint128 accountId, bytes32 permission, address user, address sender) - ``` - - Emitted when `user` is granted `permission` by `sender` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that granted the permission. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. -* `user` (*address*) - The target address to whom the permission was granted. -* `sender` (*address*) - The Address that granted the permission. - -#### PermissionRevoked - - ```solidity - event PermissionRevoked(uint128 accountId, bytes32 permission, address user, address sender) - ``` - - Emitted when `user` has `permission` renounced or revoked by `sender` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that has had the permission revoked. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. -* `user` (*address*) - The target address for which the permission was revoked. -* `sender` (*address*) - The address that revoked the permission. - -### Account Token Module - -#### isInitialized - - ```solidity - function isInitialized() external returns (bool) - ``` - - Returns whether the token has been initialized. - -**Returns** -* `[0]` (*bool*) - A boolean with the result of the query. -#### initialize - - ```solidity - function initialize(string tokenName, string tokenSymbol, string uri) external - ``` - - Initializes the token with name, symbol, and uri. - -#### mint - - ```solidity - function mint(address to, uint256 tokenId) external - ``` - - Allows the owner to mint tokens. - -**Parameters** -* `to` (*address*) - The address to receive the newly minted tokens. -* `tokenId` (*uint256*) - The ID of the newly minted token - -#### safeMint - - ```solidity - function safeMint(address to, uint256 tokenId, bytes data) external - ``` - - Allows the owner to mint tokens. Verifies that the receiver can receive the token - -**Parameters** -* `to` (*address*) - The address to receive the newly minted token. -* `tokenId` (*uint256*) - The ID of the newly minted token -* `data` (*bytes*) - any data which should be sent to the receiver - -#### burn - - ```solidity - function burn(uint256 tokenId) external - ``` - - Allows the owner to burn tokens. - -**Parameters** -* `tokenId` (*uint256*) - The token to burn - -#### setAllowance - - ```solidity - function setAllowance(uint256 tokenId, address spender) external - ``` - - Allows an address that holds tokens to provide allowance to another. - -**Parameters** -* `tokenId` (*uint256*) - The token which should be allowed to spender -* `spender` (*address*) - The address that is given allowance. - -#### setBaseTokenURI - - ```solidity - function setBaseTokenURI(string uri) external - ``` - - Allows the owner to update the base token URI. - -**Parameters** -* `uri` (*string*) - The new base token uri - -#### totalSupply - - ```solidity - function totalSupply() external view returns (uint256) - ``` - - Returns the total amount of tokens stored by the contract. - -#### tokenOfOwnerByIndex - - ```solidity - function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256) - ``` - - Returns a token ID owned by `owner` at a given `index` of its token list. -Use along with {balanceOf} to enumerate all of ``owner``'s tokens. - -Requirements: -- `owner` must be a valid address -- `index` must be less than the balance of the tokens for the owner - -#### tokenByIndex - - ```solidity - function tokenByIndex(uint256 index) external view returns (uint256) - ``` - - Returns a token ID at a given `index` of all the tokens stored by the contract. -Use along with {totalSupply} to enumerate all tokens. - -Requirements: -- `index` must be less than the total supply of the tokens - -#### balanceOf - - ```solidity - function balanceOf(address holder) external view returns (uint256 balance) - ``` - - Returns the number of tokens in ``owner``'s account. - -Requirements: - -- `holder` must be a valid address - -#### ownerOf - - ```solidity - function ownerOf(uint256 tokenId) external view returns (address owner) - ``` - - Returns the owner of the `tokenId` token. - -Requirements: - -- `tokenId` must exist. - -#### safeTransferFrom - - ```solidity - function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external - ``` - - Safely transfers `tokenId` token from `from` to `to`. - -Requirements: - -- `from` cannot be the zero address. -- `to` cannot be the zero address. -- `tokenId` token must exist and be owned by `from`. -- If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. -- If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - -Emits a {Transfer} event. - -#### safeTransferFrom - - ```solidity - function safeTransferFrom(address from, address to, uint256 tokenId) external - ``` - - Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients -are aware of the ERC721 protocol to prevent tokens from being forever locked. - -Requirements: - -- `from` cannot be the zero address. -- `to` cannot be the zero address. -- `tokenId` token must exist and be owned by `from`. -- If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. -- If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - -Emits a {Transfer} event. - -#### transferFrom - - ```solidity - function transferFrom(address from, address to, uint256 tokenId) external - ``` - - Transfers `tokenId` token from `from` to `to`. - -WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. - -Requirements: - -- `from` cannot be the zero address. -- `to` cannot be the zero address. -- `tokenId` token must be owned by `from`. -- If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - -Emits a {Transfer} event. - -#### approve - - ```solidity - function approve(address to, uint256 tokenId) external - ``` - - Gives permission to `to` to transfer `tokenId` token to another account. -The approval is cleared when the token is transferred. - -Only a single account can be approved at a time, so approving the zero address clears previous approvals. - -Requirements: - -- The caller must own the token or be an approved operator. -- `tokenId` must exist. - -Emits an {Approval} event. - -#### setApprovalForAll - - ```solidity - function setApprovalForAll(address operator, bool approved) external - ``` - - Approve or remove `operator` as an operator for the caller. -Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. - -Requirements: - -- The `operator` cannot be the caller. - -Emits an {ApprovalForAll} event. - -#### getApproved - - ```solidity - function getApproved(uint256 tokenId) external view returns (address operator) - ``` - - Returns the account approved for `tokenId` token. - -Requirements: - -- `tokenId` must exist. - -#### isApprovedForAll - - ```solidity - function isApprovedForAll(address owner, address operator) external view returns (bool) - ``` - - Returns if the `operator` is allowed to manage all of the assets of `owner`. - -See {setApprovalForAll} - -#### Transfer - - ```solidity - event Transfer(address from, address to, uint256 tokenId) - ``` - - Emitted when `tokenId` token is transferred from `from` to `to`. - -#### Approval - - ```solidity - event Approval(address owner, address approved, uint256 tokenId) - ``` - - Emitted when `owner` enables `approved` to manage the `tokenId` token. - -#### ApprovalForAll - - ```solidity - event ApprovalForAll(address owner, address operator, bool approved) - ``` - - Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. - -### Associate Debt Module - -#### associateDebt - - ```solidity - function associateDebt(uint128 marketId, uint128 poolId, address collateralType, uint128 accountId, uint256 amount) external returns (int256 debtAmount) - ``` - - Allows a market to associate debt with a specific position. -The specified debt will be removed from all vault participants pro-rata. After removing the debt, the amount will -be allocated directly to the specified account. -**NOTE**: if the specified account is an existing staker on the vault, their position will be included in the pro-rata -reduction. Ex: if there are 10 users staking 10 USD of debt on a pool, and associate debt is called with 10 USD on one of those users, -their debt after the operation is complete will be 19 USD. This might seem unusual, but its actually ideal behavior when -your market has incurred some new debt, and it wants to allocate this amount directly to a specific user. In this case, the user's -debt balance would increase pro rata, but then get decreased pro-rata, and then increased to the full amount on their account. All -other accounts would be left with no change to their debt, however. - -**Parameters** -* `marketId` (*uint128*) - The id of the market to which debt was associated. -* `poolId` (*uint128*) - The id of the pool associated to the target market. -* `collateralType` (*address*) - The address of the collateral type that acts as collateral in the corresponding pool. -* `accountId` (*uint128*) - The id of the account whose debt is being associated. -* `amount` (*uint256*) - The amount of debt being associated with the specified account, denominated with 18 decimals of precision. - -**Returns** -* `debtAmount` (*int256*) - The updated debt of the position, denominated with 18 decimals of precision. - -#### DebtAssociated - - ```solidity - event DebtAssociated(uint128 marketId, uint128 poolId, address collateralType, uint128 accountId, uint256 amount, int256 updatedDebt) - ``` - - Emitted when `associateDebt` is called. - -**Parameters** -* `marketId` (*uint128*) - The id of the market to which debt was associated. -* `poolId` (*uint128*) - The id of the pool associated to the target market. -* `collateralType` (*address*) - The address of the collateral type that acts as collateral in the corresponding pool. -* `accountId` (*uint128*) - The id of the account whose debt is being associated. -* `amount` (*uint256*) - The amount of debt being associated with the specified account, denominated with 18 decimals of precision. -* `updatedDebt` (*int256*) - The total updated debt of the account, denominated with 18 decimals of precision - -### Collateral Configuration Module - -#### configureCollateral - - ```solidity - function configureCollateral(struct CollateralConfiguration.Data config) external - ``` - - Creates or updates the configuration for the given `collateralType`. - -**Parameters** -* `config` (*struct CollateralConfiguration.Data*) - The CollateralConfiguration object describing the new configuration. Requirements: - `msg.sender` must be the owner of the system. Emits a {CollateralConfigured} event. - -#### getCollateralConfigurations - - ```solidity - function getCollateralConfigurations(bool hideDisabled) external view returns (struct CollateralConfiguration.Data[] collaterals) - ``` - - Returns a list of detailed information pertaining to all collateral types registered in the system. - - Optionally returns only those that are currently enabled. - -**Parameters** -* `hideDisabled` (*bool*) - Wether to hide disabled collaterals or just return the full list of collaterals in the system. - -**Returns** -* `collaterals` (*struct CollateralConfiguration.Data[]*) - The list of collateral configuration objects set in the system. -#### getCollateralConfiguration - - ```solidity - function getCollateralConfiguration(address collateralType) external view returns (struct CollateralConfiguration.Data collateral) - ``` - - Returns detailed information pertaining the specified collateral type. - -**Parameters** -* `collateralType` (*address*) - The address for the collateral whose configuration is being queried. - -**Returns** -* `collateral` (*struct CollateralConfiguration.Data*) - The configuration object describing the given collateral. -#### getCollateralPrice - - ```solidity - function getCollateralPrice(address collateralType) external view returns (uint256 priceD18) - ``` - - Returns the current value of a specified collateral type. - -**Parameters** -* `collateralType` (*address*) - The address for the collateral whose price is being queried. - -**Returns** -* `priceD18` (*uint256*) - The price of the given collateral, denominated with 18 decimals of precision. - -#### CollateralConfigured - - ```solidity - event CollateralConfigured(address collateralType, struct CollateralConfiguration.Data config) - ``` - - Emitted when a collateral type’s configuration is created or updated. - -**Parameters** -* `collateralType` (*address*) - The address of the collateral type that was just configured. -* `config` (*struct CollateralConfiguration.Data*) - The object with the newly configured details. - -### Collateral Module - -#### deposit - - ```solidity - function deposit(uint128 accountId, address collateralType, uint256 tokenAmount) external - ``` - - Deposits `tokenAmount` of collateral of type `collateralType` into account `accountId`. - - Anyone can deposit into anyone's active account without restriction. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that is making the deposit. -* `collateralType` (*address*) - The address of the token to be deposited. -* `tokenAmount` (*uint256*) - The amount being deposited, denominated in the token's native decimal representation. Emits a {Deposited} event. - -#### withdraw - - ```solidity - function withdraw(uint128 accountId, address collateralType, uint256 tokenAmount) external - ``` - - Withdraws `tokenAmount` of collateral of type `collateralType` from account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that is making the withdrawal. -* `collateralType` (*address*) - The address of the token to be withdrawn. -* `tokenAmount` (*uint256*) - The amount being withdrawn, denominated in the token's native decimal representation. Requirements: - `msg.sender` must be the owner of the account, have the `ADMIN` permission, or have the `WITHDRAW` permission. Emits a {Withdrawn} event. - -#### getAccountCollateral - - ```solidity - function getAccountCollateral(uint128 accountId, address collateralType) external view returns (uint256 totalDeposited, uint256 totalAssigned, uint256 totalLocked) - ``` - - Returns the total values pertaining to account `accountId` for `collateralType`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose collateral is being queried. -* `collateralType` (*address*) - The address of the collateral type whose amount is being queried. - -**Returns** -* `totalDeposited` (*uint256*) - The total collateral deposited in the account, denominated with 18 decimals of precision. -* `totalAssigned` (*uint256*) - The amount of collateral in the account that is delegated to pools, denominated with 18 decimals of precision. -* `totalLocked` (*uint256*) - The amount of collateral in the account that cannot currently be undelegated from a pool, denominated with 18 decimals of precision. -#### getAccountAvailableCollateral - - ```solidity - function getAccountAvailableCollateral(uint128 accountId, address collateralType) external view returns (uint256 amountD18) - ``` - - Returns the amount of collateral of type `collateralType` deposited with account `accountId` that can be withdrawn or delegated to pools. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose collateral is being queried. -* `collateralType` (*address*) - The address of the collateral type whose amount is being queried. - -**Returns** -* `amountD18` (*uint256*) - The amount of collateral that is available for withdrawal or delegation, denominated with 18 decimals of precision. -#### cleanExpiredLocks - - ```solidity - function cleanExpiredLocks(uint128 accountId, address collateralType, uint256 offset, uint256 count) external returns (uint256 cleared) - ``` - - Clean expired locks from locked collateral arrays for an account/collateral type. It includes offset and items to prevent gas exhaustion. If both, offset and items, are 0 it will traverse the whole array (unlimited). - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose locks are being cleared. -* `collateralType` (*address*) - The address of the collateral type to clean locks for. -* `offset` (*uint256*) - The index of the first lock to clear. -* `count` (*uint256*) - The number of slots to check for cleaning locks. Set to 0 to clean all locks at/after offset - -**Returns** -* `cleared` (*uint256*) - the number of locks that were actually expired (and therefore cleared) -#### getLocks - - ```solidity - function getLocks(uint128 accountId, address collateralType, uint256 offset, uint256 count) external view returns (struct CollateralLock.Data[] locks) - ``` - - Get a list of locks existing in account. Lists all locks in storage, even if they are expired - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose locks we want to read -* `collateralType` (*address*) - The address of the collateral type for locks we want to read -* `offset` (*uint256*) - The index of the first lock to read -* `count` (*uint256*) - The number of slots to check for cleaning locks. Set to 0 to read all locks after offset - -#### createLock - - ```solidity - function createLock(uint128 accountId, address collateralType, uint256 amount, uint64 expireTimestamp) external - ``` - - Create a new lock on the given account. you must have `admin` permission on the specified account to create a lock. - - Collateral can be withdrawn from the system if it is not assigned or delegated to a pool. Collateral locks are an additional restriction that applies on top of that. I.e. if collateral is not assigned to a pool, but has a lock, it cannot be withdrawn. -Collateral locks are initially intended for the Synthetix v2 to v3 migration, but may be used in the future by the Spartan Council, for example, to create and hand off accounts whose withdrawals from the system are locked for a given amount of time. - -**Parameters** -* `accountId` (*uint128*) - The id of the account for which a lock is to be created. -* `collateralType` (*address*) - The address of the collateral type for which the lock will be created. -* `amount` (*uint256*) - The amount of collateral tokens to wrap in the lock being created, denominated with 18 decimals of precision. -* `expireTimestamp` (*uint64*) - The date in which the lock will become clearable. - -#### Deposited - - ```solidity - event Deposited(uint128 accountId, address collateralType, uint256 tokenAmount, address sender) - ``` - - Emitted when `tokenAmount` of collateral of type `collateralType` is deposited to account `accountId` by `sender`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that deposited collateral. -* `collateralType` (*address*) - The address of the collateral that was deposited. -* `tokenAmount` (*uint256*) - The amount of collateral that was deposited, denominated in the token's native decimal representation. -* `sender` (*address*) - The address of the account that triggered the deposit. - -#### CollateralLockCreated - - ```solidity - event CollateralLockCreated(uint128 accountId, address collateralType, uint256 tokenAmount, uint64 expireTimestamp) - ``` - - Emitted when a lock is created on someone's account - -**Parameters** -* `accountId` (*uint128*) - The id of the account that received a lock -* `collateralType` (*address*) - The address of the collateral type that was locked -* `tokenAmount` (*uint256*) - The amount of collateral that was locked, demoninated in system units (1e18) -* `expireTimestamp` (*uint64*) - unix timestamp at which the lock is due to expire - -#### CollateralLockExpired - - ```solidity - event CollateralLockExpired(uint128 accountId, address collateralType, uint256 tokenAmount, uint64 expireTimestamp) - ``` - - Emitted when a lock is cleared from an account due to expiration - -**Parameters** -* `accountId` (*uint128*) - The id of the account that has the expired lock -* `collateralType` (*address*) - The address of the collateral type that was unlocked -* `tokenAmount` (*uint256*) - The amount of collateral that was unlocked, demoninated in system units (1e18) -* `expireTimestamp` (*uint64*) - unix timestamp at which the unlock is due to expire - -#### Withdrawn - - ```solidity - event Withdrawn(uint128 accountId, address collateralType, uint256 tokenAmount, address sender) - ``` - - Emitted when `tokenAmount` of collateral of type `collateralType` is withdrawn from account `accountId` by `sender`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that withdrew collateral. -* `collateralType` (*address*) - The address of the collateral that was withdrawn. -* `tokenAmount` (*uint256*) - The amount of collateral that was withdrawn, denominated in the token's native decimal representation. -* `sender` (*address*) - The address of the account that triggered the withdrawal. - -### Cross ChainUSD Module - -#### transferCrossChain - - ```solidity - function transferCrossChain(uint64 destChainId, uint256 amount) external payable returns (uint256 gasTokenUsed) - ``` - - Allows users to transfer tokens cross-chain using CCIP. - -**Parameters** -* `destChainId` (*uint64*) - The id of the chain where tokens are to be transferred to. -* `amount` (*uint256*) - The amount of tokens to be transferred, denominated with 18 decimals of precision. - -**Returns** -* `gasTokenUsed` (*uint256*) - The amount of fees paid in the cross-chain transfer, denominated with 18 decimals of precision. - -#### TransferCrossChainInitiated - - ```solidity - event TransferCrossChainInitiated(uint64 destChainId, uint256 amount, address sender) - ``` - -### IssueUSD Module - -#### mintUsd - - ```solidity - function mintUsd(uint128 accountId, uint128 poolId, address collateralType, uint256 amount) external - ``` - - Mints {amount} of snxUSD with the specified liquidity position. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that is minting snxUSD. -* `poolId` (*uint128*) - The id of the pool whose collateral will be used to back up the mint. -* `collateralType` (*address*) - The address of the collateral that will be used to back up the mint. -* `amount` (*uint256*) - The amount of snxUSD to be minted, denominated with 18 decimals of precision. Requirements: - `msg.sender` must be the owner of the account, have the `ADMIN` permission, or have the `MINT` permission. - After minting, the collateralization ratio of the liquidity position must not be below the target collateralization ratio for the corresponding collateral type. Emits a {UsdMinted} event. - -#### burnUsd - - ```solidity - function burnUsd(uint128 accountId, uint128 poolId, address collateralType, uint256 amount) external - ``` - - Burns {amount} of snxUSD with the specified liquidity position. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that is burning snxUSD. -* `poolId` (*uint128*) - The id of the pool whose collateral was used to back up the snxUSD. -* `collateralType` (*address*) - The address of the collateral that was used to back up the snxUSD. -* `amount` (*uint256*) - The amount of snxUSD to be burnt, denominated with 18 decimals of precision. Emits a {UsdMinted} event. - -#### UsdMinted - - ```solidity - event UsdMinted(uint128 accountId, uint128 poolId, address collateralType, uint256 amount, address sender) - ``` - - Emitted when {sender} mints {amount} of snxUSD with the specified liquidity position. - -**Parameters** -* `accountId` (*uint128*) - The id of the account for which snxUSD was emitted. -* `poolId` (*uint128*) - The id of the pool whose collateral was used to emit the snxUSD. -* `collateralType` (*address*) - The address of the collateral that is backing up the emitted snxUSD. -* `amount` (*uint256*) - The amount of snxUSD emitted, denominated with 18 decimals of precision. -* `sender` (*address*) - The address that triggered the operation. - -#### UsdBurned - - ```solidity - event UsdBurned(uint128 accountId, uint128 poolId, address collateralType, uint256 amount, address sender) - ``` - - Emitted when {sender} burns {amount} of snxUSD with the specified liquidity position. - -**Parameters** -* `accountId` (*uint128*) - The id of the account for which snxUSD was burned. -* `poolId` (*uint128*) - The id of the pool whose collateral was used to emit the snxUSD. -* `collateralType` (*address*) - The address of the collateral that was backing up the emitted snxUSD. -* `amount` (*uint256*) - The amount of snxUSD burned, denominated with 18 decimals of precision. -* `sender` (*address*) - The address that triggered the operation. - -#### IssuanceFeePaid - - ```solidity - event IssuanceFeePaid(uint128 accountId, uint128 poolId, address collateralType, uint256 feeAmount) - ``` - -### Liquidation Module - -#### liquidate - - ```solidity - function liquidate(uint128 accountId, uint128 poolId, address collateralType, uint128 liquidateAsAccountId) external returns (struct ILiquidationModule.LiquidationData liquidationData) - ``` - - Liquidates a position by distributing its debt and collateral among other positions in its vault. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose position is to be liquidated. -* `poolId` (*uint128*) - The id of the pool which holds the position that is to be liquidated. -* `collateralType` (*address*) - The address of the collateral being used in the position that is to be liquidated. -* `liquidateAsAccountId` (*uint128*) - Account id that will receive the rewards from the liquidation. - -**Returns** -* `liquidationData` (*struct ILiquidationModule.LiquidationData*) - Information about the position that was liquidated. -#### liquidateVault - - ```solidity - function liquidateVault(uint128 poolId, address collateralType, uint128 liquidateAsAccountId, uint256 maxUsd) external returns (struct ILiquidationModule.LiquidationData liquidationData) - ``` - - Liquidates an entire vault. - - Can only be done if the vault itself is under collateralized. -LiquidateAsAccountId determines which account to deposit the seized collateral into (this is necessary particularly if the collateral in the vault is vesting). -Will only liquidate a portion of the debt for the vault if `maxUsd` is supplied. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose vault is being liquidated. -* `collateralType` (*address*) - The address of the collateral whose vault is being liquidated. -* `liquidateAsAccountId` (*uint128*) - -* `maxUsd` (*uint256*) - The maximum amount of USD that the liquidator is willing to provide for the liquidation, denominated with 18 decimals of precision. - -**Returns** -* `liquidationData` (*struct ILiquidationModule.LiquidationData*) - Information about the vault that was liquidated. -#### isPositionLiquidatable - - ```solidity - function isPositionLiquidatable(uint128 accountId, uint128 poolId, address collateralType) external returns (bool canLiquidate) - ``` - - Determines whether a specified position is liquidatable. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose position is being queried for liquidation. -* `poolId` (*uint128*) - The id of the pool whose position is being queried for liquidation. -* `collateralType` (*address*) - The address of the collateral backing up the position being queried for liquidation. - -**Returns** -* `canLiquidate` (*bool*) - A boolean with the response to the query. -#### isVaultLiquidatable - - ```solidity - function isVaultLiquidatable(uint128 poolId, address collateralType) external returns (bool canVaultLiquidate) - ``` - - Determines whether a specified vault is liquidatable. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that owns the vault that is being queried for liquidation. -* `collateralType` (*address*) - The address of the collateral being held at the vault that is being queried for liquidation. - -**Returns** -* `canVaultLiquidate` (*bool*) - A boolean with the response to the query. - -#### Liquidation - - ```solidity - event Liquidation(uint128 accountId, uint128 poolId, address collateralType, struct ILiquidationModule.LiquidationData liquidationData, uint128 liquidateAsAccountId, address sender) - ``` - - Emitted when an account is liquidated. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that was liquidated. -* `poolId` (*uint128*) - The pool id of the position that was liquidated. -* `collateralType` (*address*) - The collateral type used in the position that was liquidated. -* `liquidationData` (*struct ILiquidationModule.LiquidationData*) - The amount of collateral liquidated, debt liquidated, and collateral awarded to the liquidator. -* `liquidateAsAccountId` (*uint128*) - Account id that will receive the rewards from the liquidation. -* `sender` (*address*) - The address of the account that is triggering the liquidation. - -#### VaultLiquidation - - ```solidity - event VaultLiquidation(uint128 poolId, address collateralType, struct ILiquidationModule.LiquidationData liquidationData, uint128 liquidateAsAccountId, address sender) - ``` - - Emitted when a vault is liquidated. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose vault was liquidated. -* `collateralType` (*address*) - The collateral address of the vault that was liquidated. -* `liquidationData` (*struct ILiquidationModule.LiquidationData*) - The amount of collateral liquidated, debt liquidated, and collateral awarded to the liquidator. -* `liquidateAsAccountId` (*uint128*) - Account id that will receive the rewards from the liquidation. -* `sender` (*address*) - The address of the account that is triggering the liquidation. - -### Market Collateral Module - -#### depositMarketCollateral - - ```solidity - function depositMarketCollateral(uint128 marketId, address collateralType, uint256 amount) external - ``` - - Allows a market to deposit collateral. - -**Parameters** -* `marketId` (*uint128*) - The id of the market in which the collateral was directly deposited. -* `collateralType` (*address*) - The address of the collateral that was deposited in the market. -* `amount` (*uint256*) - The amount of collateral that was deposited, denominated in the token's native decimal representation. - -#### withdrawMarketCollateral - - ```solidity - function withdrawMarketCollateral(uint128 marketId, address collateralType, uint256 amount) external - ``` - - Allows a market to withdraw collateral that it has previously deposited. - -**Parameters** -* `marketId` (*uint128*) - The id of the market from which the collateral was withdrawn. -* `collateralType` (*address*) - The address of the collateral that was withdrawn from the market. -* `amount` (*uint256*) - The amount of collateral that was withdrawn, denominated in the token's native decimal representation. - -#### configureMaximumMarketCollateral - - ```solidity - function configureMaximumMarketCollateral(uint128 marketId, address collateralType, uint256 amount) external - ``` - - Allow the system owner to configure the maximum amount of a given collateral type that a specified market is allowed to deposit. - -**Parameters** -* `marketId` (*uint128*) - The id of the market for which the maximum is to be configured. -* `collateralType` (*address*) - The address of the collateral for which the maximum is to be applied. -* `amount` (*uint256*) - The amount that is to be set as the new maximum, denominated with 18 decimals of precision. - -#### getMaximumMarketCollateral - - ```solidity - function getMaximumMarketCollateral(uint128 marketId, address collateralType) external returns (uint256 amountD18) - ``` - - Return the total maximum amount of a given collateral type that a specified market is allowed to deposit. - -**Parameters** -* `marketId` (*uint128*) - The id of the market for which the maximum is being queried. -* `collateralType` (*address*) - The address of the collateral for which the maximum is being queried. - -**Returns** -* `amountD18` (*uint256*) - The maximum amount of collateral set for the market, denominated with 18 decimals of precision. -#### getMarketCollateralAmount - - ```solidity - function getMarketCollateralAmount(uint128 marketId, address collateralType) external view returns (uint256 amountD18) - ``` - - Return the total amount of a given collateral type that a specified market has deposited. - -**Parameters** -* `marketId` (*uint128*) - The id of the market for which the directly deposited collateral amount is being queried. -* `collateralType` (*address*) - The address of the collateral for which the amount is being queried. - -**Returns** -* `amountD18` (*uint256*) - The total amount of collateral of this type delegated to the market, denominated with 18 decimals of precision. -#### getMarketCollateralValue - - ```solidity - function getMarketCollateralValue(uint128 marketId) external returns (uint256 valueD18) - ``` - - Return the total value of collateral that a specified market has deposited. - -**Parameters** -* `marketId` (*uint128*) - The id of the market for which the directly deposited collateral amount is being queried. - -**Returns** -* `valueD18` (*uint256*) - The total value of collateral deposited by the market, denominated with 18 decimals of precision. - -#### MarketCollateralDeposited - - ```solidity - event MarketCollateralDeposited(uint128 marketId, address collateralType, uint256 tokenAmount, address sender) - ``` - - Emitted when `amount` of collateral of type `collateralType` is deposited to market `marketId` by `sender`. - -**Parameters** -* `marketId` (*uint128*) - The id of the market in which collateral was deposited. -* `collateralType` (*address*) - The address of the collateral that was directly deposited in the market. -* `tokenAmount` (*uint256*) - The amount of tokens that were deposited, denominated in the token's native decimal representation. -* `sender` (*address*) - The address that triggered the deposit. - -#### MarketCollateralWithdrawn - - ```solidity - event MarketCollateralWithdrawn(uint128 marketId, address collateralType, uint256 tokenAmount, address sender) - ``` - - Emitted when `amount` of collateral of type `collateralType` is withdrawn from market `marketId` by `sender`. - -**Parameters** -* `marketId` (*uint128*) - The id of the market from which collateral was withdrawn. -* `collateralType` (*address*) - The address of the collateral that was withdrawn from the market. -* `tokenAmount` (*uint256*) - The amount of tokens that were withdrawn, denominated in the token's native decimal representation. -* `sender` (*address*) - The address that triggered the withdrawal. - -#### MaximumMarketCollateralConfigured - - ```solidity - event MaximumMarketCollateralConfigured(uint128 marketId, address collateralType, uint256 systemAmount, address owner) - ``` - - Emitted when the system owner specifies the maximum depositable collateral of a given type in a given market. - -**Parameters** -* `marketId` (*uint128*) - The id of the market for which the maximum was configured. -* `collateralType` (*address*) - The address of the collateral for which the maximum was configured. -* `systemAmount` (*uint256*) - The amount to which the maximum was set, denominated with 18 decimals of precision. -* `owner` (*address*) - The owner of the system, which triggered the configuration change. - -### Market Manager Module - -#### registerMarket - - ```solidity - function registerMarket(address market) external returns (uint128 newMarketId) - ``` - - Connects an external market to the system. - - Creates a Market object to track the external market, and returns the newly created market id. - -**Parameters** -* `market` (*address*) - The address of the external market that is to be registered in the system. - -**Returns** -* `newMarketId` (*uint128*) - The id with which the market will be registered in the system. -#### depositMarketUsd - - ```solidity - function depositMarketUsd(uint128 marketId, address target, uint256 amount) external returns (uint256 feeAmount) - ``` - - Allows an external market connected to the system to deposit USD in the system. - - The system burns the incoming USD, increases the market's credit capacity, and reduces its issuance. -See `IMarket`. - -**Parameters** -* `marketId` (*uint128*) - The id of the market in which snxUSD will be deposited. -* `target` (*address*) - The address of the account on who's behalf the deposit will be made. -* `amount` (*uint256*) - The amount of snxUSD to be deposited, denominated with 18 decimals of precision. - -**Returns** -* `feeAmount` (*uint256*) - the amount of fees paid (billed as additional debt towards liquidity providers) -#### withdrawMarketUsd - - ```solidity - function withdrawMarketUsd(uint128 marketId, address target, uint256 amount) external returns (uint256 feeAmount) - ``` - - Allows an external market connected to the system to withdraw snxUSD from the system. - - The system mints the requested snxUSD (provided that the market has sufficient credit), reduces the market's credit capacity, and increases its net issuance. -See `IMarket`. - -**Parameters** -* `marketId` (*uint128*) - The id of the market from which snxUSD will be withdrawn. -* `target` (*address*) - The address of the account that will receive the withdrawn snxUSD. -* `amount` (*uint256*) - The amount of snxUSD to be withdraw, denominated with 18 decimals of precision. - -**Returns** -* `feeAmount` (*uint256*) - the amount of fees paid (billed as additional debt towards liquidity providers) -#### getMarketFees - - ```solidity - function getMarketFees(uint128 marketId, uint256 amount) external view returns (uint256 depositFeeAmount, uint256 withdrawFeeAmount) - ``` - - Get the amount of fees paid in USD for a call to `depositMarketUsd` and `withdrawMarketUsd` for the given market and amount - -**Parameters** -* `marketId` (*uint128*) - The market to check fees for -* `amount` (*uint256*) - The amount deposited or withdrawn in USD - -**Returns** -* `depositFeeAmount` (*uint256*) - the amount of USD paid for a call to `depositMarketUsd` -* `withdrawFeeAmount` (*uint256*) - the amount of USD paid for a call to `withdrawMarketUsd` -#### getWithdrawableMarketUsd - - ```solidity - function getWithdrawableMarketUsd(uint128 marketId) external view returns (uint256 withdrawableD18) - ``` - - Returns the total withdrawable snxUSD amount for the specified market. - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose withdrawable USD amount is being queried. - -**Returns** -* `withdrawableD18` (*uint256*) - The total amount of snxUSD that the market could withdraw at the time of the query, denominated with 18 decimals of precision. -#### getMarketNetIssuance - - ```solidity - function getMarketNetIssuance(uint128 marketId) external view returns (int128 issuanceD18) - ``` - - Returns the net issuance of the specified market (snxUSD withdrawn - snxUSD deposited). - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose net issuance is being queried. - -**Returns** -* `issuanceD18` (*int128*) - The net issuance of the market, denominated with 18 decimals of precision. -#### getMarketReportedDebt - - ```solidity - function getMarketReportedDebt(uint128 marketId) external view returns (uint256 reportedDebtD18) - ``` - - Returns the reported debt of the specified market. - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose reported debt is being queried. - -**Returns** -* `reportedDebtD18` (*uint256*) - The market's reported debt, denominated with 18 decimals of precision. -#### getMarketTotalDebt - - ```solidity - function getMarketTotalDebt(uint128 marketId) external view returns (int256 totalDebtD18) - ``` - - Returns the total debt of the specified market. - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose debt is being queried. - -**Returns** -* `totalDebtD18` (*int256*) - The total debt of the market, denominated with 18 decimals of precision. -#### getMarketCollateral - - ```solidity - function getMarketCollateral(uint128 marketId) external view returns (uint256 valueD18) - ``` - - Returns the total snxUSD value of the collateral for the specified market. - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose collateral is being queried. - -**Returns** -* `valueD18` (*uint256*) - The market's total snxUSD value of collateral, denominated with 18 decimals of precision. -#### getMarketDebtPerShare - - ```solidity - function getMarketDebtPerShare(uint128 marketId) external returns (int256 debtPerShareD18) - ``` - - Returns the value per share of the debt of the specified market. - - This is not a view function, and actually updates the entire debt distribution chain. - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose debt per share is being queried. - -**Returns** -* `debtPerShareD18` (*int256*) - The market's debt per share value, denominated with 18 decimals of precision. -#### isMarketCapacityLocked - - ```solidity - function isMarketCapacityLocked(uint128 marketId) external view returns (bool isLocked) - ``` - - Returns whether the capacity of the specified market is locked. - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose capacity is being queried. - -**Returns** -* `isLocked` (*bool*) - A boolean that is true if the market's capacity is locked at the time of the query. -#### getUsdToken - - ```solidity - function getUsdToken() external view returns (contract IERC20) - ``` - - Returns the USD token associated with this synthetix core system - -#### getOracleManager - - ```solidity - function getOracleManager() external view returns (contract IOracleManager) - ``` - - Retrieve the systems' configured oracle manager address - -#### distributeDebtToPools - - ```solidity - function distributeDebtToPools(uint128 marketId, uint256 maxIter) external returns (bool finishedDistributing) - ``` - - Update a market's current debt registration with the system. -This function is provided as an escape hatch for pool griefing, preventing -overwhelming the system with a series of very small pools and creating high gas -costs to update an account. - -**Parameters** -* `marketId` (*uint128*) - the id of the market that needs pools bumped -* `maxIter` (*uint256*) - - -**Returns** -* `finishedDistributing` (*bool*) - whether or not all bumpable pools have been bumped and target price has been reached -#### setMarketMinDelegateTime - - ```solidity - function setMarketMinDelegateTime(uint128 marketId, uint32 minDelegateTime) external - ``` - - allows for a market to set its minimum delegation time. This is useful for preventing stakers from frontrunning rewards or losses -by limiting the frequency of `delegateCollateral` (or `setPoolConfiguration`) calls. By default, there is no minimum delegation time. - -**Parameters** -* `marketId` (*uint128*) - the id of the market that wants to set delegation time. -* `minDelegateTime` (*uint32*) - the minimum number of seconds between delegation calls. Note: this value must be less than the globally defined maximum minDelegateTime - -#### getMarketMinDelegateTime - - ```solidity - function getMarketMinDelegateTime(uint128 marketId) external view returns (uint32) - ``` - - Retrieve the minimum delegation time of a market - -**Parameters** -* `marketId` (*uint128*) - the id of the market - -#### setMinLiquidityRatio - - ```solidity - function setMinLiquidityRatio(uint128 marketId, uint256 minLiquidityRatio) external - ``` - - Allows the system owner (not the pool owner) to set a market-specific minimum liquidity ratio. - -**Parameters** -* `marketId` (*uint128*) - the id of the market -* `minLiquidityRatio` (*uint256*) - The new market-specific minimum liquidity ratio, denominated with 18 decimals of precision. (100% is represented by 1 followed by 18 zeros.) - -#### getMinLiquidityRatio - - ```solidity - function getMinLiquidityRatio(uint128 marketId) external view returns (uint256 minRatioD18) - ``` - - Retrieves the market-specific minimum liquidity ratio. - -**Parameters** -* `marketId` (*uint128*) - the id of the market - -**Returns** -* `minRatioD18` (*uint256*) - The current market-specific minimum liquidity ratio, denominated with 18 decimals of precision. (100% is represented by 1 followed by 18 zeros.) -#### getMarketPools - - ```solidity - function getMarketPools(uint128 marketId) external returns (uint128[] inRangePoolIds, uint128[] outRangePoolIds) - ``` - -#### getMarketPoolDebtDistribution - - ```solidity - function getMarketPoolDebtDistribution(uint128 marketId, uint128 poolId) external returns (uint256 sharesD18, uint128 totalSharesD18, int128 valuePerShareD27) - ``` - -#### MarketRegistered - - ```solidity - event MarketRegistered(address market, uint128 marketId, address sender) - ``` - - Emitted when a new market is registered in the system. - -**Parameters** -* `market` (*address*) - The address of the external market that was registered in the system. -* `marketId` (*uint128*) - The id with which the market was registered in the system. -* `sender` (*address*) - The account that trigger the registration of the market. - -#### MarketUsdDeposited - - ```solidity - event MarketUsdDeposited(uint128 marketId, address target, uint256 amount, address market) - ``` - - Emitted when a market deposits snxUSD in the system. - -**Parameters** -* `marketId` (*uint128*) - The id of the market that deposited snxUSD in the system. -* `target` (*address*) - The address of the account that provided the snxUSD in the deposit. -* `amount` (*uint256*) - The amount of snxUSD deposited in the system, denominated with 18 decimals of precision. -* `market` (*address*) - The address of the external market that is depositing. - -#### MarketUsdWithdrawn - - ```solidity - event MarketUsdWithdrawn(uint128 marketId, address target, uint256 amount, address market) - ``` - - Emitted when a market withdraws snxUSD from the system. - -**Parameters** -* `marketId` (*uint128*) - The id of the market that withdrew snxUSD from the system. -* `target` (*address*) - The address of the account that received the snxUSD in the withdrawal. -* `amount` (*uint256*) - The amount of snxUSD withdrawn from the system, denominated with 18 decimals of precision. -* `market` (*address*) - The address of the external market that is withdrawing. - -#### MarketSystemFeePaid - - ```solidity - event MarketSystemFeePaid(uint128 marketId, uint256 feeAmount) - ``` - -#### SetMinDelegateTime - - ```solidity - event SetMinDelegateTime(uint128 marketId, uint32 minDelegateTime) - ``` - - Emitted when a market sets an updated minimum delegation time - -**Parameters** -* `marketId` (*uint128*) - The id of the market that the setting is applied to -* `minDelegateTime` (*uint32*) - The minimum amount of time between delegation changes - -#### SetMarketMinLiquidityRatio - - ```solidity - event SetMarketMinLiquidityRatio(uint128 marketId, uint256 minLiquidityRatio) - ``` - - Emitted when a market-specific minimum liquidity ratio is set - -**Parameters** -* `marketId` (*uint128*) - The id of the market that the setting is applied to -* `minLiquidityRatio` (*uint256*) - The new market-specific minimum liquidity ratio - -### Multicall Module - -#### multicall - - ```solidity - function multicall(bytes[] data) external payable returns (bytes[] results) - ``` - - Executes multiple transaction payloads in a single transaction. - - Each transaction is executed using `delegatecall`, and targets the system address. - -**Parameters** -* `data` (*bytes[]*) - Array of calldata objects, one for each function that is to be called in the system. - -**Returns** -* `results` (*bytes[]*) - Array of each `delegatecall`'s response corresponding to the incoming calldata array. - -### Pool Configuration Module - -#### setPreferredPool - - ```solidity - function setPreferredPool(uint128 poolId) external - ``` - - Sets the unique system preferred pool. - - Note: The preferred pool does not receive any special treatment. It is only signaled as preferred here. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that is to be set as preferred. - -#### addApprovedPool - - ```solidity - function addApprovedPool(uint128 poolId) external - ``` - - Marks a pool as approved by the system owner. - - Approved pools do not receive any special treatment. They are only signaled as approved here. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that is to be approved. - -#### removeApprovedPool - - ```solidity - function removeApprovedPool(uint128 poolId) external - ``` - - Un-marks a pool as preferred by the system owner. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that is to be no longer approved. - -#### getPreferredPool - - ```solidity - function getPreferredPool() external view returns (uint128 poolId) - ``` - - Retrieves the unique system preferred pool. - -**Returns** -* `poolId` (*uint128*) - The id of the pool that is currently set as preferred in the system. -#### getApprovedPools - - ```solidity - function getApprovedPools() external view returns (uint256[] poolIds) - ``` - - Retrieves the pool that are approved by the system owner. - -**Returns** -* `poolIds` (*uint256[]*) - An array with all of the pool ids that are approved in the system. - -#### PreferredPoolSet - - ```solidity - event PreferredPoolSet(uint256 poolId) - ``` - - Emitted when the system owner sets the preferred pool. - -**Parameters** -* `poolId` (*uint256*) - The id of the pool that was set as preferred. - -#### PoolApprovedAdded - - ```solidity - event PoolApprovedAdded(uint256 poolId) - ``` - - Emitted when the system owner adds an approved pool. - -**Parameters** -* `poolId` (*uint256*) - The id of the pool that was approved. - -#### PoolApprovedRemoved - - ```solidity - event PoolApprovedRemoved(uint256 poolId) - ``` - - Emitted when the system owner removes an approved pool. - -**Parameters** -* `poolId` (*uint256*) - The id of the pool that is no longer approved. - -### Pool Module - -#### createPool - - ```solidity - function createPool(uint128 requestedPoolId, address owner) external - ``` - - Creates a pool with the requested pool id. - -**Parameters** -* `requestedPoolId` (*uint128*) - The requested id for the new pool. Reverts if the id is not available. -* `owner` (*address*) - The address that will own the newly created pool. - -#### setPoolConfiguration - - ```solidity - function setPoolConfiguration(uint128 poolId, struct MarketConfiguration.Data[] marketDistribution) external - ``` - - Allows the pool owner to configure the pool. - - The pool's configuration is composed of an array of MarketConfiguration objects, which describe which markets the pool provides liquidity to, in what proportion, and to what extent. -Incoming market ids need to be provided in ascending order. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose configuration is being set. -* `marketDistribution` (*struct MarketConfiguration.Data[]*) - The array of market configuration objects that define the list of markets that are connected to the system. - -#### getPoolConfiguration - - ```solidity - function getPoolConfiguration(uint128 poolId) external view returns (struct MarketConfiguration.Data[] markets) - ``` - - Retrieves the MarketConfiguration of the specified pool. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose configuration is being queried. - -**Returns** -* `markets` (*struct MarketConfiguration.Data[]*) - The array of MarketConfiguration objects that describe the pool's configuration. -#### setPoolName - - ```solidity - function setPoolName(uint128 poolId, string name) external - ``` - - Allows the owner of the pool to set the pool's name. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose name is being set. -* `name` (*string*) - The new name to give to the pool. - -#### getPoolName - - ```solidity - function getPoolName(uint128 poolId) external view returns (string poolName) - ``` - - Returns the pool's name. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose name is being queried. - -**Returns** -* `poolName` (*string*) - The current name of the pool. -#### nominatePoolOwner - - ```solidity - function nominatePoolOwner(address nominatedOwner, uint128 poolId) external - ``` - - Allows the current pool owner to nominate a new owner. - -**Parameters** -* `nominatedOwner` (*address*) - The address to nominate os the new pool owner. -* `poolId` (*uint128*) - The id whose ownership is being transferred. - -#### acceptPoolOwnership - - ```solidity - function acceptPoolOwnership(uint128 poolId) external - ``` - - After a new pool owner has been nominated, allows it to accept the nomination and thus ownership of the pool. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool for which the caller is to accept ownership. - -#### revokePoolNomination - - ```solidity - function revokePoolNomination(uint128 poolId) external - ``` - - After a new pool owner has been nominated, allows it to reject the nomination. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool for which the new owner nomination is to be revoked. - -#### renouncePoolNomination - - ```solidity - function renouncePoolNomination(uint128 poolId) external - ``` - - Allows the current nominated owner to renounce the nomination. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool for which the caller is renouncing ownership nomination. - -#### getPoolOwner - - ```solidity - function getPoolOwner(uint128 poolId) external view returns (address owner) - ``` - - Returns the current pool owner. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose ownership is being queried. - -**Returns** -* `owner` (*address*) - The current owner of the pool. -#### getNominatedPoolOwner - - ```solidity - function getNominatedPoolOwner(uint128 poolId) external view returns (address nominatedOwner) - ``` - - Returns the current nominated pool owner. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose nominated owner is being queried. - -**Returns** -* `nominatedOwner` (*address*) - The current nominated owner of the pool. -#### setMinLiquidityRatio - - ```solidity - function setMinLiquidityRatio(uint256 minLiquidityRatio) external - ``` - - Allows the system owner (not the pool owner) to set the system-wide minimum liquidity ratio. - -**Parameters** -* `minLiquidityRatio` (*uint256*) - The new system-wide minimum liquidity ratio, denominated with 18 decimals of precision. (100% is represented by 1 followed by 18 zeros.) - -#### getMinLiquidityRatio - - ```solidity - function getMinLiquidityRatio() external view returns (uint256 minRatioD18) - ``` - - Retrieves the system-wide minimum liquidity ratio. - -**Returns** -* `minRatioD18` (*uint256*) - The current system-wide minimum liquidity ratio, denominated with 18 decimals of precision. (100% is represented by 1 followed by 18 zeros.) -#### rebalancePool - - ```solidity - function rebalancePool(uint128 poolId, address optionalCollateralType) external - ``` - - Distributes cached debt in a pool to its vaults and updates market credit capacities. - -**Parameters** -* `poolId` (*uint128*) - the pool to rebalance -* `optionalCollateralType` (*address*) - in addition to rebalancing the pool, calculate updated collaterals and debts for the specified vault - -#### PoolCreated - - ```solidity - event PoolCreated(uint128 poolId, address owner, address sender) - ``` - - Gets fired when pool will be created. - -**Parameters** -* `poolId` (*uint128*) - The id of the newly created pool. -* `owner` (*address*) - The owner of the newly created pool. -* `sender` (*address*) - The address that triggered the creation of the pool. - -#### PoolOwnerNominated - - ```solidity - event PoolOwnerNominated(uint128 poolId, address nominatedOwner, address owner) - ``` - - Gets fired when pool owner proposes a new owner. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool for which the nomination ocurred. -* `nominatedOwner` (*address*) - The address that was nominated as the new owner of the pool. -* `owner` (*address*) - The address of the current owner of the pool. - -#### PoolOwnershipAccepted - - ```solidity - event PoolOwnershipAccepted(uint128 poolId, address owner) - ``` - - Gets fired when pool nominee accepts nomination. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool for which the owner nomination was accepted. -* `owner` (*address*) - The address of the new owner of the pool, which accepted the nomination. - -#### PoolNominationRevoked - - ```solidity - event PoolNominationRevoked(uint128 poolId, address owner) - ``` - - Gets fired when pool owner revokes nomination. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool in which the nomination was revoked. -* `owner` (*address*) - The current owner of the pool. - -#### PoolNominationRenounced - - ```solidity - event PoolNominationRenounced(uint128 poolId, address owner) - ``` - - Gets fired when pool nominee renounces nomination. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool for which the owner nomination was renounced. -* `owner` (*address*) - The current owner of the pool. - -#### PoolNameUpdated - - ```solidity - event PoolNameUpdated(uint128 poolId, string name, address sender) - ``` - - Gets fired when pool name changes. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose name was updated. -* `name` (*string*) - The new name of the pool. -* `sender` (*address*) - The address that triggered the rename of the pool. - -#### PoolConfigurationSet - - ```solidity - event PoolConfigurationSet(uint128 poolId, struct MarketConfiguration.Data[] markets, address sender) - ``` - - Gets fired when pool gets configured. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose configuration was set. -* `markets` (*struct MarketConfiguration.Data[]*) - Array of configuration data of the markets that were connected to the pool. -* `sender` (*address*) - The address that triggered the pool configuration. - -#### SetMinLiquidityRatio - - ```solidity - event SetMinLiquidityRatio(uint256 minLiquidityRatio) - ``` - - Emitted when a system-wide minimum liquidity ratio is set - -**Parameters** -* `minLiquidityRatio` (*uint256*) - The new system-wide minimum liquidity ratio - -### Rewards Manager Module - -#### registerRewardsDistributor - - ```solidity - function registerRewardsDistributor(uint128 poolId, address collateralType, address distributor) external - ``` - - Called by pool owner to register rewards for vault participants. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose rewards are to be managed by the specified distributor. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the reward distributor to be registered. - -#### removeRewardsDistributor - - ```solidity - function removeRewardsDistributor(uint128 poolId, address collateralType, address distributor) external - ``` - - Called by pool owner to remove a registered rewards distributor for vault participants. -WARNING: if you remove a rewards distributor, the same address can never be re-registered again. If you -simply want to turn off -rewards, call `distributeRewards` with 0 emission. If you need to completely reset the rewards distributor -again, create a new rewards distributor at a new address and register the new one. -This function is provided since the number of rewards distributors added to an account is finite, -so you can remove an unused rewards distributor if need be. -NOTE: unclaimed rewards can still be claimed after a rewards distributor is removed (though any -rewards-over-time will be halted) - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose rewards are to be managed by the specified distributor. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the reward distributor to be registered. - -#### distributeRewards - - ```solidity - function distributeRewards(uint128 poolId, address collateralType, uint256 amount, uint64 start, uint32 duration) external - ``` - - Called by a registered distributor to set up rewards for vault participants. - - Will revert if the caller is not a registered distributor. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool to distribute rewards to. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `amount` (*uint256*) - The amount of rewards to be distributed. -* `start` (*uint64*) - The date at which the rewards will begin to be claimable. -* `duration` (*uint32*) - The period after which all distributed rewards will be claimable. - -#### claimRewards - - ```solidity - function claimRewards(uint128 accountId, uint128 poolId, address collateralType, address distributor) external returns (uint256 amountClaimedD18) - ``` - - Allows a user with appropriate permissions to claim rewards associated with a position. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that is to claim the rewards. -* `poolId` (*uint128*) - The id of the pool to claim rewards on. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the rewards distributor associated with the rewards being claimed. - -**Returns** -* `amountClaimedD18` (*uint256*) - The amount of rewards that were available for the account and thus claimed. -#### updateRewards - - ```solidity - function updateRewards(uint128 poolId, address collateralType, uint128 accountId) external returns (uint256[] claimableD18, address[] distributors) - ``` - - For a given position, return the rewards that can currently be claimed. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool being queried. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `accountId` (*uint128*) - The id of the account whose available rewards are being queried. - -**Returns** -* `claimableD18` (*uint256[]*) - An array of ids of the reward entries that are claimable by the position. -* `distributors` (*address[]*) - An array with the addresses of the reward distributors associated with the claimable rewards. -#### getRewardRate - - ```solidity - function getRewardRate(uint128 poolId, address collateralType, address distributor) external view returns (uint256 rateD18) - ``` - - Returns the number of individual units of amount emitted per second per share for the given poolId, collateralType, distributor vault. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool being queried. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the rewards distributor associated with the rewards in question. - -**Returns** -* `rateD18` (*uint256*) - The queried rewards rate. - -#### RewardsDistributed - - ```solidity - event RewardsDistributed(uint128 poolId, address collateralType, address distributor, uint256 amount, uint256 start, uint256 duration) - ``` - - Emitted when the pool owner or an existing reward distributor sets up rewards for vault participants. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool on which rewards were distributed. -* `collateralType` (*address*) - The collateral type of the pool on which rewards were distributed. -* `distributor` (*address*) - The reward distributor associated to the rewards that were distributed. -* `amount` (*uint256*) - The amount of rewards that were distributed. -* `start` (*uint256*) - The date one which the rewards will begin to be claimable. -* `duration` (*uint256*) - The time in which all of the distributed rewards will be claimable. - -#### RewardsClaimed - - ```solidity - event RewardsClaimed(uint128 accountId, uint128 poolId, address collateralType, address distributor, uint256 amount) - ``` - - Emitted when a vault participant claims rewards. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that claimed the rewards. -* `poolId` (*uint128*) - The id of the pool where the rewards were claimed. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the rewards distributor associated with these rewards. -* `amount` (*uint256*) - The amount of rewards that were claimed. - -#### RewardsDistributorRegistered - - ```solidity - event RewardsDistributorRegistered(uint128 poolId, address collateralType, address distributor) - ``` - - Emitted when a new rewards distributor is registered. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose reward distributor was registered. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the newly registered reward distributor. - -#### RewardsDistributorRemoved - - ```solidity - event RewardsDistributorRemoved(uint128 poolId, address collateralType, address distributor) - ``` - - Emitted when an already registered rewards distributor is removed. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose reward distributor was registered. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the registered reward distributor. - -### USD Token Module - -#### burnWithAllowance - - ```solidity - function burnWithAllowance(address from, address spender, uint256 amount) external - ``` - - Allows the core system to burn snxUSD held by the `from` address, provided that it has given allowance to `spender`. - -**Parameters** -* `from` (*address*) - The address that holds the snxUSD to be burned. -* `spender` (*address*) - The address to which the holder has given allowance to. -* `amount` (*uint256*) - The amount of snxUSD to be burned, denominated with 18 decimals of precision. - -#### burn - - ```solidity - function burn(uint256 amount) external - ``` - - Destroys `amount` of snxUSD tokens from the caller. This is derived from ERC20Burnable.sol and is currently included for testing purposes with CCIP token pools. - -**Parameters** -* `amount` (*uint256*) - The amount of snxUSD to be burned, denominated with 18 decimals of precision. - -#### isInitialized - - ```solidity - function isInitialized() external returns (bool) - ``` - - Returns wether the token has been initialized. - -**Returns** -* `[0]` (*bool*) - A boolean with the result of the query. -#### initialize - - ```solidity - function initialize(string tokenName, string tokenSymbol, uint8 tokenDecimals) external - ``` - - Initializes the token with name, symbol, and decimals. - -#### mint - - ```solidity - function mint(address to, uint256 amount) external - ``` - - Allows the owner to mint tokens. - -**Parameters** -* `to` (*address*) - The address to receive the newly minted tokens. -* `amount` (*uint256*) - The amount of tokens to mint. - -#### burn - - ```solidity - function burn(address from, uint256 amount) external - ``` - - Allows the owner to burn tokens. - -**Parameters** -* `from` (*address*) - The address whose tokens will be burnt. -* `amount` (*uint256*) - The amount of tokens to burn. - -#### setAllowance - - ```solidity - function setAllowance(address from, address spender, uint256 amount) external - ``` - - Allows an address that holds tokens to provide allowance to another. - -**Parameters** -* `from` (*address*) - The address that is providing allowance. -* `spender` (*address*) - The address that is given allowance. -* `amount` (*uint256*) - The amount of allowance being given. - -#### name - - ```solidity - function name() external view returns (string) - ``` - - Retrieves the name of the token, e.g. "Synthetix Network Token". - -**Returns** -* `[0]` (*string*) - A string with the name of the token. -#### symbol - - ```solidity - function symbol() external view returns (string) - ``` - - Retrieves the symbol of the token, e.g. "SNX". - -**Returns** -* `[0]` (*string*) - A string with the symbol of the token. -#### decimals - - ```solidity - function decimals() external view returns (uint8) - ``` - - Retrieves the number of decimals used by the token. The default is 18. - -**Returns** -* `[0]` (*uint8*) - The number of decimals. -#### totalSupply - - ```solidity - function totalSupply() external view returns (uint256) - ``` - - Returns the total number of tokens in circulation (minted - burnt). - -**Returns** -* `[0]` (*uint256*) - The total number of tokens. -#### balanceOf - - ```solidity - function balanceOf(address owner) external view returns (uint256) - ``` - - Returns the balance of a user. - -**Parameters** -* `owner` (*address*) - The address whose balance is being retrieved. - -**Returns** -* `[0]` (*uint256*) - The number of tokens owned by the user. -#### allowance - - ```solidity - function allowance(address owner, address spender) external view returns (uint256) - ``` - - Returns how many tokens a user has allowed another user to transfer on its behalf. - -**Parameters** -* `owner` (*address*) - The user who has given the allowance. -* `spender` (*address*) - The user who was given the allowance. - -**Returns** -* `[0]` (*uint256*) - The amount of tokens `spender` can transfer on `owner`'s behalf. -#### transfer - - ```solidity - function transfer(address to, uint256 amount) external returns (bool) - ``` - - Transfer tokens from one address to another. - -**Parameters** -* `to` (*address*) - The address that will receive the tokens. -* `amount` (*uint256*) - The amount of tokens to be transferred. - -**Returns** -* `[0]` (*bool*) - A boolean which is true if the operation succeeded. -#### approve - - ```solidity - function approve(address spender, uint256 amount) external returns (bool) - ``` - - Allows users to provide allowance to other users so that they can transfer tokens on their behalf. - -**Parameters** -* `spender` (*address*) - The address that is receiving the allowance. -* `amount` (*uint256*) - The amount of tokens that are being added to the allowance. - -**Returns** -* `[0]` (*bool*) - A boolean which is true if the operation succeeded. -#### increaseAllowance - - ```solidity - function increaseAllowance(address spender, uint256 addedValue) external returns (bool) - ``` - - Atomically increases the allowance granted to `spender` by the caller. - -This is an alternative to {approve} that can be used as a mitigation for -problems described in {IERC20-approve}. - -Emits an {Approval} event indicating the updated allowance. - -Requirements: - -- `spender` cannot be the zero address. - -#### decreaseAllowance - - ```solidity - function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) - ``` - - Atomically decreases the allowance granted to `spender` by the caller. - -This is an alternative to {approve} that can be used as a mitigation for -problems described in {IERC20-approve}. - -Emits an {Approval} event indicating the updated allowance. - -Requirements: - -- `spender` cannot be the zero address. -- `spender` must have allowance for the caller of at least -`subtractedValue`. - -#### transferFrom - - ```solidity - function transferFrom(address from, address to, uint256 amount) external returns (bool) - ``` - - Allows a user who has been given allowance to transfer tokens on another user's behalf. - -**Parameters** -* `from` (*address*) - The address that owns the tokens that are being transferred. -* `to` (*address*) - The address that will receive the tokens. -* `amount` (*uint256*) - The number of tokens to transfer. - -**Returns** -* `[0]` (*bool*) - A boolean which is true if the operation succeeded. - -#### Transfer - - ```solidity - event Transfer(address from, address to, uint256 amount) - ``` - - Emitted when tokens have been transferred. - -**Parameters** -* `from` (*address*) - The address that originally owned the tokens. -* `to` (*address*) - The address that received the tokens. -* `amount` (*uint256*) - The number of tokens that were transferred. - -#### Approval - - ```solidity - event Approval(address owner, address spender, uint256 amount) - ``` - - Emitted when a user has provided allowance to another user for transferring tokens on its behalf. - -**Parameters** -* `owner` (*address*) - The address that is providing the allowance. -* `spender` (*address*) - The address that received the allowance. -* `amount` (*uint256*) - The number of tokens that were added to `spender`'s allowance. - -### Vault Module - -#### delegateCollateral - - ```solidity - function delegateCollateral(uint128 accountId, uint128 poolId, address collateralType, uint256 amount, uint256 leverage) external - ``` - - Updates an account's delegated collateral amount for the specified pool and collateral type pair. - -**Parameters** -* `accountId` (*uint128*) - The id of the account associated with the position that will be updated. -* `poolId` (*uint128*) - The id of the pool associated with the position. -* `collateralType` (*address*) - The address of the collateral used in the position. -* `amount` (*uint256*) - The new amount of collateral delegated in the position, denominated with 18 decimals of precision. -* `leverage` (*uint256*) - The new leverage amount used in the position, denominated with 18 decimals of precision. Requirements: - `msg.sender` must be the owner of the account, have the `ADMIN` permission, or have the `DELEGATE` permission. - If increasing the amount delegated, it must not exceed the available collateral (`getAccountAvailableCollateral`) associated with the account. - If decreasing the amount delegated, the liquidity position must have a collateralization ratio greater than the target collateralization ratio for the corresponding collateral type. Emits a {DelegationUpdated} event. - -#### getPositionCollateralRatio - - ```solidity - function getPositionCollateralRatio(uint128 accountId, uint128 poolId, address collateralType) external returns (uint256 ratioD18) - ``` - - Returns the collateralization ratio of the specified liquidity position. If debt is negative, this function will return 0. - - Call this function using `callStatic` to treat it as a view function. -The return value is a percentage with 18 decimals places. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose collateralization ratio is being queried. -* `poolId` (*uint128*) - The id of the pool in which the account's position is held. -* `collateralType` (*address*) - The address of the collateral used in the queried position. - -**Returns** -* `ratioD18` (*uint256*) - The collateralization ratio of the position (collateral / debt), denominated with 18 decimals of precision. -#### getPositionDebt - - ```solidity - function getPositionDebt(uint128 accountId, uint128 poolId, address collateralType) external returns (int256 debtD18) - ``` - - Returns the debt of the specified liquidity position. Credit is expressed as negative debt. - - This is not a view function, and actually updates the entire debt distribution chain. -Call this function using `callStatic` to treat it as a view function. - -**Parameters** -* `accountId` (*uint128*) - The id of the account being queried. -* `poolId` (*uint128*) - The id of the pool in which the account's position is held. -* `collateralType` (*address*) - The address of the collateral used in the queried position. - -**Returns** -* `debtD18` (*int256*) - The amount of debt held by the position, denominated with 18 decimals of precision. -#### getPositionCollateral - - ```solidity - function getPositionCollateral(uint128 accountId, uint128 poolId, address collateralType) external view returns (uint256 collateralAmountD18, uint256 collateralValueD18) - ``` - - Returns the amount and value of the collateral associated with the specified liquidity position. - - Call this function using `callStatic` to treat it as a view function. -collateralAmount is represented as an integer with 18 decimals. -collateralValue is represented as an integer with the number of decimals specified by the collateralType. - -**Parameters** -* `accountId` (*uint128*) - The id of the account being queried. -* `poolId` (*uint128*) - The id of the pool in which the account's position is held. -* `collateralType` (*address*) - The address of the collateral used in the queried position. - -**Returns** -* `collateralAmountD18` (*uint256*) - The amount of collateral used in the position, denominated with 18 decimals of precision. -* `collateralValueD18` (*uint256*) - The value of collateral used in the position, denominated with 18 decimals of precision. -#### getPosition - - ```solidity - function getPosition(uint128 accountId, uint128 poolId, address collateralType) external returns (uint256 collateralAmountD18, uint256 collateralValueD18, int256 debtD18, uint256 collateralizationRatioD18) - ``` - - Returns all information pertaining to a specified liquidity position in the vault module. - -**Parameters** -* `accountId` (*uint128*) - The id of the account being queried. -* `poolId` (*uint128*) - The id of the pool in which the account's position is held. -* `collateralType` (*address*) - The address of the collateral used in the queried position. - -**Returns** -* `collateralAmountD18` (*uint256*) - The amount of collateral used in the position, denominated with 18 decimals of precision. -* `collateralValueD18` (*uint256*) - The value of the collateral used in the position, denominated with 18 decimals of precision. -* `debtD18` (*int256*) - The amount of debt held in the position, denominated with 18 decimals of precision. -* `collateralizationRatioD18` (*uint256*) - The collateralization ratio of the position (collateral / debt), denominated with 18 decimals of precision. -#### getVaultDebt - - ```solidity - function getVaultDebt(uint128 poolId, address collateralType) external returns (int256 debtD18) - ``` - - Returns the total debt (or credit) that the vault is responsible for. Credit is expressed as negative debt. - - This is not a view function, and actually updates the entire debt distribution chain. -Call this function using `callStatic` to treat it as a view function. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that owns the vault whose debt is being queried. -* `collateralType` (*address*) - The address of the collateral of the associated vault. - -**Returns** -* `debtD18` (*int256*) - The overall debt of the vault, denominated with 18 decimals of precision. -#### getVaultCollateral - - ```solidity - function getVaultCollateral(uint128 poolId, address collateralType) external returns (uint256 collateralAmountD18, uint256 collateralValueD18) - ``` - - Returns the amount and value of the collateral held by the vault. - - Call this function using `callStatic` to treat it as a view function. -collateralAmount is represented as an integer with 18 decimals. -collateralValue is represented as an integer with the number of decimals specified by the collateralType. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that owns the vault whose collateral is being queried. -* `collateralType` (*address*) - The address of the collateral of the associated vault. - -**Returns** -* `collateralAmountD18` (*uint256*) - The collateral amount of the vault, denominated with 18 decimals of precision. -* `collateralValueD18` (*uint256*) - The collateral value of the vault, denominated with 18 decimals of precision. -#### getVaultCollateralRatio - - ```solidity - function getVaultCollateralRatio(uint128 poolId, address collateralType) external returns (uint256 ratioD18) - ``` - - Returns the collateralization ratio of the vault. If debt is negative, this function will return 0. - - Call this function using `callStatic` to treat it as a view function. -The return value is a percentage with 18 decimals places. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that owns the vault whose collateralization ratio is being queried. -* `collateralType` (*address*) - The address of the collateral of the associated vault. - -**Returns** -* `ratioD18` (*uint256*) - The collateralization ratio of the vault, denominated with 18 decimals of precision. - -#### DelegationUpdated - - ```solidity - event DelegationUpdated(uint128 accountId, uint128 poolId, address collateralType, uint256 amount, uint256 leverage, address sender) - ``` - - Emitted when {sender} updates the delegation of collateral in the specified liquidity position. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose position was updated. -* `poolId` (*uint128*) - The id of the pool in which the position was updated. -* `collateralType` (*address*) - The address of the collateral associated to the position. -* `amount` (*uint256*) - The new amount of the position, denominated with 18 decimals of precision. -* `leverage` (*uint256*) - The new leverage value of the position, denominated with 18 decimals of precision. -* `sender` (*address*) - The address that triggered the update of the position. - -## Spot Market - -- [Back to TOC](#smart-contracts) - -### Async Order Configuration Module - -#### addSettlementStrategy - - ```solidity - function addSettlementStrategy(uint128 synthMarketId, struct SettlementStrategy.Data strategy) external returns (uint256 strategyId) - ``` - - Adds new settlement strategy to the specified market id. - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market to associate the strategy with. -* `strategy` (*struct SettlementStrategy.Data*) - Settlement strategy data. see SettlementStrategy.Data struct. - -**Returns** -* `strategyId` (*uint256*) - newly created settlement strategy id. -#### setSettlementStrategyEnabled - - ```solidity - function setSettlementStrategyEnabled(uint128 synthMarketId, uint256 strategyId, bool enabled) external - ``` - - Sets the strategy to enabled or disabled. - - when disabled, the strategy will be invalid for committing of new async orders. - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market associated with the strategy. -* `strategyId` (*uint256*) - id of the strategy. -* `enabled` (*bool*) - set enabled/disabled. - -#### getSettlementStrategy - - ```solidity - function getSettlementStrategy(uint128 marketId, uint256 strategyId) external view returns (struct SettlementStrategy.Data settlementStrategy) - ``` - - Returns the settlement strategy data for given market/strategy id. - -**Parameters** -* `marketId` (*uint128*) - Id of the market associated with the strategy. -* `strategyId` (*uint256*) - id of the strategy. - -**Returns** -* `settlementStrategy` (*struct SettlementStrategy.Data*) - - -#### SettlementStrategyAdded - - ```solidity - event SettlementStrategyAdded(uint128 synthMarketId, uint256 strategyId) - ``` - - Gets fired when new settlement strategy is added. - -**Parameters** -* `synthMarketId` (*uint128*) - adds settlement strategy to this specific market. -* `strategyId` (*uint256*) - the newly created settlement strategy id. - -#### SettlementStrategyUpdated - - ```solidity - event SettlementStrategyUpdated(uint128 synthMarketId, uint256 strategyId, bool enabled) - ``` - - Gets fired when settlement strategy is enabled/disabled. - - currently only enabled/disabled flag can be updated. - -**Parameters** -* `synthMarketId` (*uint128*) - adds settlement strategy to this specific market. -* `strategyId` (*uint256*) - id of the strategy. -* `enabled` (*bool*) - true/false. - -### Async Order Module - -#### commitOrder - - ```solidity - function commitOrder(uint128 marketId, enum Transaction.Type orderType, uint256 amountProvided, uint256 settlementStrategyId, uint256 minimumSettlementAmount, address referrer) external returns (struct AsyncOrderClaim.Data asyncOrderClaim) - ``` - - Commit an async order via this function - - commitment transfers the amountProvided into the contract and escrows the funds until settlement. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `orderType` (*enum Transaction.Type*) - Should send either 2 or 3 which correlates to the transaction type enum defined in Transaction.Type. -* `amountProvided` (*uint256*) - amount of value provided by the user for trade. Should have enough allowance. -* `settlementStrategyId` (*uint256*) - id of the settlement strategy used for trade. -* `minimumSettlementAmount` (*uint256*) - minimum amount of value returned to trader after fees. -* `referrer` (*address*) - Optional address of the referrer, for fee share - -**Returns** -* `asyncOrderClaim` (*struct AsyncOrderClaim.Data*) - claim details (see AsyncOrderClaim.Data struct). -#### cancelOrder - - ```solidity - function cancelOrder(uint128 marketId, uint128 asyncOrderId) external - ``` - - Cancel an async order via this function - - cancellation transfers the amountProvided back to the trader without any fee collection -cancellation can only happen after the settlement time has passed -needs to satisfy commitmentTime + settlementDelay + settlementDuration < block.timestamp - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `asyncOrderId` (*uint128*) - id of the async order created during commitment. - -#### getAsyncOrderClaim - - ```solidity - function getAsyncOrderClaim(uint128 marketId, uint128 asyncOrderId) external view returns (struct AsyncOrderClaim.Data asyncOrderClaim) - ``` - - Get async order claim details - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `asyncOrderId` (*uint128*) - id of the async order created during commitment. - -**Returns** -* `asyncOrderClaim` (*struct AsyncOrderClaim.Data*) - claim details (see AsyncOrderClaim.Data struct). - -#### OrderCommitted - - ```solidity - event OrderCommitted(uint128 marketId, enum Transaction.Type orderType, uint256 amountProvided, uint128 asyncOrderId, address sender, address referrer) - ``` - - Gets fired when a new order is committed. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `orderType` (*enum Transaction.Type*) - Should send either 2 or 3 which correlates to the transaction type enum defined in Transaction.Type. -* `amountProvided` (*uint256*) - amount of value provided by the user for trade. -* `asyncOrderId` (*uint128*) - id of the async order created (used for settlements). -* `sender` (*address*) - trader address. -* `referrer` (*address*) - Optional address of the referrer, for fee share - -#### OrderCancelled - - ```solidity - event OrderCancelled(uint128 marketId, uint128 asyncOrderId, struct AsyncOrderClaim.Data asyncOrderClaim, address sender) - ``` - - Gets fired when an order is cancelled. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `asyncOrderId` (*uint128*) - id of the async order. -* `asyncOrderClaim` (*struct AsyncOrderClaim.Data*) - claim details (see AsyncOrderClaim.Data struct). -* `sender` (*address*) - trader address and also the receiver of the funds. - -### Async Order Settlement Module - -#### settleOrder - - ```solidity - function settleOrder(uint128 marketId, uint128 asyncOrderId) external returns (uint256 finalOrderAmount, struct OrderFees.Data) - ``` - - Settle already created async order via this function - - if the strategy is onchain, the settlement is done similar to an atomic buy except with settlement time -if the strategy is offchain, this function will revert with OffchainLookup error and the client should perform offchain lookup and call the callback specified see: EIP-3668 - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `asyncOrderId` (*uint128*) - id of the async order created during commitment. - -**Returns** -* `finalOrderAmount` (*uint256*) - amount returned to trader after fees. -* `[1]` (*struct OrderFees.Data*) - OrderFees.Data breakdown of all the fees incurred for the transaction. -#### settlePythOrder - - ```solidity - function settlePythOrder(bytes result, bytes extraData) external payable returns (uint256 finalOrderAmount, struct OrderFees.Data fees) - ``` - - Callback function for Pyth settlement strategy - - This is the selector specified as callback when settlement strategy is pyth offchain. -The data returned from the offchain lookup should be sent as "result" -The extraData is the same as the one sent during the offchain lookup revert error. It is used to retrieve the commitment claim. -this function expects ETH that is passed through to the Pyth contract for the fee it's charging. -To determine the fee, the client should first call getUpdateFee() from Pyth's verifier contract. - -**Parameters** -* `result` (*bytes*) - result returned from the offchain lookup. -* `extraData` (*bytes*) - extra data sent during the offchain lookup revert error. - -**Returns** -* `finalOrderAmount` (*uint256*) - amount returned to trader after fees. -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction. - -#### OrderSettled - - ```solidity - event OrderSettled(uint128 marketId, uint128 asyncOrderId, uint256 finalOrderAmount, struct OrderFees.Data fees, uint256 collectedFees, address settler, uint256 price, enum Transaction.Type orderType) - ``` - - Gets fired when an order is settled. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `asyncOrderId` (*uint128*) - id of the async order. -* `finalOrderAmount` (*uint256*) - amount returned to trader after fees. -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction. -* `collectedFees` (*uint256*) - fees collected by the configured fee collector. -* `settler` (*address*) - address that settled the order. -* `price` (*uint256*) - -* `orderType` (*enum Transaction.Type*) - - -### Atomic Order Module - -#### buyExactIn - - ```solidity - function buyExactIn(uint128 synthMarketId, uint256 amountUsd, uint256 minAmountReceived, address referrer) external returns (uint256 synthAmount, struct OrderFees.Data fees) - ``` - - Initiates a buy trade returning synth for the specified amountUsd. - - Transfers the specified amountUsd, collects fees through configured fee collector, returns synth to the trader. -Leftover fees not collected get deposited into the market manager to improve market PnL. -Uses the buyFeedId configured for the market. - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market used for the trade. -* `amountUsd` (*uint256*) - Amount of snxUSD trader is providing allowance for the trade. -* `minAmountReceived` (*uint256*) - Min Amount of synth is expected the trader to receive otherwise the transaction will revert. -* `referrer` (*address*) - Optional address of the referrer, for fee share - -**Returns** -* `synthAmount` (*uint256*) - Synth received on the trade based on amount provided by trader. -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction. -#### buy - - ```solidity - function buy(uint128 marketId, uint256 usdAmount, uint256 minAmountReceived, address referrer) external returns (uint256 synthAmount, struct OrderFees.Data fees) - ``` - - alias for buyExactIn - -**Parameters** -* `marketId` (*uint128*) - (see buyExactIn) -* `usdAmount` (*uint256*) - (see buyExactIn) -* `minAmountReceived` (*uint256*) - (see buyExactIn) -* `referrer` (*address*) - (see buyExactIn) - -**Returns** -* `synthAmount` (*uint256*) - (see buyExactIn) -* `fees` (*struct OrderFees.Data*) - (see buyExactIn) -#### buyExactOut - - ```solidity - function buyExactOut(uint128 synthMarketId, uint256 synthAmount, uint256 maxUsdAmount, address referrer) external returns (uint256 usdAmountCharged, struct OrderFees.Data fees) - ``` - - user provides the synth amount they'd like to buy, and the function charges the USD amount which includes fees - - the inverse of buyExactIn - -**Parameters** -* `synthMarketId` (*uint128*) - market id value -* `synthAmount` (*uint256*) - the amount of synth the trader wants to buy -* `maxUsdAmount` (*uint256*) - max amount the trader is willing to pay for the specified synth -* `referrer` (*address*) - optional address of the referrer, for fee share - -**Returns** -* `usdAmountCharged` (*uint256*) - amount of USD charged for the trade -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction -#### quoteBuyExactIn - - ```solidity - function quoteBuyExactIn(uint128 synthMarketId, uint256 usdAmount) external view returns (uint256 synthAmount, struct OrderFees.Data fees) - ``` - - quote for buyExactIn. same parameters and return values as buyExactIn - -**Parameters** -* `synthMarketId` (*uint128*) - market id value -* `usdAmount` (*uint256*) - amount of USD to use for the trade - -**Returns** -* `synthAmount` (*uint256*) - return amount of synth given the USD amount - fees -* `fees` (*struct OrderFees.Data*) - breakdown of all the quoted fees for the buy txn -#### quoteBuyExactOut - - ```solidity - function quoteBuyExactOut(uint128 synthMarketId, uint256 synthAmount) external view returns (uint256 usdAmountCharged, struct OrderFees.Data) - ``` - - quote for buyExactOut. same parameters and return values as buyExactOut - -**Parameters** -* `synthMarketId` (*uint128*) - market id value -* `synthAmount` (*uint256*) - amount of synth requested - -**Returns** -* `usdAmountCharged` (*uint256*) - USD amount charged for the synth requested - fees -* `[1]` (*struct OrderFees.Data*) - fees breakdown of all the quoted fees for the buy txn -#### sellExactIn - - ```solidity - function sellExactIn(uint128 synthMarketId, uint256 sellAmount, uint256 minAmountReceived, address referrer) external returns (uint256 returnAmount, struct OrderFees.Data fees) - ``` - - Initiates a sell trade returning snxUSD for the specified amount of synth (sellAmount) - - Transfers the specified synth, collects fees through configured fee collector, returns snxUSD to the trader. -Leftover fees not collected get deposited into the market manager to improve market PnL. - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market used for the trade. -* `sellAmount` (*uint256*) - Amount of synth provided by trader for trade into snxUSD. -* `minAmountReceived` (*uint256*) - Min Amount of snxUSD trader expects to receive for the trade -* `referrer` (*address*) - Optional address of the referrer, for fee share - -**Returns** -* `returnAmount` (*uint256*) - Amount of snxUSD returned to user -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction. -#### sellExactOut - - ```solidity - function sellExactOut(uint128 marketId, uint256 usdAmount, uint256 maxSynthAmount, address referrer) external returns (uint256 synthToBurn, struct OrderFees.Data fees) - ``` - - initiates a trade where trader specifies USD amount they'd like to receive - - the inverse of sellExactIn - -**Parameters** -* `marketId` (*uint128*) - synth market id -* `usdAmount` (*uint256*) - amount of USD trader wants to receive -* `maxSynthAmount` (*uint256*) - max amount of synth trader is willing to use to receive the specified USD amount -* `referrer` (*address*) - optional address of the referrer, for fee share - -**Returns** -* `synthToBurn` (*uint256*) - amount of synth charged for the specified usd amount -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction -#### sell - - ```solidity - function sell(uint128 marketId, uint256 synthAmount, uint256 minUsdAmount, address referrer) external returns (uint256 usdAmountReceived, struct OrderFees.Data fees) - ``` - - alias for sellExactIn - -**Parameters** -* `marketId` (*uint128*) - (see sellExactIn) -* `synthAmount` (*uint256*) - (see sellExactIn) -* `minUsdAmount` (*uint256*) - (see sellExactIn) -* `referrer` (*address*) - (see sellExactIn) - -**Returns** -* `usdAmountReceived` (*uint256*) - (see sellExactIn) -* `fees` (*struct OrderFees.Data*) - (see sellExactIn) -#### quoteSellExactIn - - ```solidity - function quoteSellExactIn(uint128 marketId, uint256 synthAmount) external view returns (uint256 returnAmount, struct OrderFees.Data fees) - ``` - - quote for sellExactIn - - returns expected USD amount trader would receive for the specified synth amount - -**Parameters** -* `marketId` (*uint128*) - synth market id -* `synthAmount` (*uint256*) - synth amount trader is providing for the trade - -**Returns** -* `returnAmount` (*uint256*) - amount of USD expected back -* `fees` (*struct OrderFees.Data*) - breakdown of all the quoted fees for the txn -#### quoteSellExactOut - - ```solidity - function quoteSellExactOut(uint128 marketId, uint256 usdAmount) external view returns (uint256 synthToBurn, struct OrderFees.Data fees) - ``` - - quote for sellExactOut - - returns expected synth amount expected from trader for the requested USD amount - -**Parameters** -* `marketId` (*uint128*) - synth market id -* `usdAmount` (*uint256*) - USD amount trader wants to receive - -**Returns** -* `synthToBurn` (*uint256*) - amount of synth expected from trader -* `fees` (*struct OrderFees.Data*) - breakdown of all the quoted fees for the txn - -#### SynthBought - - ```solidity - event SynthBought(uint256 synthMarketId, uint256 synthReturned, struct OrderFees.Data fees, uint256 collectedFees, address referrer, uint256 price) - ``` - - Gets fired when buy trade is complete - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market used for the trade. -* `synthReturned` (*uint256*) - Synth received on the trade based on amount provided by trader. -* `fees` (*struct OrderFees.Data*) - breakdown of all fees incurred for transaction. -* `collectedFees` (*uint256*) - Fees collected by the configured FeeCollector for the market (rest of the fees are deposited to market manager). -* `referrer` (*address*) - Optional address of the referrer, for fee share -* `price` (*uint256*) - - -#### SynthSold - - ```solidity - event SynthSold(uint256 synthMarketId, uint256 amountReturned, struct OrderFees.Data fees, uint256 collectedFees, address referrer, uint256 price) - ``` - - Gets fired when sell trade is complete - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market used for the trade. -* `amountReturned` (*uint256*) - Amount of snxUSD returned to user based on synth provided by trader. -* `fees` (*struct OrderFees.Data*) - breakdown of all fees incurred for transaction. -* `collectedFees` (*uint256*) - Fees collected by the configured FeeCollector for the market (rest of the fees are deposited to market manager). -* `referrer` (*address*) - Optional address of the referrer, for fee share -* `price` (*uint256*) - - -### Market Configuration Module - -#### getMarketFees - - ```solidity - function getMarketFees(uint128 synthMarketId) external returns (uint256 atomicFixedFee, uint256 asyncFixedFee, int256 wrapFee, int256 unwrapFee) - ``` - - gets the atomic fixed fee for a given market - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the fee applies to. - -**Returns** -* `atomicFixedFee` (*uint256*) - fixed fee amount represented in bips with 18 decimals. -* `asyncFixedFee` (*uint256*) - fixed fee amount represented in bips with 18 decimals. -* `wrapFee` (*int256*) - wrapping fee in %, 18 decimals. Can be negative. -* `unwrapFee` (*int256*) - unwrapping fee in %, 18 decimals. Can be negative. -#### setAtomicFixedFee - - ```solidity - function setAtomicFixedFee(uint128 synthMarketId, uint256 atomicFixedFee) external - ``` - - sets the atomic fixed fee for a given market - - only marketOwner can set the fee - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the fee applies to. -* `atomicFixedFee` (*uint256*) - fixed fee amount represented in bips with 18 decimals. - -#### setAsyncFixedFee - - ```solidity - function setAsyncFixedFee(uint128 synthMarketId, uint256 asyncFixedFee) external - ``` - - sets the async fixed fee for a given market - - only marketOwner can set the fee - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the fee applies to. -* `asyncFixedFee` (*uint256*) - fixed fee amount represented in bips with 18 decimals. - -#### setMarketSkewScale - - ```solidity - function setMarketSkewScale(uint128 synthMarketId, uint256 skewScale) external - ``` - - sets the skew scale for a given market - - only marketOwner can set the skew scale - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the skew scale applies to. -* `skewScale` (*uint256*) - max amount of synth which makes the skew 100%. the fee is derived as a % of the max value. 100% premium means outstanding synth == skewScale. - -#### getMarketSkewScale - - ```solidity - function getMarketSkewScale(uint128 synthMarketId) external returns (uint256 skewScale) - ``` - - gets the skew scale for a given market - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the skew scale applies to. - -**Returns** -* `skewScale` (*uint256*) - max amount of synth which makes the skew 100%. the fee is derived as a % of the max value. 100% premium means outstanding synth == skewScale. -#### setMarketUtilizationFees - - ```solidity - function setMarketUtilizationFees(uint128 synthMarketId, uint256 utilizationFeeRate) external - ``` - - sets the market utilization fee for a given market - - only marketOwner can set the fee -100% utilization means the fee is 0. 120% utilization means the fee is 20% * this fee rate (in bips). - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the utilization fee applies to. -* `utilizationFeeRate` (*uint256*) - the rate is represented in bips with 18 decimals and is the rate at which fee increases based on the % above 100% utilization of the delegated collateral for the market. - -#### getMarketUtilizationFees - - ```solidity - function getMarketUtilizationFees(uint128 synthMarketId) external returns (uint256 utilizationFeeRate) - ``` - - gets the market utilization fee for a given market - - 100% utilization means the fee is 0. 120% utilization means the fee is 20% * this fee rate (in bips). - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the utilization fee applies to. - -**Returns** -* `utilizationFeeRate` (*uint256*) - the rate is represented in bips with 18 decimals and is the rate at which fee increases based on the % above 100% utilization of the delegated collateral for the market. -#### setCollateralLeverage - - ```solidity - function setCollateralLeverage(uint128 synthMarketId, uint256 collateralLeverage) external - ``` - - sets the collateral leverage for a given market - - only marketOwner can set the leverage -this leverage value is a value applied to delegated collateral which is compared to outstanding synth to determine utilization of market, and locked amounts - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the collateral leverage applies to. -* `collateralLeverage` (*uint256*) - the leverage is represented as % with 18 decimals. 1 = 1x leverage - -#### getCollateralLeverage - - ```solidity - function getCollateralLeverage(uint128 synthMarketId) external returns (uint256 collateralLeverage) - ``` - - gets the collateral leverage for a given market - - this leverage value is a value applied to delegated collateral which is compared to outstanding synth to determine utilization of market, and locked amounts - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the collateral leverage applies to. - -**Returns** -* `collateralLeverage` (*uint256*) - the leverage is represented as % with 18 decimals. 1 = 1x leverage -#### setCustomTransactorFees - - ```solidity - function setCustomTransactorFees(uint128 synthMarketId, address transactor, uint256 fixedFeeAmount) external - ``` - - sets the fixed fee for a given market and transactor - - overrides both the atomic and async fixed fees -only marketOwner can set the fee -especially useful for direct integrations where configured traders get a discount - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the custom transactor fee applies to. -* `transactor` (*address*) - address of the trader getting discounted fees. -* `fixedFeeAmount` (*uint256*) - the fixed fee applying to the provided transactor. - -#### getCustomTransactorFees - - ```solidity - function getCustomTransactorFees(uint128 synthMarketId, address transactor) external returns (uint256 fixedFeeAmount) - ``` - - gets the fixed fee for a given market and transactor - - overrides both the atomic and async fixed fees -especially useful for direct integrations where configured traders get a discount - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the custom transactor fee applies to. -* `transactor` (*address*) - address of the trader getting discounted fees. - -**Returns** -* `fixedFeeAmount` (*uint256*) - the fixed fee applying to the provided transactor. -#### setFeeCollector - - ```solidity - function setFeeCollector(uint128 synthMarketId, address feeCollector) external - ``` - - sets a custom fee collector for a given market - - only marketOwner can set the fee collector -a use case here would be if the market owner wants to collect the fees via this contract and distribute via rewards distributor to SNX holders for example. -if fee collector is not set, the fees are deposited into the market manager. - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the fee collector applies to. -* `feeCollector` (*address*) - address of the fee collector inheriting the IFeeCollector interface. - -#### getFeeCollector - - ```solidity - function getFeeCollector(uint128 synthMarketId) external returns (address feeCollector) - ``` - - gets a custom fee collector for a given market - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the fee collector applies to. - -**Returns** -* `feeCollector` (*address*) - address of the fee collector inheriting the IFeeCollector interface. -#### setWrapperFees - - ```solidity - function setWrapperFees(uint128 synthMarketId, int256 wrapFee, int256 unwrapFee) external - ``` - - sets wrapper related fees. - - only marketOwner can set the wrapper fees -fees can be negative. this is a way to unwind the wrapper if needed by providing incentives. - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the wrapper fees apply to. -* `wrapFee` (*int256*) - wrapping fee in %, 18 decimals. Can be negative. -* `unwrapFee` (*int256*) - unwrapping fee in %, 18 decimals. Can be negative. - -#### updateReferrerShare - - ```solidity - function updateReferrerShare(uint128 marketId, address referrer, uint256 sharePercentage) external - ``` - - Update the referral share percentage for a given market - -**Parameters** -* `marketId` (*uint128*) - id of the market -* `referrer` (*address*) - The address of the referrer -* `sharePercentage` (*uint256*) - The new share percentage for the referrer - -#### getReferrerShare - - ```solidity - function getReferrerShare(uint128 marketId, address referrer) external returns (uint256 sharePercentage) - ``` - - get the referral share percentage for a given market - -**Parameters** -* `marketId` (*uint128*) - id of the market -* `referrer` (*address*) - The address of the referrer - -**Returns** -* `sharePercentage` (*uint256*) - The new share percentage for the referrer - -#### MarketUtilizationFeesSet - - ```solidity - event MarketUtilizationFeesSet(uint256 synthMarketId, uint256 utilizationFeeRate) - ``` - - emitted when market utilization fees are set for specified market - -**Parameters** -* `synthMarketId` (*uint256*) - market id -* `utilizationFeeRate` (*uint256*) - utilization fee rate value - -#### MarketSkewScaleSet - - ```solidity - event MarketSkewScaleSet(uint256 synthMarketId, uint256 skewScale) - ``` - - emitted when the skew scale is set for a market - -**Parameters** -* `synthMarketId` (*uint256*) - market id -* `skewScale` (*uint256*) - skew scale value - -#### CollateralLeverageSet - - ```solidity - event CollateralLeverageSet(uint256 synthMarketId, uint256 collateralLeverage) - ``` - - emitted when the collateral leverage is set for a market - -**Parameters** -* `synthMarketId` (*uint256*) - market id -* `collateralLeverage` (*uint256*) - leverage value - -#### AtomicFixedFeeSet - - ```solidity - event AtomicFixedFeeSet(uint256 synthMarketId, uint256 atomicFixedFee) - ``` - - emitted when the fixed fee for atomic orders is set. - -**Parameters** -* `synthMarketId` (*uint256*) - market id -* `atomicFixedFee` (*uint256*) - fee value - -#### AsyncFixedFeeSet - - ```solidity - event AsyncFixedFeeSet(uint256 synthMarketId, uint256 asyncFixedFee) - ``` - - emitted when the fixed fee for async orders is set. - -**Parameters** -* `synthMarketId` (*uint256*) - market id -* `asyncFixedFee` (*uint256*) - fee value - -#### TransactorFixedFeeSet - - ```solidity - event TransactorFixedFeeSet(uint256 synthMarketId, address transactor, uint256 fixedFeeAmount) - ``` - - emitted when the fixed fee is set for a given transactor - - this overrides the async/atomic fixed fees for a given transactor - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market to set the fees for. -* `transactor` (*address*) - fixed fee for the transactor (overrides the global fixed fee) -* `fixedFeeAmount` (*uint256*) - the fixed fee for the corresponding market, and transactor - -#### FeeCollectorSet - - ```solidity - event FeeCollectorSet(uint256 synthMarketId, address feeCollector) - ``` - - emitted when custom fee collector is set for a given market - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market to set the collector for. -* `feeCollector` (*address*) - the address of the fee collector to set. - -#### WrapperFeesSet - - ```solidity - event WrapperFeesSet(uint256 synthMarketId, int256 wrapFee, int256 unwrapFee) - ``` - - emitted when wrapper fees are set for a given market - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market to set the wrapper fees. -* `wrapFee` (*int256*) - wrapping fee in %, 18 decimals. Can be negative. -* `unwrapFee` (*int256*) - unwrapping fee in %, 18 decimals. Can be negative. - -#### ReferrerShareUpdated - - ```solidity - event ReferrerShareUpdated(uint128 marketId, address referrer, uint256 sharePercentage) - ``` - - Emitted when the share percentage for a referrer address has been updated. - -**Parameters** -* `marketId` (*uint128*) - Id of the market -* `referrer` (*address*) - The address of the referrer -* `sharePercentage` (*uint256*) - The new share percentage for the referrer - -### Spot Market Factory Module - -#### setSynthetix - - ```solidity - function setSynthetix(contract ISynthetixSystem synthetix) external - ``` - - Sets the v3 synthetix core system. - - Pulls in the USDToken and oracle manager from the synthetix core system and sets those appropriately. - -**Parameters** -* `synthetix` (*contract ISynthetixSystem*) - synthetix v3 core system address - -#### setSynthImplementation - - ```solidity - function setSynthImplementation(address synthImplementation) external - ``` - - When a new synth is created, this is the erc20 implementation that is used. - -**Parameters** -* `synthImplementation` (*address*) - erc20 implementation address - -#### createSynth - - ```solidity - function createSynth(string tokenName, string tokenSymbol, address synthOwner) external returns (uint128 synthMarketId) - ``` - - Creates a new synth market with synthetix v3 core system via market manager - - The synth is created using the initial synth implementation and creates a proxy for future upgrades of the synth implementation. -Sets up the market owner who can update configuration for the synth. - -**Parameters** -* `tokenName` (*string*) - name of synth (i.e Synthetix ETH) -* `tokenSymbol` (*string*) - symbol of synth (i.e snxETH) -* `synthOwner` (*address*) - owner of the market that's created. - -**Returns** -* `synthMarketId` (*uint128*) - id of the synth market that was created -#### getSynth - - ```solidity - function getSynth(uint128 marketId) external view returns (address synthAddress) - ``` - - Get the proxy address of the synth for the provided marketId - - Uses associated systems module to retrieve the token address. - -**Parameters** -* `marketId` (*uint128*) - id of the market - -**Returns** -* `synthAddress` (*address*) - address of the proxy for the synth -#### getSynthImpl - - ```solidity - function getSynthImpl(uint128 marketId) external view returns (address implAddress) - ``` - - Get the implementation address of the synth for the provided marketId. -This address should not be used directly--use `getSynth` instead - - Uses associated systems module to retrieve the token address. - -**Parameters** -* `marketId` (*uint128*) - id of the market - -**Returns** -* `implAddress` (*address*) - address of the proxy for the synth -#### updatePriceData - - ```solidity - function updatePriceData(uint128 marketId, bytes32 buyFeedId, bytes32 sellFeedId) external - ``` - - Update the price data for a given market. - - Only the market owner can call this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market -* `buyFeedId` (*bytes32*) - the oracle manager buy feed node id -* `sellFeedId` (*bytes32*) - the oracle manager sell feed node id - -#### upgradeSynthImpl - - ```solidity - function upgradeSynthImpl(uint128 marketId) external - ``` - - upgrades the synth implementation to the current implementation for the specified market. -Anyone who is willing and able to spend the gas can call this method. - - The synth implementation is upgraded via the proxy. - -**Parameters** -* `marketId` (*uint128*) - id of the market - -#### setDecayRate - - ```solidity - function setDecayRate(uint128 marketId, uint256 rate) external - ``` - - Allows market to adjust decay rate of the synth - -**Parameters** -* `marketId` (*uint128*) - the market to update the synth decay rate for -* `rate` (*uint256*) - APY to decay of the synth to decay by, as a 18 decimal ratio - -#### nominateMarketOwner - - ```solidity - function nominateMarketOwner(uint128 synthMarketId, address newNominatedOwner) external - ``` - - Allows the current market owner to nominate a new owner. - - The nominated owner will have to call `acceptOwnership` in a separate transaction in order to finalize the action and become the new contract owner. - -**Parameters** -* `synthMarketId` (*uint128*) - synth market id value -* `newNominatedOwner` (*address*) - The address that is to become nominated. - -#### acceptMarketOwnership - - ```solidity - function acceptMarketOwnership(uint128 synthMarketId) external - ``` - - Allows a nominated address to accept ownership of the market. - - Reverts if the caller is not nominated. - -**Parameters** -* `synthMarketId` (*uint128*) - synth market id value - -#### renounceMarketNomination - - ```solidity - function renounceMarketNomination(uint128 synthMarketId) external - ``` - - Allows a nominated address to renounce ownership of the market. - - Reverts if the caller is not nominated. - -**Parameters** -* `synthMarketId` (*uint128*) - synth market id value - -#### getMarketOwner - - ```solidity - function getMarketOwner(uint128 synthMarketId) external view returns (address) - ``` - - Returns market owner. - -**Parameters** -* `synthMarketId` (*uint128*) - synth market id value - -#### name - - ```solidity - function name(uint128 marketId) external view returns (string) - ``` - - returns a human-readable name for a given market - -#### reportedDebt - - ```solidity - function reportedDebt(uint128 marketId) external view returns (uint256) - ``` - - returns amount of USD that the market would try to mint if everything was withdrawn - -#### minimumCredit - - ```solidity - function minimumCredit(uint128 marketId) external view returns (uint256) - ``` - - prevents reduction of available credit capacity by specifying this amount, for which withdrawals will be disallowed - -#### supportsInterface - - ```solidity - function supportsInterface(bytes4 interfaceID) external view returns (bool) - ``` - - Determines if the contract in question supports the specified interface. - -**Parameters** -* `interfaceID` (*bytes4*) - XOR of all selectors in the contract. - -**Returns** -* `[0]` (*bool*) - True if the contract supports the specified interface. - -#### SynthetixSystemSet - - ```solidity - event SynthetixSystemSet(address synthetix, address usdTokenAddress, address oracleManager) - ``` - - Gets fired when the synthetix is set - -**Parameters** -* `synthetix` (*address*) - address of the synthetix core contract -* `usdTokenAddress` (*address*) - address of the USDToken contract -* `oracleManager` (*address*) - address of the Oracle Manager contract - -#### SynthImplementationSet - - ```solidity - event SynthImplementationSet(address synthImplementation) - ``` - - Gets fired when the synth implementation is set - -**Parameters** -* `synthImplementation` (*address*) - address of the synth implementation - -#### SynthRegistered - - ```solidity - event SynthRegistered(uint256 synthMarketId) - ``` - - Gets fired when the synth is registered as a market. - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the synth market that was created - -#### SynthImplementationUpgraded - - ```solidity - event SynthImplementationUpgraded(uint256 synthMarketId, address proxy, address implementation) - ``` - - Gets fired when the synth's implementation is updated on the corresponding proxy. - -**Parameters** -* `synthMarketId` (*uint256*) - -* `proxy` (*address*) - the synth proxy servicing the latest implementation -* `implementation` (*address*) - the latest implementation of the synth - -#### SynthPriceDataUpdated - - ```solidity - event SynthPriceDataUpdated(uint256 synthMarketId, bytes32 buyFeedId, bytes32 sellFeedId) - ``` - - Gets fired when the market's price feeds are updated, compatible with oracle manager - -**Parameters** -* `synthMarketId` (*uint256*) - -* `buyFeedId` (*bytes32*) - the oracle manager feed id for the buy price -* `sellFeedId` (*bytes32*) - the oracle manager feed id for the sell price - -#### DecayRateUpdated - - ```solidity - event DecayRateUpdated(uint128 marketId, uint256 rate) - ``` - - Gets fired when the market's price feeds are updated, compatible with oracle manager - -**Parameters** -* `marketId` (*uint128*) - Id of the synth market -* `rate` (*uint256*) - the new decay rate (1e16 means 1% decay per year) - -#### MarketOwnerNominated - - ```solidity - event MarketOwnerNominated(uint128 marketId, address newOwner) - ``` - - Emitted when an address has been nominated. - -**Parameters** -* `marketId` (*uint128*) - id of the market -* `newOwner` (*address*) - The address that has been nominated. - -#### MarketNominationRenounced - - ```solidity - event MarketNominationRenounced(uint128 marketId, address nominee) - ``` - - Emitted when market nominee renounces nomination. - -**Parameters** -* `marketId` (*uint128*) - id of the market -* `nominee` (*address*) - The address that has been nominated. - -#### MarketOwnerChanged - - ```solidity - event MarketOwnerChanged(uint128 marketId, address oldOwner, address newOwner) - ``` - - Emitted when the owner of the market has changed. - -**Parameters** -* `marketId` (*uint128*) - id of the market -* `oldOwner` (*address*) - The previous owner of the market. -* `newOwner` (*address*) - The new owner of the market. - -### Synth Token Module - -#### setDecayRate - - ```solidity - function setDecayRate(uint256 _rate) external - ``` - - Updates the decay rate for a year - -**Parameters** -* `_rate` (*uint256*) - The decay rate with 18 decimals (1e16 means 1% decay per year). - -#### decayRate - - ```solidity - function decayRate() external returns (uint256) - ``` - - get decay rate for a year - -#### advanceEpoch - - ```solidity - function advanceEpoch() external returns (uint256) - ``` - - advance epoch manually in order to avoid precision loss - -#### isInitialized - - ```solidity - function isInitialized() external returns (bool) - ``` - - Returns wether the token has been initialized. - -**Returns** -* `[0]` (*bool*) - A boolean with the result of the query. -#### initialize - - ```solidity - function initialize(string tokenName, string tokenSymbol, uint8 tokenDecimals) external - ``` - - Initializes the token with name, symbol, and decimals. - -#### mint - - ```solidity - function mint(address to, uint256 amount) external - ``` - - Allows the owner to mint tokens. - -**Parameters** -* `to` (*address*) - The address to receive the newly minted tokens. -* `amount` (*uint256*) - The amount of tokens to mint. - -#### burn - - ```solidity - function burn(address from, uint256 amount) external - ``` - - Allows the owner to burn tokens. - -**Parameters** -* `from` (*address*) - The address whose tokens will be burnt. -* `amount` (*uint256*) - The amount of tokens to burn. - -#### setAllowance - - ```solidity - function setAllowance(address from, address spender, uint256 amount) external - ``` - - Allows an address that holds tokens to provide allowance to another. - -**Parameters** -* `from` (*address*) - The address that is providing allowance. -* `spender` (*address*) - The address that is given allowance. -* `amount` (*uint256*) - The amount of allowance being given. - -#### name - - ```solidity - function name() external view returns (string) - ``` - - Retrieves the name of the token, e.g. "Synthetix Network Token". - -**Returns** -* `[0]` (*string*) - A string with the name of the token. -#### symbol - - ```solidity - function symbol() external view returns (string) - ``` - - Retrieves the symbol of the token, e.g. "SNX". - -**Returns** -* `[0]` (*string*) - A string with the symbol of the token. -#### decimals - - ```solidity - function decimals() external view returns (uint8) - ``` - - Retrieves the number of decimals used by the token. The default is 18. - -**Returns** -* `[0]` (*uint8*) - The number of decimals. -#### totalSupply - - ```solidity - function totalSupply() external view returns (uint256) - ``` - - Returns the total number of tokens in circulation (minted - burnt). - -**Returns** -* `[0]` (*uint256*) - The total number of tokens. -#### balanceOf - - ```solidity - function balanceOf(address owner) external view returns (uint256) - ``` - - Returns the balance of a user. - -**Parameters** -* `owner` (*address*) - The address whose balance is being retrieved. - -**Returns** -* `[0]` (*uint256*) - The number of tokens owned by the user. -#### allowance - - ```solidity - function allowance(address owner, address spender) external view returns (uint256) - ``` - - Returns how many tokens a user has allowed another user to transfer on its behalf. - -**Parameters** -* `owner` (*address*) - The user who has given the allowance. -* `spender` (*address*) - The user who was given the allowance. - -**Returns** -* `[0]` (*uint256*) - The amount of tokens `spender` can transfer on `owner`'s behalf. -#### transfer - - ```solidity - function transfer(address to, uint256 amount) external returns (bool) - ``` - - Transfer tokens from one address to another. - -**Parameters** -* `to` (*address*) - The address that will receive the tokens. -* `amount` (*uint256*) - The amount of tokens to be transferred. - -**Returns** -* `[0]` (*bool*) - A boolean which is true if the operation succeeded. -#### approve - - ```solidity - function approve(address spender, uint256 amount) external returns (bool) - ``` - - Allows users to provide allowance to other users so that they can transfer tokens on their behalf. - -**Parameters** -* `spender` (*address*) - The address that is receiving the allowance. -* `amount` (*uint256*) - The amount of tokens that are being added to the allowance. - -**Returns** -* `[0]` (*bool*) - A boolean which is true if the operation succeeded. -#### increaseAllowance - - ```solidity - function increaseAllowance(address spender, uint256 addedValue) external returns (bool) - ``` - - Atomically increases the allowance granted to `spender` by the caller. - -This is an alternative to {approve} that can be used as a mitigation for -problems described in {IERC20-approve}. - -Emits an {Approval} event indicating the updated allowance. - -Requirements: - -- `spender` cannot be the zero address. - -#### decreaseAllowance - - ```solidity - function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) - ``` - - Atomically decreases the allowance granted to `spender` by the caller. - -This is an alternative to {approve} that can be used as a mitigation for -problems described in {IERC20-approve}. - -Emits an {Approval} event indicating the updated allowance. - -Requirements: - -- `spender` cannot be the zero address. -- `spender` must have allowance for the caller of at least -`subtractedValue`. - -#### transferFrom - - ```solidity - function transferFrom(address from, address to, uint256 amount) external returns (bool) - ``` - - Allows a user who has been given allowance to transfer tokens on another user's behalf. - -**Parameters** -* `from` (*address*) - The address that owns the tokens that are being transferred. -* `to` (*address*) - The address that will receive the tokens. -* `amount` (*uint256*) - The number of tokens to transfer. - -**Returns** -* `[0]` (*bool*) - A boolean which is true if the operation succeeded. - -#### Transfer - - ```solidity - event Transfer(address from, address to, uint256 amount) - ``` - - Emitted when tokens have been transferred. - -**Parameters** -* `from` (*address*) - The address that originally owned the tokens. -* `to` (*address*) - The address that received the tokens. -* `amount` (*uint256*) - The number of tokens that were transferred. - -#### Approval - - ```solidity - event Approval(address owner, address spender, uint256 amount) - ``` - - Emitted when a user has provided allowance to another user for transferring tokens on its behalf. - -**Parameters** -* `owner` (*address*) - The address that is providing the allowance. -* `spender` (*address*) - The address that received the allowance. -* `amount` (*uint256*) - The number of tokens that were added to `spender`'s allowance. - -### Wrapper Module - -#### setWrapper - - ```solidity - function setWrapper(uint128 marketId, address wrapCollateralType, uint256 maxWrappableAmount) external - ``` - - Used to set the wrapper supply cap for a given market and collateral type. - - If the supply cap is set to 0 or lower than the current outstanding supply, then the wrapper is disabled. -There is a synthetix v3 core system supply cap also set. If the current supply becomes higher than either the core system supply cap or the local market supply cap, wrapping will be disabled. - -**Parameters** -* `marketId` (*uint128*) - Id of the market to enable wrapping for. -* `wrapCollateralType` (*address*) - The collateral being used to wrap the synth. -* `maxWrappableAmount` (*uint256*) - The maximum amount of collateral that can be wrapped. - -#### wrap - - ```solidity - function wrap(uint128 marketId, uint256 wrapAmount, uint256 minAmountReceived) external returns (uint256 amountToMint, struct OrderFees.Data fees) - ``` - - Wraps the specified amount and returns similar value of synth minus the fees. - - Fees are collected from the user by way of the contract returning less synth than specified amount of collateral. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `wrapAmount` (*uint256*) - Amount of collateral to wrap. This amount gets deposited into the market collateral manager. -* `minAmountReceived` (*uint256*) - The minimum amount of synths the trader is expected to receive, otherwise the transaction will revert. - -**Returns** -* `amountToMint` (*uint256*) - Amount of synth returned to user. -* `fees` (*struct OrderFees.Data*) - breakdown of all fees. in this case, only wrapper fees are returned. -#### unwrap - - ```solidity - function unwrap(uint128 marketId, uint256 unwrapAmount, uint256 minAmountReceived) external returns (uint256 returnCollateralAmount, struct OrderFees.Data fees) - ``` - - Unwraps the synth and returns similar value of collateral minus the fees. - - Transfers the specified synth, collects fees through configured fee collector, returns collateral minus fees to trader. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `unwrapAmount` (*uint256*) - Amount of synth trader is unwrapping. -* `minAmountReceived` (*uint256*) - The minimum amount of collateral the trader is expected to receive, otherwise the transaction will revert. - -**Returns** -* `returnCollateralAmount` (*uint256*) - Amount of collateral returned. -* `fees` (*struct OrderFees.Data*) - breakdown of all fees. in this case, only wrapper fees are returned. - -#### WrapperSet - - ```solidity - event WrapperSet(uint256 synthMarketId, address wrapCollateralType, uint256 maxWrappableAmount) - ``` - - Gets fired when wrapper supply is set for a given market, collateral type. - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market the wrapper is initialized for. -* `wrapCollateralType` (*address*) - the collateral used to wrap the synth. -* `maxWrappableAmount` (*uint256*) - the local supply cap for the wrapper. - -#### SynthWrapped - - ```solidity - event SynthWrapped(uint256 synthMarketId, uint256 amountWrapped, struct OrderFees.Data fees, uint256 feesCollected) - ``` - - Gets fired after user wraps synth - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market. -* `amountWrapped` (*uint256*) - amount of synth wrapped. -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction. -* `feesCollected` (*uint256*) - fees collected by the configured FeeCollector for the market (rest of the fees are deposited to market manager). - -#### SynthUnwrapped - - ```solidity - event SynthUnwrapped(uint256 synthMarketId, uint256 amountUnwrapped, struct OrderFees.Data fees, uint256 feesCollected) - ``` - - Gets fired after user unwraps synth - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market. -* `amountUnwrapped` (*uint256*) - amount of synth unwrapped. -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction. -* `feesCollected` (*uint256*) - fees collected by the configured FeeCollector for the market (rest of the fees are deposited to market manager). - -## Perps Market - -- [Back to TOC](#smart-contracts) - -### Async Order Module - -#### commitOrder - - ```solidity - function commitOrder(struct AsyncOrder.OrderCommitmentRequest commitment) external returns (struct AsyncOrder.Data retOrder, uint256 fees) - ``` - - Commit an async order via this function - -**Parameters** -* `commitment` (*struct AsyncOrder.OrderCommitmentRequest*) - Order commitment data (see AsyncOrder.OrderCommitmentRequest struct). - -**Returns** -* `retOrder` (*struct AsyncOrder.Data*) - order details (see AsyncOrder.Data struct). -* `fees` (*uint256*) - order fees (protocol + settler) -#### getOrder - - ```solidity - function getOrder(uint128 accountId) external returns (struct AsyncOrder.Data order) - ``` - - Get async order claim details - -**Parameters** -* `accountId` (*uint128*) - id of the account. - -**Returns** -* `order` (*struct AsyncOrder.Data*) - async order claim details (see AsyncOrder.Data struct). -#### computeOrderFees - - ```solidity - function computeOrderFees(uint128 marketId, int128 sizeDelta) external view returns (uint256 orderFees, uint256 fillPrice) - ``` - - Simulates what the order fee would be for the given market with the specified size. - - Note that this does not include the settlement reward fee, which is based on the strategy type used - -**Parameters** -* `marketId` (*uint128*) - id of the market. -* `sizeDelta` (*int128*) - size of position. - -**Returns** -* `orderFees` (*uint256*) - incurred fees. -* `fillPrice` (*uint256*) - price at which the order would be filled. -#### requiredMarginForOrder - - ```solidity - function requiredMarginForOrder(uint128 marketId, uint128 accountId, int128 sizeDelta) external view returns (uint256 requiredMargin) - ``` - - For a given market, account id, and a position size, returns the required total account margin for this order to succeed - - Useful for integrators to determine if an order will succeed or fail - -**Parameters** -* `marketId` (*uint128*) - id of the market. -* `accountId` (*uint128*) - id of the trader account. -* `sizeDelta` (*int128*) - size of position. - -**Returns** -* `requiredMargin` (*uint256*) - margin required for the order to succeed. - -#### OrderCommitted - - ```solidity - event OrderCommitted(uint128 marketId, uint128 accountId, enum SettlementStrategy.Type orderType, int128 sizeDelta, uint256 acceptablePrice, uint256 settlementTime, uint256 expirationTime, bytes32 trackingCode, address sender) - ``` - - Gets fired when a new order is committed. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `accountId` (*uint128*) - Id of the account used for the trade. -* `orderType` (*enum SettlementStrategy.Type*) - Should send 0 (at time of writing) that correlates to the transaction type enum defined in SettlementStrategy.Type. -* `sizeDelta` (*int128*) - requested change in size of the order sent by the user. -* `acceptablePrice` (*uint256*) - maximum or minimum, depending on the sizeDelta direction, accepted price to settle the order, set by the user. -* `settlementTime` (*uint256*) - Time at which the order can be settled. -* `expirationTime` (*uint256*) - Time at which the order expired. -* `trackingCode` (*bytes32*) - Optional code for integrator tracking purposes. -* `sender` (*address*) - address of the sender of the order. Authorized to commit by account owner. - -#### PreviousOrderExpired - - ```solidity - event PreviousOrderExpired(uint128 marketId, uint128 accountId, int128 sizeDelta, uint256 acceptablePrice, uint256 settlementTime, bytes32 trackingCode) - ``` - - Gets fired when a new order is committed while a previous one was expired. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `accountId` (*uint128*) - Id of the account used for the trade. -* `sizeDelta` (*int128*) - requested change in size of the order sent by the user. -* `acceptablePrice` (*uint256*) - maximum or minimum, depending on the sizeDelta direction, accepted price to settle the order, set by the user. -* `settlementTime` (*uint256*) - Time at which the order can be settled. -* `trackingCode` (*bytes32*) - Optional code for integrator tracking purposes. - -### Async Order Settlement Module - -#### settle - - ```solidity - function settle(uint128 accountId) external view - ``` - - Settles an offchain order. It's expected to revert with the OffchainLookup error with the data needed to perform the offchain lookup. - -**Parameters** -* `accountId` (*uint128*) - Id of the account used for the trade. - -#### settlePythOrder - - ```solidity - function settlePythOrder(bytes result, bytes extraData) external payable - ``` - - Settles an offchain order using the offchain retrieved data from pyth. - -**Parameters** -* `result` (*bytes*) - the blob of data retrieved offchain. -* `extraData` (*bytes*) - Extra data from OffchainLookupData. - -#### OrderSettled - - ```solidity - event OrderSettled(uint128 marketId, uint128 accountId, uint256 fillPrice, int256 pnl, int256 accruedFunding, int128 sizeDelta, int128 newSize, uint256 totalFees, uint256 referralFees, uint256 collectedFees, uint256 settlementReward, bytes32 trackingCode, address settler) - ``` - - Gets fired when a new order is settled. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `accountId` (*uint128*) - Id of the account used for the trade. -* `fillPrice` (*uint256*) - Price at which the order was settled. -* `pnl` (*int256*) - Pnl of the previous closed position. -* `accruedFunding` (*int256*) - Accrued funding of the previous closed position. -* `sizeDelta` (*int128*) - Size delta from order. -* `newSize` (*int128*) - New size of the position after settlement. -* `totalFees` (*uint256*) - Amount of fees collected by the protocol. -* `referralFees` (*uint256*) - Amount of fees collected by the referrer. -* `collectedFees` (*uint256*) - Amount of fees collected by fee collector. -* `settlementReward` (*uint256*) - Amount of fees collected by the settler. -* `trackingCode` (*bytes32*) - Optional code for integrator tracking purposes. -* `settler` (*address*) - address of the settler of the order. - -### Collateral Module - -#### setMaxCollateralAmount - - ```solidity - function setMaxCollateralAmount(uint128 synthMarketId, uint256 collateralAmount) external - ``` - - Set the max collateral amoutn via this function - -**Parameters** -* `synthMarketId` (*uint128*) - Synth market id, 0 for snxUSD. -* `collateralAmount` (*uint256*) - max amount that for the synth - -#### MaxCollateralSet - - ```solidity - event MaxCollateralSet(uint128 synthMarketId, uint256 collateralAmount) - ``` - - Gets fired when max collateral amount for synth collateral for the system is set by owner. - -**Parameters** -* `synthMarketId` (*uint128*) - Synth market id, 0 for snxUSD. -* `collateralAmount` (*uint256*) - max amount that was set for the synth - -### Global Perps Market Module - -#### setMaxCollateralAmount - - ```solidity - function setMaxCollateralAmount(uint128 synthMarketId, uint256 collateralAmount) external - ``` - - Sets the max collateral amount for a specific synth market. - -**Parameters** -* `synthMarketId` (*uint128*) - Synth market id, 0 for snxUSD. -* `collateralAmount` (*uint256*) - Max collateral amount to set for the synth market id. - -#### getMaxCollateralAmount - - ```solidity - function getMaxCollateralAmount(uint128 synthMarketId) external view returns (uint256) - ``` - - Gets the max collateral amount for a specific synth market. - -**Parameters** -* `synthMarketId` (*uint128*) - Synth market id, 0 for snxUSD. - -**Returns** -* `[0]` (*uint256*) - maxCollateralAmount max collateral amount of the specified synth market id -#### setSynthDeductionPriority - - ```solidity - function setSynthDeductionPriority(uint128[] newSynthDeductionPriority) external - ``` - - Sets the synth deduction priority ordered list. - - The synth deduction priority is used to determine the order in which synths are deducted from an account. Id 0 is snxUSD and should be first in the list. - -**Parameters** -* `newSynthDeductionPriority` (*uint128[]*) - Ordered array of synth market ids for deduction priority. - -#### getSynthDeductionPriority - - ```solidity - function getSynthDeductionPriority() external view returns (uint128[]) - ``` - - Gets the synth deduction priority ordered list. - - The synth deduction priority is used to determine the order in which synths are deducted from an account. Id 0 is snxUSD and should be first in the list. - -**Returns** -* `[0]` (*uint128[]*) - synthDeductionPriority Ordered array of synth market ids for deduction priority. -#### setLiquidationRewardGuards - - ```solidity - function setLiquidationRewardGuards(uint256 minLiquidationRewardUsd, uint256 maxLiquidationRewardUsd) external - ``` - - Sets the liquidation reward guard (min and max). - -**Parameters** -* `minLiquidationRewardUsd` (*uint256*) - Minimum liquidation reward expressed as USD value. -* `maxLiquidationRewardUsd` (*uint256*) - Maximum liquidation reward expressed as USD value. - -#### getLiquidationRewardGuards - - ```solidity - function getLiquidationRewardGuards() external view returns (uint256 minLiquidationRewardUsd, uint256 maxLiquidationRewardUsd) - ``` - - Gets the liquidation reward guard (min and max). - -**Returns** -* `minLiquidationRewardUsd` (*uint256*) - Minimum liquidation reward expressed as USD value. -* `maxLiquidationRewardUsd` (*uint256*) - Maximum liquidation reward expressed as USD value. -#### totalGlobalCollateralValue - - ```solidity - function totalGlobalCollateralValue() external view returns (uint256 totalCollateralValue) - ``` - - Gets the total collateral value of all deposited collateral from all traders. - -**Returns** -* `totalCollateralValue` (*uint256*) - value of all collateral -#### setFeeCollector - - ```solidity - function setFeeCollector(address feeCollector) external - ``` - - Sets the fee collector contract. - - must conform to the IFeeCollector interface - -**Parameters** -* `feeCollector` (*address*) - address of the fee collector contract - -#### getFeeCollector - - ```solidity - function getFeeCollector() external view returns (address feeCollector) - ``` - - Gets the configured feeCollector contract - -**Returns** -* `feeCollector` (*address*) - address of the fee collector contract -#### updateReferrerShare - - ```solidity - function updateReferrerShare(address referrer, uint256 shareRatioD18) external - ``` - - Update the referral share percentage for a referrer - -**Parameters** -* `referrer` (*address*) - The address of the referrer -* `shareRatioD18` (*uint256*) - The new share percentage for the referrer - -#### getReferrerShare - - ```solidity - function getReferrerShare(address referrer) external returns (uint256 shareRatioD18) - ``` - - get the referral share percentage for the specified referrer - -**Parameters** -* `referrer` (*address*) - The address of the referrer - -**Returns** -* `shareRatioD18` (*uint256*) - The configured share percentage for the referrer -#### getMarkets - - ```solidity - function getMarkets() external returns (uint256[] marketIds) - ``` - - get all existing market ids - -**Returns** -* `marketIds` (*uint256[]*) - an array of existing market ids - -#### MaxCollateralAmountSet - - ```solidity - event MaxCollateralAmountSet(uint128 synthMarketId, uint256 collateralAmount) - ``` - - Gets fired when max collateral amount for synth for all the markets is set by owner. - -**Parameters** -* `synthMarketId` (*uint128*) - Synth market id, 0 for snxUSD. -* `collateralAmount` (*uint256*) - max amount that was set for the synth - -#### SynthDeductionPrioritySet - - ```solidity - event SynthDeductionPrioritySet(uint128[] newSynthDeductionPriority) - ``` - - Gets fired when the synth deduction priority is updated by owner. - -**Parameters** -* `newSynthDeductionPriority` (*uint128[]*) - new synth id priority order for deductions. - -#### LiquidationRewardGuardsSet - - ```solidity - event LiquidationRewardGuardsSet(uint256 minLiquidationRewardUsd, uint256 maxLiquidationRewardUsd) - ``` - - Gets fired when liquidation reward guard is set or updated. - -**Parameters** -* `minLiquidationRewardUsd` (*uint256*) - Minimum liquidation reward expressed as USD value. -* `maxLiquidationRewardUsd` (*uint256*) - Maximum liquidation reward expressed as USD value. - -#### FeeCollectorSet - - ```solidity - event FeeCollectorSet(address feeCollector) - ``` - - emitted when custom fee collector is set - -**Parameters** -* `feeCollector` (*address*) - the address of the fee collector to set. - -#### ReferrerShareUpdated - - ```solidity - event ReferrerShareUpdated(address referrer, uint256 shareRatioD18) - ``` - - Emitted when the share percentage for a referrer address has been updated. - -**Parameters** -* `referrer` (*address*) - The address of the referrer -* `shareRatioD18` (*uint256*) - The new share ratio for the referrer - -### Liquidation Module - -#### liquidate - - ```solidity - function liquidate(uint128 accountId) external - ``` - - Liquidates an account. - - according to the current situation and account size it can be a partial or full liquidation. - -**Parameters** -* `accountId` (*uint128*) - Id of the account to liquidate. - -#### liquidateFlagged - - ```solidity - function liquidateFlagged() external - ``` - - Liquidates all flagged accounts. - -#### PositionLiquidated - - ```solidity - event PositionLiquidated(uint128 accountId, uint128 marketId, uint256 amountLiquidated, int128 currentPositionSize) - ``` - - Gets fired when an account position is liquidated . - -**Parameters** -* `accountId` (*uint128*) - Id of the account liquidated. -* `marketId` (*uint128*) - Id of the position's market. -* `amountLiquidated` (*uint256*) - amount liquidated. -* `currentPositionSize` (*int128*) - position size after liquidation. - -#### AccountLiquidated - - ```solidity - event AccountLiquidated(uint128 accountId, uint256 reward, bool fullLiquidation) - ``` - - Gets fired when an account is liquidated. - - this event is fired once per liquidation tx after the each position that can be liquidated at the time was liquidated. - -**Parameters** -* `accountId` (*uint128*) - Id of the account liquidated. -* `reward` (*uint256*) - total reward sent to liquidator. -* `fullLiquidation` (*bool*) - flag indicating if it was a partial or full liquidation. - -### Market Configuration Module - -#### addSettlementStrategy - - ```solidity - function addSettlementStrategy(uint128 marketId, struct SettlementStrategy.Data strategy) external returns (uint256 strategyId) - ``` - - Add a new settlement strategy with this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market to add the settlement strategy. -* `strategy` (*struct SettlementStrategy.Data*) - strategy details (see SettlementStrategy.Data struct). - -**Returns** -* `strategyId` (*uint256*) - id of the new settlement strategy. -#### setOrderFees - - ```solidity - function setOrderFees(uint128 marketId, uint256 makerFeeRatio, uint256 takerFeeRatio) external - ``` - - Set order fees for a market with this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market to set order fees. -* `makerFeeRatio` (*uint256*) - the maker fee ratio. -* `takerFeeRatio` (*uint256*) - the taker fee ratio. - -#### updatePriceData - - ```solidity - function updatePriceData(uint128 perpsMarketId, bytes32 feedId) external - ``` - - Set node id for perps market - -**Parameters** -* `perpsMarketId` (*uint128*) - id of the market to set price feed. -* `feedId` (*bytes32*) - the node feed id - -#### setFundingParameters - - ```solidity - function setFundingParameters(uint128 marketId, uint256 skewScale, uint256 maxFundingVelocity) external - ``` - - Set funding parameters for a market with this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market to set funding parameters. -* `skewScale` (*uint256*) - the skew scale. -* `maxFundingVelocity` (*uint256*) - the max funding velocity. - -#### setLiquidationParameters - - ```solidity - function setLiquidationParameters(uint128 marketId, uint256 initialMarginRatioD18, uint256 minimumInitialMarginRatioD18, uint256 maintenanceMarginScalarD18, uint256 liquidationRewardRatioD18, uint256 maxLiquidationLimitAccumulationMultiplier, uint256 maxSecondsInLiquidationWindow, uint256 minimumPositionMargin) external - ``` - - Set liquidation parameters for a market with this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market to set liquidation parameters. -* `initialMarginRatioD18` (*uint256*) - the initial margin ratio (as decimal with 18 digits precision). -* `minimumInitialMarginRatioD18` (*uint256*) - the minimum initial margin ratio (as decimal with 18 digits precision). -* `maintenanceMarginScalarD18` (*uint256*) - the maintenance margin scalar relative to the initial margin ratio (as decimal with 18 digits precision). -* `liquidationRewardRatioD18` (*uint256*) - the liquidation reward ratio (as decimal with 18 digits precision). -* `maxLiquidationLimitAccumulationMultiplier` (*uint256*) - the max liquidation limit accumulation multiplier. -* `maxSecondsInLiquidationWindow` (*uint256*) - the max seconds in liquidation window (used together with the acc multiplier to get max liquidation per window). -* `minimumPositionMargin` (*uint256*) - the minimum position margin. - -#### setMaxMarketSize - - ```solidity - function setMaxMarketSize(uint128 marketId, uint256 maxMarketSize) external - ``` - - Set the max size of an specific market with this function. - - This controls the maximum open interest a market can have on either side (Long | Short). So the total Open Interest (with zero skew) for a market can be up to max market size * 2. - -**Parameters** -* `marketId` (*uint128*) - id of the market to set the max market value. -* `maxMarketSize` (*uint256*) - the max market size in market asset units. - -#### setLockedOiRatio - - ```solidity - function setLockedOiRatio(uint128 marketId, uint256 lockedOiRatioD18) external - ``` - - Set the locked OI Ratio for a market with this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market to set locked OI ratio. -* `lockedOiRatioD18` (*uint256*) - the locked OI ratio skew scale (as decimal with 18 digits precision). - -#### setSettlementStrategyEnabled - - ```solidity - function setSettlementStrategyEnabled(uint128 marketId, uint256 strategyId, bool enabled) external - ``` - - Enable or disable a settlement strategy for a market with this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market. -* `strategyId` (*uint256*) - the specific strategy. -* `enabled` (*bool*) - whether the strategy is enabled or disabled. - -#### getSettlementStrategy - - ```solidity - function getSettlementStrategy(uint128 marketId, uint256 strategyId) external view returns (struct SettlementStrategy.Data settlementStrategy) - ``` - - Gets the settlement strategy details. - -**Parameters** -* `marketId` (*uint128*) - id of the market. -* `strategyId` (*uint256*) - id of the settlement strategy. - -**Returns** -* `settlementStrategy` (*struct SettlementStrategy.Data*) - strategy details (see SettlementStrategy.Data struct). -#### getLiquidationParameters - - ```solidity - function getLiquidationParameters(uint128 marketId) external view returns (uint256 initialMarginRatioD18, uint256 minimumInitialMarginRatioD18, uint256 maintenanceMarginScalarD18, uint256 liquidationRewardRatioD18, uint256 maxLiquidationLimitAccumulationMultiplier, uint256 maxSecondsInLiquidationWindow, uint256 minimumPositionMargin) - ``` - - Gets liquidation parameters details of a market. - -**Parameters** -* `marketId` (*uint128*) - id of the market. - -**Returns** -* `initialMarginRatioD18` (*uint256*) - the initial margin ratio (as decimal with 18 digits precision). -* `minimumInitialMarginRatioD18` (*uint256*) - the minimum initial margin ratio (as decimal with 18 digits precision). -* `maintenanceMarginScalarD18` (*uint256*) - the maintenance margin scalar relative to the initial margin ratio (as decimal with 18 digits precision). -* `liquidationRewardRatioD18` (*uint256*) - the liquidation reward ratio (as decimal with 18 digits precision). -* `maxLiquidationLimitAccumulationMultiplier` (*uint256*) - the max liquidation limit accumulation multiplier. -* `maxSecondsInLiquidationWindow` (*uint256*) - the max seconds in liquidation window (used together with the acc multiplier to get max liquidation per window). -* `minimumPositionMargin` (*uint256*) - the minimum position margin. -#### getFundingParameters - - ```solidity - function getFundingParameters(uint128 marketId) external view returns (uint256 skewScale, uint256 maxFundingVelocity) - ``` - - Gets funding parameters of a market. - -**Parameters** -* `marketId` (*uint128*) - id of the market. - -**Returns** -* `skewScale` (*uint256*) - the skew scale. -* `maxFundingVelocity` (*uint256*) - the max funding velocity. -#### getMaxMarketSize - - ```solidity - function getMaxMarketSize(uint128 marketId) external view returns (uint256 maxMarketSize) - ``` - - Gets the max size of an specific market. - -**Parameters** -* `marketId` (*uint128*) - id of the market. - -**Returns** -* `maxMarketSize` (*uint256*) - the max market size in market asset units. -#### getOrderFees - - ```solidity - function getOrderFees(uint128 marketId) external view returns (uint256 makerFeeRatio, uint256 takerFeeRatio) - ``` - - Gets the order fees of a market. - -**Parameters** -* `marketId` (*uint128*) - id of the market. - -**Returns** -* `makerFeeRatio` (*uint256*) - the maker fee ratio. -* `takerFeeRatio` (*uint256*) - the taker fee ratio. -#### getLockedOiRatio - - ```solidity - function getLockedOiRatio(uint128 marketId) external view returns (uint256 lockedOiRatioD18) - ``` - - Gets the locked OI ratio of a market. - -**Parameters** -* `marketId` (*uint128*) - id of the market. - -**Returns** -* `lockedOiRatioD18` (*uint256*) - the locked OI ratio skew scale (as decimal with 18 digits precision). - -#### SettlementStrategyAdded - - ```solidity - event SettlementStrategyAdded(uint128 marketId, struct SettlementStrategy.Data strategy, uint256 strategyId) - ``` - - Gets fired when new settlement strategy is added. - -**Parameters** -* `marketId` (*uint128*) - adds settlement strategy to this specific market. -* `strategy` (*struct SettlementStrategy.Data*) - the strategy configuration. -* `strategyId` (*uint256*) - the newly created settlement strategy id. - -#### MarketPriceDataUpdated - - ```solidity - event MarketPriceDataUpdated(uint128 marketId, bytes32 feedId) - ``` - - Gets fired when feed id for perps market is updated. - -**Parameters** -* `marketId` (*uint128*) - id of perps market -* `feedId` (*bytes32*) - oracle node id - -#### OrderFeesSet - - ```solidity - event OrderFeesSet(uint128 marketId, uint256 makerFeeRatio, uint256 takerFeeRatio) - ``` - - Gets fired when order fees are updated. - -**Parameters** -* `marketId` (*uint128*) - udpates fees to this specific market. -* `makerFeeRatio` (*uint256*) - the maker fee ratio. -* `takerFeeRatio` (*uint256*) - the taker fee ratio. - -#### FundingParametersSet - - ```solidity - event FundingParametersSet(uint128 marketId, uint256 skewScale, uint256 maxFundingVelocity) - ``` - - Gets fired when funding parameters are updated. - -**Parameters** -* `marketId` (*uint128*) - udpates funding parameters to this specific market. -* `skewScale` (*uint256*) - the skew scale. -* `maxFundingVelocity` (*uint256*) - the max funding velocity. - -#### LiquidationParametersSet - - ```solidity - event LiquidationParametersSet(uint128 marketId, uint256 initialMarginRatioD18, uint256 maintenanceMarginRatioD18, uint256 minimumInitialMarginRatioD18, uint256 liquidationRewardRatioD18, uint256 maxLiquidationLimitAccumulationMultiplier, uint256 maxSecondsInLiquidationWindow, uint256 minimumPositionMargin) - ``` - - Gets fired when liquidation parameters are updated. - -**Parameters** -* `marketId` (*uint128*) - udpates funding parameters to this specific market. -* `initialMarginRatioD18` (*uint256*) - the initial margin ratio (as decimal with 18 digits precision). -* `maintenanceMarginRatioD18` (*uint256*) - the maintenance margin ratio (as decimal with 18 digits precision). -* `minimumInitialMarginRatioD18` (*uint256*) - -* `liquidationRewardRatioD18` (*uint256*) - the liquidation reward ratio (as decimal with 18 digits precision). -* `maxLiquidationLimitAccumulationMultiplier` (*uint256*) - the max liquidation limit accumulation multiplier. -* `maxSecondsInLiquidationWindow` (*uint256*) - the max seconds in liquidation window (used together with the acc multiplier to get max liquidation per window). -* `minimumPositionMargin` (*uint256*) - the minimum position margin. - -#### MaxMarketSizeSet - - ```solidity - event MaxMarketSizeSet(uint128 marketId, uint256 maxMarketSize) - ``` - - Gets fired when max market value is updated. - -**Parameters** -* `marketId` (*uint128*) - udpates funding parameters to this specific market. -* `maxMarketSize` (*uint256*) - the max market value. - -#### LockedOiRatioSet - - ```solidity - event LockedOiRatioSet(uint128 marketId, uint256 lockedOiRatioD18) - ``` - - Gets fired when locked oi ratio is updated. - -**Parameters** -* `marketId` (*uint128*) - udpates funding parameters to this specific market. -* `lockedOiRatioD18` (*uint256*) - the locked OI ratio skew scale (as decimal with 18 digits precision). - -#### SettlementStrategyEnabled - - ```solidity - event SettlementStrategyEnabled(uint128 marketId, uint256 strategyId, bool enabled) - ``` - - Gets fired when a settlement strategy is enabled or disabled. - -**Parameters** -* `marketId` (*uint128*) - udpates funding parameters to this specific market. -* `strategyId` (*uint256*) - the specific strategy. -* `enabled` (*bool*) - whether the strategy is enabled or disabled. - -### IMarketEvents - -#### MarketUpdated - - ```solidity - event MarketUpdated(uint128 marketId, uint256 price, int256 skew, uint256 size, int256 sizeDelta, int256 currentFundingRate, int256 currentFundingVelocity) - ``` - - Gets fired when the size of a market is updated by new orders or liquidations. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `price` (*uint256*) - Price at the time of this event. -* `skew` (*int256*) - Market skew at the time of the trade. Positive values mean more longs. -* `size` (*uint256*) - Size of the entire market after settlement. -* `sizeDelta` (*int256*) - Change in market size during this update. -* `currentFundingRate` (*int256*) - The current funding rate of this market (0.001 = 0.1% per day) -* `currentFundingVelocity` (*int256*) - The current rate of change of the funding rate (0.001 = +0.1% per day) - -### Perps Account Module - -#### modifyCollateral - - ```solidity - function modifyCollateral(uint128 accountId, uint128 synthMarketId, int256 amountDelta) external - ``` - - Modify the collateral delegated to the account. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. -* `synthMarketId` (*uint128*) - Id of the synth market used as collateral. Synth market id, 0 for snxUSD. -* `amountDelta` (*int256*) - requested change in amount of collateral delegated to the account. - -#### getCollateralAmount - - ```solidity - function getCollateralAmount(uint128 accountId, uint128 synthMarketId) external view returns (uint256) - ``` - - Gets the account's collateral value for a specific collateral. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. -* `synthMarketId` (*uint128*) - Id of the synth market used as collateral. Synth market id, 0 for snxUSD. - -**Returns** -* `[0]` (*uint256*) - collateralValue collateral value of the account. -#### totalCollateralValue - - ```solidity - function totalCollateralValue(uint128 accountId) external view returns (uint256) - ``` - - Gets the account's total collateral value. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. - -**Returns** -* `[0]` (*uint256*) - collateralValue total collateral value of the account. USD denominated. -#### totalAccountOpenInterest - - ```solidity - function totalAccountOpenInterest(uint128 accountId) external view returns (uint256) - ``` - - Gets the account's total open interest value. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. - -**Returns** -* `[0]` (*uint256*) - openInterestValue total open interest value of the account. -#### getOpenPosition - - ```solidity - function getOpenPosition(uint128 accountId, uint128 marketId) external view returns (int256 totalPnl, int256 accruedFunding, int128 positionSize) - ``` - - Gets the details of an open position. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. -* `marketId` (*uint128*) - Id of the position market. - -**Returns** -* `totalPnl` (*int256*) - pnl of the entire position including funding. -* `accruedFunding` (*int256*) - accrued funding of the position. -* `positionSize` (*int128*) - size of the position. -#### getAvailableMargin - - ```solidity - function getAvailableMargin(uint128 accountId) external view returns (int256 availableMargin) - ``` - - Gets the available margin of an account. It can be negative due to pnl. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. - -**Returns** -* `availableMargin` (*int256*) - available margin of the position. -#### getWithdrawableMargin - - ```solidity - function getWithdrawableMargin(uint128 accountId) external view returns (int256 withdrawableMargin) - ``` - - Gets the exact withdrawable amount a trader has available from this account while holding the account's current positions. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. - -**Returns** -* `withdrawableMargin` (*int256*) - available margin to withdraw. -#### getRequiredMargins - - ```solidity - function getRequiredMargins(uint128 accountId) external view returns (uint256 requiredInitialMargin, uint256 requiredMaintenanceMargin, uint256 totalAccumulatedLiquidationRewards, uint256 maxLiquidationReward) - ``` - - Gets the initial/maintenance margins across all positions that an account has open. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. - -**Returns** -* `requiredInitialMargin` (*uint256*) - initial margin req (used when withdrawing collateral). -* `requiredMaintenanceMargin` (*uint256*) - maintenance margin req (used to determine liquidation threshold). -* `totalAccumulatedLiquidationRewards` (*uint256*) - sum of all liquidation rewards of if all account open positions were to be liquidated fully. -* `maxLiquidationReward` (*uint256*) - max liquidation reward the keeper would receive if account was fully liquidated. Note here that the accumulated rewards are checked against the global max/min configured liquidation rewards. - -#### CollateralModified - - ```solidity - event CollateralModified(uint128 accountId, uint128 synthMarketId, int256 amountDelta, address sender) - ``` - - Gets fired when an account colateral is modified. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. -* `synthMarketId` (*uint128*) - Id of the synth market used as collateral. Synth market id, 0 for snxUSD. -* `amountDelta` (*int256*) - requested change in amount of collateral delegated to the account. -* `sender` (*address*) - address of the sender of the size modification. Authorized by account owner. - -### Perps Market Factory Module - -#### initializeFactory - - ```solidity - function initializeFactory() external returns (uint128) - ``` - - Initializes the factory. - - this function should be called only once. - -**Returns** -* `[0]` (*uint128*) - globalPerpsMarketId Id of the global perps market id. -#### setSynthetix - - ```solidity - function setSynthetix(contract ISynthetixSystem synthetix) external - ``` - - Sets the synthetix system. - -**Parameters** -* `synthetix` (*contract ISynthetixSystem*) - address of the main synthetix proxy. - -#### setSpotMarket - - ```solidity - function setSpotMarket(contract ISpotMarketSystem spotMarket) external - ``` - - Sets the spot market system. - -**Parameters** -* `spotMarket` (*contract ISpotMarketSystem*) - address of the spot market proxy. - -#### createMarket - - ```solidity - function createMarket(uint128 requestedMarketId, string marketName, string marketSymbol) external returns (uint128) - ``` - - Creates a new market. - -**Parameters** -* `requestedMarketId` (*uint128*) - id of the market to create. -* `marketName` (*string*) - name of the market to create. -* `marketSymbol` (*string*) - symbol of the market to create. - -**Returns** -* `[0]` (*uint128*) - perpsMarketId Id of the created perps market. -#### name - - ```solidity - function name(uint128 marketId) external view returns (string) - ``` - - returns a human-readable name for a given market - -#### reportedDebt - - ```solidity - function reportedDebt(uint128 marketId) external view returns (uint256) - ``` - - returns amount of USD that the market would try to mint if everything was withdrawn - -#### minimumCredit - - ```solidity - function minimumCredit(uint128 marketId) external view returns (uint256) - ``` - - prevents reduction of available credit capacity by specifying this amount, for which withdrawals will be disallowed - -#### supportsInterface - - ```solidity - function supportsInterface(bytes4 interfaceID) external view returns (bool) - ``` - - Determines if the contract in question supports the specified interface. - -**Parameters** -* `interfaceID` (*bytes4*) - XOR of all selectors in the contract. - -**Returns** -* `[0]` (*bool*) - True if the contract supports the specified interface. - -#### FactoryInitialized - - ```solidity - event FactoryInitialized(uint128 globalPerpsMarketId) - ``` - - Gets fired when the factory is initialized. - -**Parameters** -* `globalPerpsMarketId` (*uint128*) - the new global perps market id. - -#### MarketCreated - - ```solidity - event MarketCreated(uint128 perpsMarketId, string marketName, string marketSymbol) - ``` - - Gets fired when a market is created. - -**Parameters** -* `perpsMarketId` (*uint128*) - the newly created perps market id. -* `marketName` (*string*) - the newly created perps market name. -* `marketSymbol` (*string*) - the newly created perps market symbol. - -### Perps Market Module - -#### metadata - - ```solidity - function metadata(uint128 marketId) external view returns (string name, string symbol) - ``` - - Gets a market metadata. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `name` (*string*) - Name of the market. -* `symbol` (*string*) - Symbol of the market. -#### skew - - ```solidity - function skew(uint128 marketId) external view returns (int256) - ``` - - Gets a market's skew. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `[0]` (*int256*) - skew Skew of the market. -#### size - - ```solidity - function size(uint128 marketId) external view returns (uint256) - ``` - - Gets a market's size. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `[0]` (*uint256*) - size Size of the market. -#### maxOpenInterest - - ```solidity - function maxOpenInterest(uint128 marketId) external view returns (uint256) - ``` - - Gets a market's max open interest. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `[0]` (*uint256*) - maxOpenInterest Max open interest of the market. -#### currentFundingRate - - ```solidity - function currentFundingRate(uint128 marketId) external view returns (int256) - ``` - - Gets a market's current funding rate. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `[0]` (*int256*) - currentFundingRate Current funding rate of the market. -#### currentFundingVelocity - - ```solidity - function currentFundingVelocity(uint128 marketId) external view returns (int256) - ``` - - Gets a market's current funding velocity. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `[0]` (*int256*) - currentFundingVelocity Current funding velocity of the market. -#### indexPrice - - ```solidity - function indexPrice(uint128 marketId) external view returns (uint256) - ``` - - Gets a market's index price. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `[0]` (*uint256*) - indexPrice Index price of the market. -#### fillPrice - - ```solidity - function fillPrice(uint128 marketId, int128 orderSize, uint256 price) external returns (uint256) - ``` - - Gets a market's fill price for a specific order size and index price. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. -* `orderSize` (*int128*) - Order size. -* `price` (*uint256*) - Index price. - -**Returns** -* `[0]` (*uint256*) - price Fill price. -#### getMarketSummary - - ```solidity - function getMarketSummary(uint128 marketId) external view returns (struct IPerpsMarketModule.MarketSummary summary) - ``` - - Given a marketId return a market's summary details in one call. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `summary` (*struct IPerpsMarketModule.MarketSummary*) - Market summary (see MarketSummary). - -## Governance - -- [Back to TOC](#smart-contracts) - -### Council Token Module - -#### isInitialized - - ```solidity - function isInitialized() external returns (bool) - ``` - - Returns whether the token has been initialized. - -**Returns** -* `[0]` (*bool*) - A boolean with the result of the query. -#### initialize - - ```solidity - function initialize(string tokenName, string tokenSymbol, string uri) external - ``` - - Initializes the token with name, symbol, and uri. - -#### mint - - ```solidity - function mint(address to, uint256 tokenId) external - ``` - - Allows the owner to mint tokens. - -**Parameters** -* `to` (*address*) - The address to receive the newly minted tokens. -* `tokenId` (*uint256*) - The ID of the newly minted token - -#### safeMint - - ```solidity - function safeMint(address to, uint256 tokenId, bytes data) external - ``` - - Allows the owner to mint tokens. Verifies that the receiver can receive the token - -**Parameters** -* `to` (*address*) - The address to receive the newly minted token. -* `tokenId` (*uint256*) - The ID of the newly minted token -* `data` (*bytes*) - any data which should be sent to the receiver - -#### burn - - ```solidity - function burn(uint256 tokenId) external - ``` - - Allows the owner to burn tokens. - -**Parameters** -* `tokenId` (*uint256*) - The token to burn - -#### setAllowance - - ```solidity - function setAllowance(uint256 tokenId, address spender) external - ``` - - Allows an address that holds tokens to provide allowance to another. - -**Parameters** -* `tokenId` (*uint256*) - The token which should be allowed to spender -* `spender` (*address*) - The address that is given allowance. - -#### setBaseTokenURI - - ```solidity - function setBaseTokenURI(string uri) external - ``` - - Allows the owner to update the base token URI. - -**Parameters** -* `uri` (*string*) - The new base token uri - -#### totalSupply - - ```solidity - function totalSupply() external view returns (uint256) - ``` - - Returns the total amount of tokens stored by the contract. - -#### tokenOfOwnerByIndex - - ```solidity - function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256) - ``` - - Returns a token ID owned by `owner` at a given `index` of its token list. -Use along with {balanceOf} to enumerate all of ``owner``'s tokens. - -Requirements: -- `owner` must be a valid address -- `index` must be less than the balance of the tokens for the owner - -#### tokenByIndex - - ```solidity - function tokenByIndex(uint256 index) external view returns (uint256) - ``` - - Returns a token ID at a given `index` of all the tokens stored by the contract. -Use along with {totalSupply} to enumerate all tokens. - -Requirements: -- `index` must be less than the total supply of the tokens - -#### balanceOf - - ```solidity - function balanceOf(address holder) external view returns (uint256 balance) - ``` - - Returns the number of tokens in ``owner``'s account. - -Requirements: - -- `holder` must be a valid address - -#### ownerOf - - ```solidity - function ownerOf(uint256 tokenId) external view returns (address owner) - ``` - - Returns the owner of the `tokenId` token. - -Requirements: - -- `tokenId` must exist. - -#### safeTransferFrom - - ```solidity - function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external - ``` - - Safely transfers `tokenId` token from `from` to `to`. - -Requirements: - -- `from` cannot be the zero address. -- `to` cannot be the zero address. -- `tokenId` token must exist and be owned by `from`. -- If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. -- If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - -Emits a {Transfer} event. - -#### safeTransferFrom - - ```solidity - function safeTransferFrom(address from, address to, uint256 tokenId) external - ``` - - Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients -are aware of the ERC721 protocol to prevent tokens from being forever locked. - -Requirements: - -- `from` cannot be the zero address. -- `to` cannot be the zero address. -- `tokenId` token must exist and be owned by `from`. -- If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. -- If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - -Emits a {Transfer} event. - -#### transferFrom - - ```solidity - function transferFrom(address from, address to, uint256 tokenId) external - ``` - - Transfers `tokenId` token from `from` to `to`. - -WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. - -Requirements: - -- `from` cannot be the zero address. -- `to` cannot be the zero address. -- `tokenId` token must be owned by `from`. -- If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - -Emits a {Transfer} event. - -#### approve - - ```solidity - function approve(address to, uint256 tokenId) external - ``` - - Gives permission to `to` to transfer `tokenId` token to another account. -The approval is cleared when the token is transferred. - -Only a single account can be approved at a time, so approving the zero address clears previous approvals. - -Requirements: - -- The caller must own the token or be an approved operator. -- `tokenId` must exist. - -Emits an {Approval} event. - -#### setApprovalForAll - - ```solidity - function setApprovalForAll(address operator, bool approved) external - ``` - - Approve or remove `operator` as an operator for the caller. -Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. - -Requirements: - -- The `operator` cannot be the caller. - -Emits an {ApprovalForAll} event. - -#### getApproved - - ```solidity - function getApproved(uint256 tokenId) external view returns (address operator) - ``` - - Returns the account approved for `tokenId` token. - -Requirements: - -- `tokenId` must exist. - -#### isApprovedForAll - - ```solidity - function isApprovedForAll(address owner, address operator) external view returns (bool) - ``` - - Returns if the `operator` is allowed to manage all of the assets of `owner`. - -See {setApprovalForAll} - -#### Transfer - - ```solidity - event Transfer(address from, address to, uint256 tokenId) - ``` - - Emitted when `tokenId` token is transferred from `from` to `to`. - -#### Approval - - ```solidity - event Approval(address owner, address approved, uint256 tokenId) - ``` - - Emitted when `owner` enables `approved` to manage the `tokenId` token. - -#### ApprovalForAll - - ```solidity - event ApprovalForAll(address owner, address operator, bool approved) - ``` - - Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. - -### IDebtShare - -#### balanceOfOnPeriod - - ```solidity - function balanceOfOnPeriod(address account, uint256 periodId) external view returns (uint256) - ``` - -### Election Inspector Module - -#### getEpochStartDateForIndex - - ```solidity - function getEpochStartDateForIndex(uint256 epochIndex) external view returns (uint64) - ``` - - Returns the date in which the given epoch started - -#### getEpochEndDateForIndex - - ```solidity - function getEpochEndDateForIndex(uint256 epochIndex) external view returns (uint64) - ``` - - Returns the date in which the given epoch ended - -#### getNominationPeriodStartDateForIndex - - ```solidity - function getNominationPeriodStartDateForIndex(uint256 epochIndex) external view returns (uint64) - ``` - - Returns the date in which the Nomination period in the given epoch started - -#### getVotingPeriodStartDateForIndex - - ```solidity - function getVotingPeriodStartDateForIndex(uint256 epochIndex) external view returns (uint64) - ``` - - Returns the date in which the Voting period in the given epoch started - -#### wasNominated - - ```solidity - function wasNominated(address candidate, uint256 epochIndex) external view returns (bool) - ``` - - Shows if a candidate was nominated in the given epoch - -#### getNomineesAtEpoch - - ```solidity - function getNomineesAtEpoch(uint256 epochIndex) external view returns (address[]) - ``` - - Returns a list of all nominated candidates in the given epoch - -#### getBallotVotedAtEpoch - - ```solidity - function getBallotVotedAtEpoch(address user, uint256 epochIndex) external view returns (bytes32) - ``` - - Returns the ballot id that user voted on in the given election - -#### hasVotedInEpoch - - ```solidity - function hasVotedInEpoch(address user, uint256 epochIndex) external view returns (bool) - ``` - - Returns if user has voted in the given election - -#### getBallotVotesInEpoch - - ```solidity - function getBallotVotesInEpoch(bytes32 ballotId, uint256 epochIndex) external view returns (uint256) - ``` - - Returns the number of votes given to a particular ballot in a given epoch - -#### getBallotCandidatesInEpoch - - ```solidity - function getBallotCandidatesInEpoch(bytes32 ballotId, uint256 epochIndex) external view returns (address[]) - ``` - - Returns the list of candidates that a particular ballot has in a given epoch - -#### getCandidateVotesInEpoch - - ```solidity - function getCandidateVotesInEpoch(address candidate, uint256 epochIndex) external view returns (uint256) - ``` - - Returns the number of votes a candidate received in a given epoch - -#### getElectionWinnersInEpoch - - ```solidity - function getElectionWinnersInEpoch(uint256 epochIndex) external view returns (address[]) - ``` - - Returns the winners of the given election - -### Election Module - -#### initOrUpgradeElectionModule - - ```solidity - function initOrUpgradeElectionModule(address[] firstCouncil, uint8 minimumActiveMembers, uint64 nominationPeriodStartDate, uint64 votingPeriodStartDate, uint64 epochEndDate) external - ``` - - Initializes the module and immediately starts the first epoch - -#### isElectionModuleInitialized - - ```solidity - function isElectionModuleInitialized() external view returns (bool) - ``` - - Shows whether the module has been initialized - -#### tweakEpochSchedule - - ```solidity - function tweakEpochSchedule(uint64 newNominationPeriodStartDate, uint64 newVotingPeriodStartDate, uint64 newEpochEndDate) external - ``` - - Adjusts the current epoch schedule requiring that the current period remains Administration, and that changes are small (see setMaxDateAdjustmentTolerance) - -#### modifyEpochSchedule - - ```solidity - function modifyEpochSchedule(uint64 newNominationPeriodStartDate, uint64 newVotingPeriodStartDate, uint64 newEpochEndDate) external - ``` - - Adjusts the current epoch schedule requiring that the current period remains Administration - -#### setMinEpochDurations - - ```solidity - function setMinEpochDurations(uint64 newMinNominationPeriodDuration, uint64 newMinVotingPeriodDuration, uint64 newMinEpochDuration) external - ``` - - Determines minimum values for epoch schedule adjustments - -#### setMaxDateAdjustmentTolerance - - ```solidity - function setMaxDateAdjustmentTolerance(uint64 newMaxDateAdjustmentTolerance) external - ``` - - Determines adjustment size for tweakEpochSchedule - -#### setDefaultBallotEvaluationBatchSize - - ```solidity - function setDefaultBallotEvaluationBatchSize(uint256 newDefaultBallotEvaluationBatchSize) external - ``` - - Determines batch size when evaluate() is called with numBallots = 0 - -#### setNextEpochSeatCount - - ```solidity - function setNextEpochSeatCount(uint8 newSeatCount) external - ``` - - Determines the number of council members in the next epoch - -#### setMinimumActiveMembers - - ```solidity - function setMinimumActiveMembers(uint8 newMinimumActiveMembers) external - ``` - - Determines the minimum number of council members before triggering an emergency election - -#### dismissMembers - - ```solidity - function dismissMembers(address[] members) external - ``` - - Allows the owner to remove one or more council members, triggering an election if a threshold is met - -#### nominate - - ```solidity - function nominate() external - ``` - - Allows anyone to self-nominate during the Nomination period - -#### withdrawNomination - - ```solidity - function withdrawNomination() external - ``` - - Self-withdrawal of nominations during the Nomination period - -#### cast - - ```solidity - function cast(address[] candidates) external - ``` - - Allows anyone with vote power to vote on nominated candidates during the Voting period - -#### withdrawVote - - ```solidity - function withdrawVote() external - ``` - - Allows votes to be withdraw - -#### evaluate - - ```solidity - function evaluate(uint256 numBallots) external - ``` - - Processes ballots in batches during the Evaluation period (after epochEndDate) - -#### resolve - - ```solidity - function resolve() external - ``` - - Shuffles NFTs and resolves an election after it has been evaluated - -#### getMinEpochDurations - - ```solidity - function getMinEpochDurations() external view returns (uint64 minNominationPeriodDuration, uint64 minVotingPeriodDuration, uint64 minEpochDuration) - ``` - - Exposes minimum durations required when adjusting epoch schedules - -#### getMaxDateAdjustmenTolerance - - ```solidity - function getMaxDateAdjustmenTolerance() external view returns (uint64) - ``` - - Exposes maximum size of adjustments when calling tweakEpochSchedule - -#### getDefaultBallotEvaluationBatchSize - - ```solidity - function getDefaultBallotEvaluationBatchSize() external view returns (uint256) - ``` - - Shows the default batch size when calling evaluate() with numBallots = 0 - -#### getNextEpochSeatCount - - ```solidity - function getNextEpochSeatCount() external view returns (uint8) - ``` - - Shows the number of council members that the next epoch will have - -#### getMinimumActiveMembers - - ```solidity - function getMinimumActiveMembers() external view returns (uint8) - ``` - - Returns the minimum active members that the council needs to avoid an emergency election - -#### getEpochIndex - - ```solidity - function getEpochIndex() external view returns (uint256) - ``` - - Returns the index of the current epoch. The first epoch's index is 1 - -#### getEpochStartDate - - ```solidity - function getEpochStartDate() external view returns (uint64) - ``` - - Returns the date in which the current epoch started - -#### getEpochEndDate - - ```solidity - function getEpochEndDate() external view returns (uint64) - ``` - - Returns the date in which the current epoch will end - -#### getNominationPeriodStartDate - - ```solidity - function getNominationPeriodStartDate() external view returns (uint64) - ``` - - Returns the date in which the Nomination period in the current epoch will start - -#### getVotingPeriodStartDate - - ```solidity - function getVotingPeriodStartDate() external view returns (uint64) - ``` - - Returns the date in which the Voting period in the current epoch will start - -#### getCurrentPeriod - - ```solidity - function getCurrentPeriod() external view returns (uint256) - ``` - - Returns the current period type: Administration, Nomination, Voting, Evaluation - -#### isNominated - - ```solidity - function isNominated(address candidate) external view returns (bool) - ``` - - Shows if a candidate has been nominated in the current epoch - -#### getNominees - - ```solidity - function getNominees() external view returns (address[]) - ``` - - Returns a list of all nominated candidates in the current epoch - -#### calculateBallotId - - ```solidity - function calculateBallotId(address[] candidates) external pure returns (bytes32) - ``` - - Hashes a list of candidates (used for identifying and storing ballots) - -#### getBallotVoted - - ```solidity - function getBallotVoted(address user) external view returns (bytes32) - ``` - - Returns the ballot id that user voted on in the current election - -#### hasVoted - - ```solidity - function hasVoted(address user) external view returns (bool) - ``` - - Returns if user has voted in the current election - -#### getVotePower - - ```solidity - function getVotePower(address user) external view returns (uint256) - ``` - - Returns the vote power of user in the current election - -#### getBallotVotes - - ```solidity - function getBallotVotes(bytes32 ballotId) external view returns (uint256) - ``` - - Returns the number of votes given to a particular ballot - -#### getBallotCandidates - - ```solidity - function getBallotCandidates(bytes32 ballotId) external view returns (address[]) - ``` - - Returns the list of candidates that a particular ballot has - -#### isElectionEvaluated - - ```solidity - function isElectionEvaluated() external view returns (bool) - ``` - - Returns whether all ballots in the current election have been counted - -#### getCandidateVotes - - ```solidity - function getCandidateVotes(address candidate) external view returns (uint256) - ``` - - Returns the number of votes a candidate received. Requires the election to be partially or totally evaluated - -#### getElectionWinners - - ```solidity - function getElectionWinners() external view returns (address[]) - ``` - - Returns the winners of the current election. Requires the election to be partially or totally evaluated - -#### getCouncilToken - - ```solidity - function getCouncilToken() external view returns (address) - ``` - - Returns the address of the council NFT token - -#### getCouncilMembers - - ```solidity - function getCouncilMembers() external view returns (address[]) - ``` - - Returns the current NFT token holders - -### Synthetix Election Module - -#### initOrUpgradeElectionModule - - ```solidity - function initOrUpgradeElectionModule(address[] firstCouncil, uint8 minimumActiveMembers, uint64 nominationPeriodStartDate, uint64 votingPeriodStartDate, uint64 epochEndDate, address debtShareContract) external - ``` - - Initializes the module and immediately starts the first epoch - -#### setDebtShareContract - - ```solidity - function setDebtShareContract(address newDebtShareContractAddress) external - ``` - - Sets the Synthetix v2 DebtShare contract that determines vote power - -#### getDebtShareContract - - ```solidity - function getDebtShareContract() external view returns (address) - ``` - - Returns the Synthetix v2 DebtShare contract that determines vote power - -#### setDebtShareSnapshotId - - ```solidity - function setDebtShareSnapshotId(uint256 snapshotId) external - ``` - - Sets the Synthetix v2 DebtShare snapshot that determines vote power for this epoch - -#### getDebtShareSnapshotId - - ```solidity - function getDebtShareSnapshotId() external view returns (uint256) - ``` - - Returns the Synthetix v2 DebtShare snapshot id set for this epoch - -#### getDebtShare - - ```solidity - function getDebtShare(address user) external view returns (uint256) - ``` - - Returns the Synthetix v2 debt share for the provided address, at this epoch's snapshot - -#### setCrossChainDebtShareMerkleRoot - - ```solidity - function setCrossChainDebtShareMerkleRoot(bytes32 merkleRoot, uint256 blocknumber) external - ``` - - Allows the system owner to declare a merkle root for user debt shares on other chains for this epoch - -#### getCrossChainDebtShareMerkleRoot - - ```solidity - function getCrossChainDebtShareMerkleRoot() external view returns (bytes32) - ``` - - Returns the current epoch's merkle root for user debt shares on other chains - -#### getCrossChainDebtShareMerkleRootBlockNumber - - ```solidity - function getCrossChainDebtShareMerkleRootBlockNumber() external view returns (uint256) - ``` - - Returns the current epoch's merkle root block number - -#### declareCrossChainDebtShare - - ```solidity - function declareCrossChainDebtShare(address account, uint256 debtShare, bytes32[] merkleProof) external - ``` - - Allows users to declare their Synthetix v2 debt shares on other chains - -#### getDeclaredCrossChainDebtShare - - ```solidity - function getDeclaredCrossChainDebtShare(address account) external view returns (uint256) - ``` - - Returns the Synthetix v2 debt shares for the provided address, at this epoch's snapshot, in other chains - -#### declareAndCast - - ```solidity - function declareAndCast(uint256 debtShare, bytes32[] merkleProof, address[] candidates) external - ``` - - Declares cross chain debt shares and casts a vote - -#### initOrUpgradeElectionModule - - ```solidity - function initOrUpgradeElectionModule(address[] firstCouncil, uint8 minimumActiveMembers, uint64 nominationPeriodStartDate, uint64 votingPeriodStartDate, uint64 epochEndDate) external - ``` - - Initializes the module and immediately starts the first epoch - -#### isElectionModuleInitialized - - ```solidity - function isElectionModuleInitialized() external view returns (bool) - ``` - - Shows whether the module has been initialized - -#### tweakEpochSchedule - - ```solidity - function tweakEpochSchedule(uint64 newNominationPeriodStartDate, uint64 newVotingPeriodStartDate, uint64 newEpochEndDate) external - ``` - - Adjusts the current epoch schedule requiring that the current period remains Administration, and that changes are small (see setMaxDateAdjustmentTolerance) - -#### modifyEpochSchedule - - ```solidity - function modifyEpochSchedule(uint64 newNominationPeriodStartDate, uint64 newVotingPeriodStartDate, uint64 newEpochEndDate) external - ``` - - Adjusts the current epoch schedule requiring that the current period remains Administration - -#### setMinEpochDurations - - ```solidity - function setMinEpochDurations(uint64 newMinNominationPeriodDuration, uint64 newMinVotingPeriodDuration, uint64 newMinEpochDuration) external - ``` - - Determines minimum values for epoch schedule adjustments - -#### setMaxDateAdjustmentTolerance - - ```solidity - function setMaxDateAdjustmentTolerance(uint64 newMaxDateAdjustmentTolerance) external - ``` - - Determines adjustment size for tweakEpochSchedule - -#### setDefaultBallotEvaluationBatchSize - - ```solidity - function setDefaultBallotEvaluationBatchSize(uint256 newDefaultBallotEvaluationBatchSize) external - ``` - - Determines batch size when evaluate() is called with numBallots = 0 - -#### setNextEpochSeatCount - - ```solidity - function setNextEpochSeatCount(uint8 newSeatCount) external - ``` - - Determines the number of council members in the next epoch - -#### setMinimumActiveMembers - - ```solidity - function setMinimumActiveMembers(uint8 newMinimumActiveMembers) external - ``` - - Determines the minimum number of council members before triggering an emergency election - -#### dismissMembers - - ```solidity - function dismissMembers(address[] members) external - ``` - - Allows the owner to remove one or more council members, triggering an election if a threshold is met - -#### nominate - - ```solidity - function nominate() external - ``` - - Allows anyone to self-nominate during the Nomination period - -#### withdrawNomination - - ```solidity - function withdrawNomination() external - ``` - - Self-withdrawal of nominations during the Nomination period - -#### cast - - ```solidity - function cast(address[] candidates) external - ``` - - Allows anyone with vote power to vote on nominated candidates during the Voting period - -#### withdrawVote - - ```solidity - function withdrawVote() external - ``` - - Allows votes to be withdraw - -#### evaluate - - ```solidity - function evaluate(uint256 numBallots) external - ``` - - Processes ballots in batches during the Evaluation period (after epochEndDate) - -#### resolve - - ```solidity - function resolve() external - ``` - - Shuffles NFTs and resolves an election after it has been evaluated - -#### getMinEpochDurations - - ```solidity - function getMinEpochDurations() external view returns (uint64 minNominationPeriodDuration, uint64 minVotingPeriodDuration, uint64 minEpochDuration) - ``` - - Exposes minimum durations required when adjusting epoch schedules - -#### getMaxDateAdjustmenTolerance - - ```solidity - function getMaxDateAdjustmenTolerance() external view returns (uint64) - ``` - - Exposes maximum size of adjustments when calling tweakEpochSchedule - -#### getDefaultBallotEvaluationBatchSize - - ```solidity - function getDefaultBallotEvaluationBatchSize() external view returns (uint256) - ``` - - Shows the default batch size when calling evaluate() with numBallots = 0 - -#### getNextEpochSeatCount - - ```solidity - function getNextEpochSeatCount() external view returns (uint8) - ``` - - Shows the number of council members that the next epoch will have - -#### getMinimumActiveMembers - - ```solidity - function getMinimumActiveMembers() external view returns (uint8) - ``` - - Returns the minimum active members that the council needs to avoid an emergency election - -#### getEpochIndex - - ```solidity - function getEpochIndex() external view returns (uint256) - ``` - - Returns the index of the current epoch. The first epoch's index is 1 - -#### getEpochStartDate - - ```solidity - function getEpochStartDate() external view returns (uint64) - ``` - - Returns the date in which the current epoch started - -#### getEpochEndDate - - ```solidity - function getEpochEndDate() external view returns (uint64) - ``` - - Returns the date in which the current epoch will end - -#### getNominationPeriodStartDate - - ```solidity - function getNominationPeriodStartDate() external view returns (uint64) - ``` - - Returns the date in which the Nomination period in the current epoch will start - -#### getVotingPeriodStartDate - - ```solidity - function getVotingPeriodStartDate() external view returns (uint64) - ``` - - Returns the date in which the Voting period in the current epoch will start - -#### getCurrentPeriod - - ```solidity - function getCurrentPeriod() external view returns (uint256) - ``` - - Returns the current period type: Administration, Nomination, Voting, Evaluation - -#### isNominated - - ```solidity - function isNominated(address candidate) external view returns (bool) - ``` - - Shows if a candidate has been nominated in the current epoch - -#### getNominees - - ```solidity - function getNominees() external view returns (address[]) - ``` - - Returns a list of all nominated candidates in the current epoch - -#### calculateBallotId - - ```solidity - function calculateBallotId(address[] candidates) external pure returns (bytes32) - ``` - - Hashes a list of candidates (used for identifying and storing ballots) - -#### getBallotVoted - - ```solidity - function getBallotVoted(address user) external view returns (bytes32) - ``` - - Returns the ballot id that user voted on in the current election - -#### hasVoted - - ```solidity - function hasVoted(address user) external view returns (bool) - ``` - - Returns if user has voted in the current election - -#### getVotePower - - ```solidity - function getVotePower(address user) external view returns (uint256) - ``` - - Returns the vote power of user in the current election - -#### getBallotVotes - - ```solidity - function getBallotVotes(bytes32 ballotId) external view returns (uint256) - ``` - - Returns the number of votes given to a particular ballot - -#### getBallotCandidates - - ```solidity - function getBallotCandidates(bytes32 ballotId) external view returns (address[]) - ``` - - Returns the list of candidates that a particular ballot has - -#### isElectionEvaluated - - ```solidity - function isElectionEvaluated() external view returns (bool) - ``` - - Returns whether all ballots in the current election have been counted - -#### getCandidateVotes - - ```solidity - function getCandidateVotes(address candidate) external view returns (uint256) - ``` - - Returns the number of votes a candidate received. Requires the election to be partially or totally evaluated - -#### getElectionWinners - - ```solidity - function getElectionWinners() external view returns (address[]) - ``` - - Returns the winners of the current election. Requires the election to be partially or totally evaluated - -#### getCouncilToken - - ```solidity - function getCouncilToken() external view returns (address) - ``` - - Returns the address of the council NFT token - -#### getCouncilMembers - - ```solidity - function getCouncilMembers() external view returns (address[]) - ``` - - Returns the current NFT token holders - -## Oracle Manager - -- [Back to TOC](#smart-contracts) - -### Node Module - -#### registerNode - - ```solidity - function registerNode(enum NodeDefinition.NodeType nodeType, bytes parameters, bytes32[] parents) external returns (bytes32 nodeId) - ``` - - Registers a node - -**Parameters** -* `nodeType` (*enum NodeDefinition.NodeType*) - The nodeType assigned to this node. -* `parameters` (*bytes*) - The parameters assigned to this node. -* `parents` (*bytes32[]*) - The parents assigned to this node. - -**Returns** -* `nodeId` (*bytes32*) - The id of the registered node. -#### getNodeId - - ```solidity - function getNodeId(enum NodeDefinition.NodeType nodeType, bytes parameters, bytes32[] parents) external returns (bytes32 nodeId) - ``` - - Returns the ID of a node, whether or not it has been registered. - -**Parameters** -* `nodeType` (*enum NodeDefinition.NodeType*) - The nodeType assigned to this node. -* `parameters` (*bytes*) - The parameters assigned to this node. -* `parents` (*bytes32[]*) - The parents assigned to this node. - -**Returns** -* `nodeId` (*bytes32*) - The id of the node. -#### getNode - - ```solidity - function getNode(bytes32 nodeId) external pure returns (struct NodeDefinition.Data node) - ``` - - Returns a node's definition (type, parameters, and parents) - -**Parameters** -* `nodeId` (*bytes32*) - The node ID - -**Returns** -* `node` (*struct NodeDefinition.Data*) - The node's definition data -#### process - - ```solidity - function process(bytes32 nodeId) external view returns (struct NodeOutput.Data node) - ``` - - Returns a node current output data - -**Parameters** -* `nodeId` (*bytes32*) - The node ID - -**Returns** -* `node` (*struct NodeOutput.Data*) - The node's output data - -#### NodeRegistered - - ```solidity - event NodeRegistered(bytes32 nodeId, enum NodeDefinition.NodeType nodeType, bytes parameters, bytes32[] parents) - ``` - - Emitted when `registerNode` is called. - -**Parameters** -* `nodeId` (*bytes32*) - The id of the registered node. -* `nodeType` (*enum NodeDefinition.NodeType*) - The nodeType assigned to this node. -* `parameters` (*bytes*) - The parameters assigned to this node. -* `parents` (*bytes32[]*) - The parents assigned to this node. - -### ChainlinkNode - -#### process - - ```solidity - function process(bytes parameters) internal view returns (struct NodeOutput.Data nodeOutput) - ``` - -#### getTwapPrice - - ```solidity - function getTwapPrice(contract IAggregatorV3Interface chainlink, uint80 latestRoundId, int256 latestPrice, uint256 twapTimeInterval) internal view returns (int256 price) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal view returns (bool valid) - ``` - -### ConstantNode - -#### process - - ```solidity - function process(bytes parameters) internal view returns (struct NodeOutput.Data nodeOutput) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal pure returns (bool valid) - ``` - -### ExternalNode - -#### process - - ```solidity - function process(struct NodeOutput.Data[] prices, bytes parameters) internal view returns (struct NodeOutput.Data nodeOutput) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal returns (bool valid) - ``` - -### PriceDeviationCircuitBreakerNode - -#### process - - ```solidity - function process(struct NodeOutput.Data[] parentNodeOutputs, bytes parameters) internal pure returns (struct NodeOutput.Data nodeOutput) - ``` - -#### abs - - ```solidity - function abs(int256 x) private pure returns (int256 result) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal pure returns (bool valid) - ``` - -### PythNode - -#### process - - ```solidity - function process(bytes parameters) internal view returns (struct NodeOutput.Data nodeOutput) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal view returns (bool valid) - ``` - -### ReducerNode - -#### process - - ```solidity - function process(struct NodeOutput.Data[] parentNodeOutputs, bytes parameters) internal pure returns (struct NodeOutput.Data nodeOutput) - ``` - -#### median - - ```solidity - function median(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data medianPrice) - ``` - -#### mean - - ```solidity - function mean(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data meanPrice) - ``` - -#### recent - - ```solidity - function recent(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data recentPrice) - ``` - -#### max - - ```solidity - function max(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data maxPrice) - ``` - -#### min - - ```solidity - function min(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data minPrice) - ``` - -#### mul - - ```solidity - function mul(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data mulPrice) - ``` - -#### div - - ```solidity - function div(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data divPrice) - ``` - -#### quickSort - - ```solidity - function quickSort(struct NodeOutput.Data[] arr, int256 left, int256 right) internal pure - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal pure returns (bool valid) - ``` - -### StalenessCircuitBreakerNode - -#### process - - ```solidity - function process(struct NodeOutput.Data[] parentNodeOutputs, bytes parameters) internal view returns (struct NodeOutput.Data nodeOutput) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal pure returns (bool valid) - ``` - -### UniswapNode - -#### process - - ```solidity - function process(bytes parameters) internal view returns (struct NodeOutput.Data nodeOutput) - ``` - -#### getQuoteAtTick - - ```solidity - function getQuoteAtTick(int24 tick, uint256 baseAmount, address baseToken, address quoteToken) internal pure returns (uint256 quoteAmount) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal view returns (bool valid) - ``` - diff --git a/markets/legacy-market/package.json b/markets/legacy-market/package.json index 108c2cd2c6..508bfed5c1 100644 --- a/markets/legacy-market/package.json +++ b/markets/legacy-market/package.json @@ -11,7 +11,7 @@ "clean": "hardhat clean", "compile-contracts": "hardhat compile", "size-contracts": "hardhat compile && hardhat size-contracts", - "docgen": "echo SKIP SKIP SKIP || hardhat docgen" + "docgen": "hardhat docgen" }, "keywords": [], "author": "", diff --git a/markets/perps-market/docs/index.md b/markets/perps-market/docs/index.md deleted file mode 100644 index 3cba695af6..0000000000 --- a/markets/perps-market/docs/index.md +++ /dev/null @@ -1,1115 +0,0 @@ -### Async Order Module - -#### commitOrder - - ```solidity - function commitOrder(struct AsyncOrder.OrderCommitmentRequest commitment) external returns (struct AsyncOrder.Data retOrder, uint256 fees) - ``` - - Commit an async order via this function - -**Parameters** -* `commitment` (*struct AsyncOrder.OrderCommitmentRequest*) - Order commitment data (see AsyncOrder.OrderCommitmentRequest struct). - -**Returns** -* `retOrder` (*struct AsyncOrder.Data*) - order details (see AsyncOrder.Data struct). -* `fees` (*uint256*) - order fees (protocol + settler) -#### getOrder - - ```solidity - function getOrder(uint128 accountId) external returns (struct AsyncOrder.Data order) - ``` - - Get async order claim details - -**Parameters** -* `accountId` (*uint128*) - id of the account. - -**Returns** -* `order` (*struct AsyncOrder.Data*) - async order claim details (see AsyncOrder.Data struct). -#### computeOrderFees - - ```solidity - function computeOrderFees(uint128 marketId, int128 sizeDelta) external view returns (uint256 orderFees, uint256 fillPrice) - ``` - - Simulates what the order fee would be for the given market with the specified size. - - Note that this does not include the settlement reward fee, which is based on the strategy type used - -**Parameters** -* `marketId` (*uint128*) - id of the market. -* `sizeDelta` (*int128*) - size of position. - -**Returns** -* `orderFees` (*uint256*) - incurred fees. -* `fillPrice` (*uint256*) - price at which the order would be filled. -#### requiredMarginForOrder - - ```solidity - function requiredMarginForOrder(uint128 marketId, uint128 accountId, int128 sizeDelta) external view returns (uint256 requiredMargin) - ``` - - For a given market, account id, and a position size, returns the required total account margin for this order to succeed - - Useful for integrators to determine if an order will succeed or fail - -**Parameters** -* `marketId` (*uint128*) - id of the market. -* `accountId` (*uint128*) - id of the trader account. -* `sizeDelta` (*int128*) - size of position. - -**Returns** -* `requiredMargin` (*uint256*) - margin required for the order to succeed. - -#### OrderCommitted - - ```solidity - event OrderCommitted(uint128 marketId, uint128 accountId, enum SettlementStrategy.Type orderType, int128 sizeDelta, uint256 acceptablePrice, uint256 settlementTime, uint256 expirationTime, bytes32 trackingCode, address sender) - ``` - - Gets fired when a new order is committed. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `accountId` (*uint128*) - Id of the account used for the trade. -* `orderType` (*enum SettlementStrategy.Type*) - Should send 0 (at time of writing) that correlates to the transaction type enum defined in SettlementStrategy.Type. -* `sizeDelta` (*int128*) - requested change in size of the order sent by the user. -* `acceptablePrice` (*uint256*) - maximum or minimum, depending on the sizeDelta direction, accepted price to settle the order, set by the user. -* `settlementTime` (*uint256*) - Time at which the order can be settled. -* `expirationTime` (*uint256*) - Time at which the order expired. -* `trackingCode` (*bytes32*) - Optional code for integrator tracking purposes. -* `sender` (*address*) - address of the sender of the order. Authorized to commit by account owner. - -#### PreviousOrderExpired - - ```solidity - event PreviousOrderExpired(uint128 marketId, uint128 accountId, int128 sizeDelta, uint256 acceptablePrice, uint256 settlementTime, bytes32 trackingCode) - ``` - - Gets fired when a new order is committed while a previous one was expired. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `accountId` (*uint128*) - Id of the account used for the trade. -* `sizeDelta` (*int128*) - requested change in size of the order sent by the user. -* `acceptablePrice` (*uint256*) - maximum or minimum, depending on the sizeDelta direction, accepted price to settle the order, set by the user. -* `settlementTime` (*uint256*) - Time at which the order can be settled. -* `trackingCode` (*bytes32*) - Optional code for integrator tracking purposes. - -### Async Order Settlement Module - -#### settle - - ```solidity - function settle(uint128 accountId) external view - ``` - - Settles an offchain order. It's expected to revert with the OffchainLookup error with the data needed to perform the offchain lookup. - -**Parameters** -* `accountId` (*uint128*) - Id of the account used for the trade. - -#### settlePythOrder - - ```solidity - function settlePythOrder(bytes result, bytes extraData) external payable - ``` - - Settles an offchain order using the offchain retrieved data from pyth. - -**Parameters** -* `result` (*bytes*) - the blob of data retrieved offchain. -* `extraData` (*bytes*) - Extra data from OffchainLookupData. - -#### OrderSettled - - ```solidity - event OrderSettled(uint128 marketId, uint128 accountId, uint256 fillPrice, int256 pnl, int256 accruedFunding, int128 sizeDelta, int128 newSize, uint256 totalFees, uint256 referralFees, uint256 collectedFees, uint256 settlementReward, bytes32 trackingCode, address settler) - ``` - - Gets fired when a new order is settled. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `accountId` (*uint128*) - Id of the account used for the trade. -* `fillPrice` (*uint256*) - Price at which the order was settled. -* `pnl` (*int256*) - Pnl of the previous closed position. -* `accruedFunding` (*int256*) - Accrued funding of the previous closed position. -* `sizeDelta` (*int128*) - Size delta from order. -* `newSize` (*int128*) - New size of the position after settlement. -* `totalFees` (*uint256*) - Amount of fees collected by the protocol. -* `referralFees` (*uint256*) - Amount of fees collected by the referrer. -* `collectedFees` (*uint256*) - Amount of fees collected by fee collector. -* `settlementReward` (*uint256*) - Amount of fees collected by the settler. -* `trackingCode` (*bytes32*) - Optional code for integrator tracking purposes. -* `settler` (*address*) - address of the settler of the order. - -### Collateral Module - -#### setMaxCollateralAmount - - ```solidity - function setMaxCollateralAmount(uint128 synthMarketId, uint256 collateralAmount) external - ``` - - Set the max collateral amoutn via this function - -**Parameters** -* `synthMarketId` (*uint128*) - Synth market id, 0 for snxUSD. -* `collateralAmount` (*uint256*) - max amount that for the synth - -#### MaxCollateralSet - - ```solidity - event MaxCollateralSet(uint128 synthMarketId, uint256 collateralAmount) - ``` - - Gets fired when max collateral amount for synth collateral for the system is set by owner. - -**Parameters** -* `synthMarketId` (*uint128*) - Synth market id, 0 for snxUSD. -* `collateralAmount` (*uint256*) - max amount that was set for the synth - -### Global Perps Market Module - -#### setMaxCollateralAmount - - ```solidity - function setMaxCollateralAmount(uint128 synthMarketId, uint256 collateralAmount) external - ``` - - Sets the max collateral amount for a specific synth market. - -**Parameters** -* `synthMarketId` (*uint128*) - Synth market id, 0 for snxUSD. -* `collateralAmount` (*uint256*) - Max collateral amount to set for the synth market id. - -#### getMaxCollateralAmount - - ```solidity - function getMaxCollateralAmount(uint128 synthMarketId) external view returns (uint256) - ``` - - Gets the max collateral amount for a specific synth market. - -**Parameters** -* `synthMarketId` (*uint128*) - Synth market id, 0 for snxUSD. - -**Returns** -* `[0]` (*uint256*) - maxCollateralAmount max collateral amount of the specified synth market id -#### setSynthDeductionPriority - - ```solidity - function setSynthDeductionPriority(uint128[] newSynthDeductionPriority) external - ``` - - Sets the synth deduction priority ordered list. - - The synth deduction priority is used to determine the order in which synths are deducted from an account. Id 0 is snxUSD and should be first in the list. - -**Parameters** -* `newSynthDeductionPriority` (*uint128[]*) - Ordered array of synth market ids for deduction priority. - -#### getSynthDeductionPriority - - ```solidity - function getSynthDeductionPriority() external view returns (uint128[]) - ``` - - Gets the synth deduction priority ordered list. - - The synth deduction priority is used to determine the order in which synths are deducted from an account. Id 0 is snxUSD and should be first in the list. - -**Returns** -* `[0]` (*uint128[]*) - synthDeductionPriority Ordered array of synth market ids for deduction priority. -#### setLiquidationRewardGuards - - ```solidity - function setLiquidationRewardGuards(uint256 minLiquidationRewardUsd, uint256 maxLiquidationRewardUsd) external - ``` - - Sets the liquidation reward guard (min and max). - -**Parameters** -* `minLiquidationRewardUsd` (*uint256*) - Minimum liquidation reward expressed as USD value. -* `maxLiquidationRewardUsd` (*uint256*) - Maximum liquidation reward expressed as USD value. - -#### getLiquidationRewardGuards - - ```solidity - function getLiquidationRewardGuards() external view returns (uint256 minLiquidationRewardUsd, uint256 maxLiquidationRewardUsd) - ``` - - Gets the liquidation reward guard (min and max). - -**Returns** -* `minLiquidationRewardUsd` (*uint256*) - Minimum liquidation reward expressed as USD value. -* `maxLiquidationRewardUsd` (*uint256*) - Maximum liquidation reward expressed as USD value. -#### totalGlobalCollateralValue - - ```solidity - function totalGlobalCollateralValue() external view returns (uint256 totalCollateralValue) - ``` - - Gets the total collateral value of all deposited collateral from all traders. - -**Returns** -* `totalCollateralValue` (*uint256*) - value of all collateral -#### setFeeCollector - - ```solidity - function setFeeCollector(address feeCollector) external - ``` - - Sets the fee collector contract. - - must conform to the IFeeCollector interface - -**Parameters** -* `feeCollector` (*address*) - address of the fee collector contract - -#### getFeeCollector - - ```solidity - function getFeeCollector() external view returns (address feeCollector) - ``` - - Gets the configured feeCollector contract - -**Returns** -* `feeCollector` (*address*) - address of the fee collector contract -#### updateReferrerShare - - ```solidity - function updateReferrerShare(address referrer, uint256 shareRatioD18) external - ``` - - Update the referral share percentage for a referrer - -**Parameters** -* `referrer` (*address*) - The address of the referrer -* `shareRatioD18` (*uint256*) - The new share percentage for the referrer - -#### getReferrerShare - - ```solidity - function getReferrerShare(address referrer) external returns (uint256 shareRatioD18) - ``` - - get the referral share percentage for the specified referrer - -**Parameters** -* `referrer` (*address*) - The address of the referrer - -**Returns** -* `shareRatioD18` (*uint256*) - The configured share percentage for the referrer -#### getMarkets - - ```solidity - function getMarkets() external returns (uint256[] marketIds) - ``` - - get all existing market ids - -**Returns** -* `marketIds` (*uint256[]*) - an array of existing market ids - -#### MaxCollateralAmountSet - - ```solidity - event MaxCollateralAmountSet(uint128 synthMarketId, uint256 collateralAmount) - ``` - - Gets fired when max collateral amount for synth for all the markets is set by owner. - -**Parameters** -* `synthMarketId` (*uint128*) - Synth market id, 0 for snxUSD. -* `collateralAmount` (*uint256*) - max amount that was set for the synth - -#### SynthDeductionPrioritySet - - ```solidity - event SynthDeductionPrioritySet(uint128[] newSynthDeductionPriority) - ``` - - Gets fired when the synth deduction priority is updated by owner. - -**Parameters** -* `newSynthDeductionPriority` (*uint128[]*) - new synth id priority order for deductions. - -#### LiquidationRewardGuardsSet - - ```solidity - event LiquidationRewardGuardsSet(uint256 minLiquidationRewardUsd, uint256 maxLiquidationRewardUsd) - ``` - - Gets fired when liquidation reward guard is set or updated. - -**Parameters** -* `minLiquidationRewardUsd` (*uint256*) - Minimum liquidation reward expressed as USD value. -* `maxLiquidationRewardUsd` (*uint256*) - Maximum liquidation reward expressed as USD value. - -#### FeeCollectorSet - - ```solidity - event FeeCollectorSet(address feeCollector) - ``` - - emitted when custom fee collector is set - -**Parameters** -* `feeCollector` (*address*) - the address of the fee collector to set. - -#### ReferrerShareUpdated - - ```solidity - event ReferrerShareUpdated(address referrer, uint256 shareRatioD18) - ``` - - Emitted when the share percentage for a referrer address has been updated. - -**Parameters** -* `referrer` (*address*) - The address of the referrer -* `shareRatioD18` (*uint256*) - The new share ratio for the referrer - -### Liquidation Module - -#### liquidate - - ```solidity - function liquidate(uint128 accountId) external - ``` - - Liquidates an account. - - according to the current situation and account size it can be a partial or full liquidation. - -**Parameters** -* `accountId` (*uint128*) - Id of the account to liquidate. - -#### liquidateFlagged - - ```solidity - function liquidateFlagged() external - ``` - - Liquidates all flagged accounts. - -#### PositionLiquidated - - ```solidity - event PositionLiquidated(uint128 accountId, uint128 marketId, uint256 amountLiquidated, int128 currentPositionSize) - ``` - - Gets fired when an account position is liquidated . - -**Parameters** -* `accountId` (*uint128*) - Id of the account liquidated. -* `marketId` (*uint128*) - Id of the position's market. -* `amountLiquidated` (*uint256*) - amount liquidated. -* `currentPositionSize` (*int128*) - position size after liquidation. - -#### AccountLiquidated - - ```solidity - event AccountLiquidated(uint128 accountId, uint256 reward, bool fullLiquidation) - ``` - - Gets fired when an account is liquidated. - - this event is fired once per liquidation tx after the each position that can be liquidated at the time was liquidated. - -**Parameters** -* `accountId` (*uint128*) - Id of the account liquidated. -* `reward` (*uint256*) - total reward sent to liquidator. -* `fullLiquidation` (*bool*) - flag indicating if it was a partial or full liquidation. - -### Market Configuration Module - -#### addSettlementStrategy - - ```solidity - function addSettlementStrategy(uint128 marketId, struct SettlementStrategy.Data strategy) external returns (uint256 strategyId) - ``` - - Add a new settlement strategy with this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market to add the settlement strategy. -* `strategy` (*struct SettlementStrategy.Data*) - strategy details (see SettlementStrategy.Data struct). - -**Returns** -* `strategyId` (*uint256*) - id of the new settlement strategy. -#### setOrderFees - - ```solidity - function setOrderFees(uint128 marketId, uint256 makerFeeRatio, uint256 takerFeeRatio) external - ``` - - Set order fees for a market with this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market to set order fees. -* `makerFeeRatio` (*uint256*) - the maker fee ratio. -* `takerFeeRatio` (*uint256*) - the taker fee ratio. - -#### updatePriceData - - ```solidity - function updatePriceData(uint128 perpsMarketId, bytes32 feedId) external - ``` - - Set node id for perps market - -**Parameters** -* `perpsMarketId` (*uint128*) - id of the market to set price feed. -* `feedId` (*bytes32*) - the node feed id - -#### setFundingParameters - - ```solidity - function setFundingParameters(uint128 marketId, uint256 skewScale, uint256 maxFundingVelocity) external - ``` - - Set funding parameters for a market with this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market to set funding parameters. -* `skewScale` (*uint256*) - the skew scale. -* `maxFundingVelocity` (*uint256*) - the max funding velocity. - -#### setLiquidationParameters - - ```solidity - function setLiquidationParameters(uint128 marketId, uint256 initialMarginRatioD18, uint256 minimumInitialMarginRatioD18, uint256 maintenanceMarginScalarD18, uint256 liquidationRewardRatioD18, uint256 maxLiquidationLimitAccumulationMultiplier, uint256 maxSecondsInLiquidationWindow, uint256 minimumPositionMargin) external - ``` - - Set liquidation parameters for a market with this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market to set liquidation parameters. -* `initialMarginRatioD18` (*uint256*) - the initial margin ratio (as decimal with 18 digits precision). -* `minimumInitialMarginRatioD18` (*uint256*) - the minimum initial margin ratio (as decimal with 18 digits precision). -* `maintenanceMarginScalarD18` (*uint256*) - the maintenance margin scalar relative to the initial margin ratio (as decimal with 18 digits precision). -* `liquidationRewardRatioD18` (*uint256*) - the liquidation reward ratio (as decimal with 18 digits precision). -* `maxLiquidationLimitAccumulationMultiplier` (*uint256*) - the max liquidation limit accumulation multiplier. -* `maxSecondsInLiquidationWindow` (*uint256*) - the max seconds in liquidation window (used together with the acc multiplier to get max liquidation per window). -* `minimumPositionMargin` (*uint256*) - the minimum position margin. - -#### setMaxMarketSize - - ```solidity - function setMaxMarketSize(uint128 marketId, uint256 maxMarketSize) external - ``` - - Set the max size of an specific market with this function. - - This controls the maximum open interest a market can have on either side (Long | Short). So the total Open Interest (with zero skew) for a market can be up to max market size * 2. - -**Parameters** -* `marketId` (*uint128*) - id of the market to set the max market value. -* `maxMarketSize` (*uint256*) - the max market size in market asset units. - -#### setLockedOiRatio - - ```solidity - function setLockedOiRatio(uint128 marketId, uint256 lockedOiRatioD18) external - ``` - - Set the locked OI Ratio for a market with this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market to set locked OI ratio. -* `lockedOiRatioD18` (*uint256*) - the locked OI ratio skew scale (as decimal with 18 digits precision). - -#### setSettlementStrategyEnabled - - ```solidity - function setSettlementStrategyEnabled(uint128 marketId, uint256 strategyId, bool enabled) external - ``` - - Enable or disable a settlement strategy for a market with this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market. -* `strategyId` (*uint256*) - the specific strategy. -* `enabled` (*bool*) - whether the strategy is enabled or disabled. - -#### getSettlementStrategy - - ```solidity - function getSettlementStrategy(uint128 marketId, uint256 strategyId) external view returns (struct SettlementStrategy.Data settlementStrategy) - ``` - - Gets the settlement strategy details. - -**Parameters** -* `marketId` (*uint128*) - id of the market. -* `strategyId` (*uint256*) - id of the settlement strategy. - -**Returns** -* `settlementStrategy` (*struct SettlementStrategy.Data*) - strategy details (see SettlementStrategy.Data struct). -#### getLiquidationParameters - - ```solidity - function getLiquidationParameters(uint128 marketId) external view returns (uint256 initialMarginRatioD18, uint256 minimumInitialMarginRatioD18, uint256 maintenanceMarginScalarD18, uint256 liquidationRewardRatioD18, uint256 maxLiquidationLimitAccumulationMultiplier, uint256 maxSecondsInLiquidationWindow, uint256 minimumPositionMargin) - ``` - - Gets liquidation parameters details of a market. - -**Parameters** -* `marketId` (*uint128*) - id of the market. - -**Returns** -* `initialMarginRatioD18` (*uint256*) - the initial margin ratio (as decimal with 18 digits precision). -* `minimumInitialMarginRatioD18` (*uint256*) - the minimum initial margin ratio (as decimal with 18 digits precision). -* `maintenanceMarginScalarD18` (*uint256*) - the maintenance margin scalar relative to the initial margin ratio (as decimal with 18 digits precision). -* `liquidationRewardRatioD18` (*uint256*) - the liquidation reward ratio (as decimal with 18 digits precision). -* `maxLiquidationLimitAccumulationMultiplier` (*uint256*) - the max liquidation limit accumulation multiplier. -* `maxSecondsInLiquidationWindow` (*uint256*) - the max seconds in liquidation window (used together with the acc multiplier to get max liquidation per window). -* `minimumPositionMargin` (*uint256*) - the minimum position margin. -#### getFundingParameters - - ```solidity - function getFundingParameters(uint128 marketId) external view returns (uint256 skewScale, uint256 maxFundingVelocity) - ``` - - Gets funding parameters of a market. - -**Parameters** -* `marketId` (*uint128*) - id of the market. - -**Returns** -* `skewScale` (*uint256*) - the skew scale. -* `maxFundingVelocity` (*uint256*) - the max funding velocity. -#### getMaxMarketSize - - ```solidity - function getMaxMarketSize(uint128 marketId) external view returns (uint256 maxMarketSize) - ``` - - Gets the max size of an specific market. - -**Parameters** -* `marketId` (*uint128*) - id of the market. - -**Returns** -* `maxMarketSize` (*uint256*) - the max market size in market asset units. -#### getOrderFees - - ```solidity - function getOrderFees(uint128 marketId) external view returns (uint256 makerFeeRatio, uint256 takerFeeRatio) - ``` - - Gets the order fees of a market. - -**Parameters** -* `marketId` (*uint128*) - id of the market. - -**Returns** -* `makerFeeRatio` (*uint256*) - the maker fee ratio. -* `takerFeeRatio` (*uint256*) - the taker fee ratio. -#### getLockedOiRatio - - ```solidity - function getLockedOiRatio(uint128 marketId) external view returns (uint256 lockedOiRatioD18) - ``` - - Gets the locked OI ratio of a market. - -**Parameters** -* `marketId` (*uint128*) - id of the market. - -**Returns** -* `lockedOiRatioD18` (*uint256*) - the locked OI ratio skew scale (as decimal with 18 digits precision). - -#### SettlementStrategyAdded - - ```solidity - event SettlementStrategyAdded(uint128 marketId, struct SettlementStrategy.Data strategy, uint256 strategyId) - ``` - - Gets fired when new settlement strategy is added. - -**Parameters** -* `marketId` (*uint128*) - adds settlement strategy to this specific market. -* `strategy` (*struct SettlementStrategy.Data*) - the strategy configuration. -* `strategyId` (*uint256*) - the newly created settlement strategy id. - -#### MarketPriceDataUpdated - - ```solidity - event MarketPriceDataUpdated(uint128 marketId, bytes32 feedId) - ``` - - Gets fired when feed id for perps market is updated. - -**Parameters** -* `marketId` (*uint128*) - id of perps market -* `feedId` (*bytes32*) - oracle node id - -#### OrderFeesSet - - ```solidity - event OrderFeesSet(uint128 marketId, uint256 makerFeeRatio, uint256 takerFeeRatio) - ``` - - Gets fired when order fees are updated. - -**Parameters** -* `marketId` (*uint128*) - udpates fees to this specific market. -* `makerFeeRatio` (*uint256*) - the maker fee ratio. -* `takerFeeRatio` (*uint256*) - the taker fee ratio. - -#### FundingParametersSet - - ```solidity - event FundingParametersSet(uint128 marketId, uint256 skewScale, uint256 maxFundingVelocity) - ``` - - Gets fired when funding parameters are updated. - -**Parameters** -* `marketId` (*uint128*) - udpates funding parameters to this specific market. -* `skewScale` (*uint256*) - the skew scale. -* `maxFundingVelocity` (*uint256*) - the max funding velocity. - -#### LiquidationParametersSet - - ```solidity - event LiquidationParametersSet(uint128 marketId, uint256 initialMarginRatioD18, uint256 maintenanceMarginRatioD18, uint256 minimumInitialMarginRatioD18, uint256 liquidationRewardRatioD18, uint256 maxLiquidationLimitAccumulationMultiplier, uint256 maxSecondsInLiquidationWindow, uint256 minimumPositionMargin) - ``` - - Gets fired when liquidation parameters are updated. - -**Parameters** -* `marketId` (*uint128*) - udpates funding parameters to this specific market. -* `initialMarginRatioD18` (*uint256*) - the initial margin ratio (as decimal with 18 digits precision). -* `maintenanceMarginRatioD18` (*uint256*) - the maintenance margin ratio (as decimal with 18 digits precision). -* `minimumInitialMarginRatioD18` (*uint256*) - -* `liquidationRewardRatioD18` (*uint256*) - the liquidation reward ratio (as decimal with 18 digits precision). -* `maxLiquidationLimitAccumulationMultiplier` (*uint256*) - the max liquidation limit accumulation multiplier. -* `maxSecondsInLiquidationWindow` (*uint256*) - the max seconds in liquidation window (used together with the acc multiplier to get max liquidation per window). -* `minimumPositionMargin` (*uint256*) - the minimum position margin. - -#### MaxMarketSizeSet - - ```solidity - event MaxMarketSizeSet(uint128 marketId, uint256 maxMarketSize) - ``` - - Gets fired when max market value is updated. - -**Parameters** -* `marketId` (*uint128*) - udpates funding parameters to this specific market. -* `maxMarketSize` (*uint256*) - the max market value. - -#### LockedOiRatioSet - - ```solidity - event LockedOiRatioSet(uint128 marketId, uint256 lockedOiRatioD18) - ``` - - Gets fired when locked oi ratio is updated. - -**Parameters** -* `marketId` (*uint128*) - udpates funding parameters to this specific market. -* `lockedOiRatioD18` (*uint256*) - the locked OI ratio skew scale (as decimal with 18 digits precision). - -#### SettlementStrategyEnabled - - ```solidity - event SettlementStrategyEnabled(uint128 marketId, uint256 strategyId, bool enabled) - ``` - - Gets fired when a settlement strategy is enabled or disabled. - -**Parameters** -* `marketId` (*uint128*) - udpates funding parameters to this specific market. -* `strategyId` (*uint256*) - the specific strategy. -* `enabled` (*bool*) - whether the strategy is enabled or disabled. - -### IMarketEvents - -#### MarketUpdated - - ```solidity - event MarketUpdated(uint128 marketId, uint256 price, int256 skew, uint256 size, int256 sizeDelta, int256 currentFundingRate, int256 currentFundingVelocity) - ``` - - Gets fired when the size of a market is updated by new orders or liquidations. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `price` (*uint256*) - Price at the time of this event. -* `skew` (*int256*) - Market skew at the time of the trade. Positive values mean more longs. -* `size` (*uint256*) - Size of the entire market after settlement. -* `sizeDelta` (*int256*) - Change in market size during this update. -* `currentFundingRate` (*int256*) - The current funding rate of this market (0.001 = 0.1% per day) -* `currentFundingVelocity` (*int256*) - The current rate of change of the funding rate (0.001 = +0.1% per day) - -### Perps Account Module - -#### modifyCollateral - - ```solidity - function modifyCollateral(uint128 accountId, uint128 synthMarketId, int256 amountDelta) external - ``` - - Modify the collateral delegated to the account. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. -* `synthMarketId` (*uint128*) - Id of the synth market used as collateral. Synth market id, 0 for snxUSD. -* `amountDelta` (*int256*) - requested change in amount of collateral delegated to the account. - -#### getCollateralAmount - - ```solidity - function getCollateralAmount(uint128 accountId, uint128 synthMarketId) external view returns (uint256) - ``` - - Gets the account's collateral value for a specific collateral. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. -* `synthMarketId` (*uint128*) - Id of the synth market used as collateral. Synth market id, 0 for snxUSD. - -**Returns** -* `[0]` (*uint256*) - collateralValue collateral value of the account. -#### totalCollateralValue - - ```solidity - function totalCollateralValue(uint128 accountId) external view returns (uint256) - ``` - - Gets the account's total collateral value. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. - -**Returns** -* `[0]` (*uint256*) - collateralValue total collateral value of the account. USD denominated. -#### totalAccountOpenInterest - - ```solidity - function totalAccountOpenInterest(uint128 accountId) external view returns (uint256) - ``` - - Gets the account's total open interest value. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. - -**Returns** -* `[0]` (*uint256*) - openInterestValue total open interest value of the account. -#### getOpenPosition - - ```solidity - function getOpenPosition(uint128 accountId, uint128 marketId) external view returns (int256 totalPnl, int256 accruedFunding, int128 positionSize) - ``` - - Gets the details of an open position. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. -* `marketId` (*uint128*) - Id of the position market. - -**Returns** -* `totalPnl` (*int256*) - pnl of the entire position including funding. -* `accruedFunding` (*int256*) - accrued funding of the position. -* `positionSize` (*int128*) - size of the position. -#### getAvailableMargin - - ```solidity - function getAvailableMargin(uint128 accountId) external view returns (int256 availableMargin) - ``` - - Gets the available margin of an account. It can be negative due to pnl. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. - -**Returns** -* `availableMargin` (*int256*) - available margin of the position. -#### getWithdrawableMargin - - ```solidity - function getWithdrawableMargin(uint128 accountId) external view returns (int256 withdrawableMargin) - ``` - - Gets the exact withdrawable amount a trader has available from this account while holding the account's current positions. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. - -**Returns** -* `withdrawableMargin` (*int256*) - available margin to withdraw. -#### getRequiredMargins - - ```solidity - function getRequiredMargins(uint128 accountId) external view returns (uint256 requiredInitialMargin, uint256 requiredMaintenanceMargin, uint256 totalAccumulatedLiquidationRewards, uint256 maxLiquidationReward) - ``` - - Gets the initial/maintenance margins across all positions that an account has open. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. - -**Returns** -* `requiredInitialMargin` (*uint256*) - initial margin req (used when withdrawing collateral). -* `requiredMaintenanceMargin` (*uint256*) - maintenance margin req (used to determine liquidation threshold). -* `totalAccumulatedLiquidationRewards` (*uint256*) - sum of all liquidation rewards of if all account open positions were to be liquidated fully. -* `maxLiquidationReward` (*uint256*) - max liquidation reward the keeper would receive if account was fully liquidated. Note here that the accumulated rewards are checked against the global max/min configured liquidation rewards. - -#### CollateralModified - - ```solidity - event CollateralModified(uint128 accountId, uint128 synthMarketId, int256 amountDelta, address sender) - ``` - - Gets fired when an account colateral is modified. - -**Parameters** -* `accountId` (*uint128*) - Id of the account. -* `synthMarketId` (*uint128*) - Id of the synth market used as collateral. Synth market id, 0 for snxUSD. -* `amountDelta` (*int256*) - requested change in amount of collateral delegated to the account. -* `sender` (*address*) - address of the sender of the size modification. Authorized by account owner. - -### Perps Market Factory Module - -#### initializeFactory - - ```solidity - function initializeFactory() external returns (uint128) - ``` - - Initializes the factory. - - this function should be called only once. - -**Returns** -* `[0]` (*uint128*) - globalPerpsMarketId Id of the global perps market id. -#### setSynthetix - - ```solidity - function setSynthetix(contract ISynthetixSystem synthetix) external - ``` - - Sets the synthetix system. - -**Parameters** -* `synthetix` (*contract ISynthetixSystem*) - address of the main synthetix proxy. - -#### setSpotMarket - - ```solidity - function setSpotMarket(contract ISpotMarketSystem spotMarket) external - ``` - - Sets the spot market system. - -**Parameters** -* `spotMarket` (*contract ISpotMarketSystem*) - address of the spot market proxy. - -#### createMarket - - ```solidity - function createMarket(uint128 requestedMarketId, string marketName, string marketSymbol) external returns (uint128) - ``` - - Creates a new market. - -**Parameters** -* `requestedMarketId` (*uint128*) - id of the market to create. -* `marketName` (*string*) - name of the market to create. -* `marketSymbol` (*string*) - symbol of the market to create. - -**Returns** -* `[0]` (*uint128*) - perpsMarketId Id of the created perps market. -#### name - - ```solidity - function name(uint128 marketId) external view returns (string) - ``` - - returns a human-readable name for a given market - -#### reportedDebt - - ```solidity - function reportedDebt(uint128 marketId) external view returns (uint256) - ``` - - returns amount of USD that the market would try to mint if everything was withdrawn - -#### minimumCredit - - ```solidity - function minimumCredit(uint128 marketId) external view returns (uint256) - ``` - - prevents reduction of available credit capacity by specifying this amount, for which withdrawals will be disallowed - -#### supportsInterface - - ```solidity - function supportsInterface(bytes4 interfaceID) external view returns (bool) - ``` - - Determines if the contract in question supports the specified interface. - -**Parameters** -* `interfaceID` (*bytes4*) - XOR of all selectors in the contract. - -**Returns** -* `[0]` (*bool*) - True if the contract supports the specified interface. - -#### FactoryInitialized - - ```solidity - event FactoryInitialized(uint128 globalPerpsMarketId) - ``` - - Gets fired when the factory is initialized. - -**Parameters** -* `globalPerpsMarketId` (*uint128*) - the new global perps market id. - -#### MarketCreated - - ```solidity - event MarketCreated(uint128 perpsMarketId, string marketName, string marketSymbol) - ``` - - Gets fired when a market is created. - -**Parameters** -* `perpsMarketId` (*uint128*) - the newly created perps market id. -* `marketName` (*string*) - the newly created perps market name. -* `marketSymbol` (*string*) - the newly created perps market symbol. - -### Perps Market Module - -#### metadata - - ```solidity - function metadata(uint128 marketId) external view returns (string name, string symbol) - ``` - - Gets a market metadata. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `name` (*string*) - Name of the market. -* `symbol` (*string*) - Symbol of the market. -#### skew - - ```solidity - function skew(uint128 marketId) external view returns (int256) - ``` - - Gets a market's skew. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `[0]` (*int256*) - skew Skew of the market. -#### size - - ```solidity - function size(uint128 marketId) external view returns (uint256) - ``` - - Gets a market's size. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `[0]` (*uint256*) - size Size of the market. -#### maxOpenInterest - - ```solidity - function maxOpenInterest(uint128 marketId) external view returns (uint256) - ``` - - Gets a market's max open interest. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `[0]` (*uint256*) - maxOpenInterest Max open interest of the market. -#### currentFundingRate - - ```solidity - function currentFundingRate(uint128 marketId) external view returns (int256) - ``` - - Gets a market's current funding rate. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `[0]` (*int256*) - currentFundingRate Current funding rate of the market. -#### currentFundingVelocity - - ```solidity - function currentFundingVelocity(uint128 marketId) external view returns (int256) - ``` - - Gets a market's current funding velocity. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `[0]` (*int256*) - currentFundingVelocity Current funding velocity of the market. -#### indexPrice - - ```solidity - function indexPrice(uint128 marketId) external view returns (uint256) - ``` - - Gets a market's index price. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `[0]` (*uint256*) - indexPrice Index price of the market. -#### fillPrice - - ```solidity - function fillPrice(uint128 marketId, int128 orderSize, uint256 price) external returns (uint256) - ``` - - Gets a market's fill price for a specific order size and index price. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. -* `orderSize` (*int128*) - Order size. -* `price` (*uint256*) - Index price. - -**Returns** -* `[0]` (*uint256*) - price Fill price. -#### getMarketSummary - - ```solidity - function getMarketSummary(uint128 marketId) external view returns (struct IPerpsMarketModule.MarketSummary summary) - ``` - - Given a marketId return a market's summary details in one call. - -**Parameters** -* `marketId` (*uint128*) - Id of the market. - -**Returns** -* `summary` (*struct IPerpsMarketModule.MarketSummary*) - Market summary (see MarketSummary). - diff --git a/markets/spot-market/docs/index.md b/markets/spot-market/docs/index.md deleted file mode 100644 index 53d61a318c..0000000000 --- a/markets/spot-market/docs/index.md +++ /dev/null @@ -1,1449 +0,0 @@ -### Async Order Configuration Module - -#### addSettlementStrategy - - ```solidity - function addSettlementStrategy(uint128 synthMarketId, struct SettlementStrategy.Data strategy) external returns (uint256 strategyId) - ``` - - Adds new settlement strategy to the specified market id. - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market to associate the strategy with. -* `strategy` (*struct SettlementStrategy.Data*) - Settlement strategy data. see SettlementStrategy.Data struct. - -**Returns** -* `strategyId` (*uint256*) - newly created settlement strategy id. -#### setSettlementStrategyEnabled - - ```solidity - function setSettlementStrategyEnabled(uint128 synthMarketId, uint256 strategyId, bool enabled) external - ``` - - Sets the strategy to enabled or disabled. - - when disabled, the strategy will be invalid for committing of new async orders. - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market associated with the strategy. -* `strategyId` (*uint256*) - id of the strategy. -* `enabled` (*bool*) - set enabled/disabled. - -#### getSettlementStrategy - - ```solidity - function getSettlementStrategy(uint128 marketId, uint256 strategyId) external view returns (struct SettlementStrategy.Data settlementStrategy) - ``` - - Returns the settlement strategy data for given market/strategy id. - -**Parameters** -* `marketId` (*uint128*) - Id of the market associated with the strategy. -* `strategyId` (*uint256*) - id of the strategy. - -**Returns** -* `settlementStrategy` (*struct SettlementStrategy.Data*) - - -#### SettlementStrategyAdded - - ```solidity - event SettlementStrategyAdded(uint128 synthMarketId, uint256 strategyId) - ``` - - Gets fired when new settlement strategy is added. - -**Parameters** -* `synthMarketId` (*uint128*) - adds settlement strategy to this specific market. -* `strategyId` (*uint256*) - the newly created settlement strategy id. - -#### SettlementStrategyUpdated - - ```solidity - event SettlementStrategyUpdated(uint128 synthMarketId, uint256 strategyId, bool enabled) - ``` - - Gets fired when settlement strategy is enabled/disabled. - - currently only enabled/disabled flag can be updated. - -**Parameters** -* `synthMarketId` (*uint128*) - adds settlement strategy to this specific market. -* `strategyId` (*uint256*) - id of the strategy. -* `enabled` (*bool*) - true/false. - -### Async Order Module - -#### commitOrder - - ```solidity - function commitOrder(uint128 marketId, enum Transaction.Type orderType, uint256 amountProvided, uint256 settlementStrategyId, uint256 minimumSettlementAmount, address referrer) external returns (struct AsyncOrderClaim.Data asyncOrderClaim) - ``` - - Commit an async order via this function - - commitment transfers the amountProvided into the contract and escrows the funds until settlement. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `orderType` (*enum Transaction.Type*) - Should send either 2 or 3 which correlates to the transaction type enum defined in Transaction.Type. -* `amountProvided` (*uint256*) - amount of value provided by the user for trade. Should have enough allowance. -* `settlementStrategyId` (*uint256*) - id of the settlement strategy used for trade. -* `minimumSettlementAmount` (*uint256*) - minimum amount of value returned to trader after fees. -* `referrer` (*address*) - Optional address of the referrer, for fee share - -**Returns** -* `asyncOrderClaim` (*struct AsyncOrderClaim.Data*) - claim details (see AsyncOrderClaim.Data struct). -#### cancelOrder - - ```solidity - function cancelOrder(uint128 marketId, uint128 asyncOrderId) external - ``` - - Cancel an async order via this function - - cancellation transfers the amountProvided back to the trader without any fee collection -cancellation can only happen after the settlement time has passed -needs to satisfy commitmentTime + settlementDelay + settlementDuration < block.timestamp - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `asyncOrderId` (*uint128*) - id of the async order created during commitment. - -#### getAsyncOrderClaim - - ```solidity - function getAsyncOrderClaim(uint128 marketId, uint128 asyncOrderId) external view returns (struct AsyncOrderClaim.Data asyncOrderClaim) - ``` - - Get async order claim details - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `asyncOrderId` (*uint128*) - id of the async order created during commitment. - -**Returns** -* `asyncOrderClaim` (*struct AsyncOrderClaim.Data*) - claim details (see AsyncOrderClaim.Data struct). - -#### OrderCommitted - - ```solidity - event OrderCommitted(uint128 marketId, enum Transaction.Type orderType, uint256 amountProvided, uint128 asyncOrderId, address sender, address referrer) - ``` - - Gets fired when a new order is committed. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `orderType` (*enum Transaction.Type*) - Should send either 2 or 3 which correlates to the transaction type enum defined in Transaction.Type. -* `amountProvided` (*uint256*) - amount of value provided by the user for trade. -* `asyncOrderId` (*uint128*) - id of the async order created (used for settlements). -* `sender` (*address*) - trader address. -* `referrer` (*address*) - Optional address of the referrer, for fee share - -#### OrderCancelled - - ```solidity - event OrderCancelled(uint128 marketId, uint128 asyncOrderId, struct AsyncOrderClaim.Data asyncOrderClaim, address sender) - ``` - - Gets fired when an order is cancelled. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `asyncOrderId` (*uint128*) - id of the async order. -* `asyncOrderClaim` (*struct AsyncOrderClaim.Data*) - claim details (see AsyncOrderClaim.Data struct). -* `sender` (*address*) - trader address and also the receiver of the funds. - -### Async Order Settlement Module - -#### settleOrder - - ```solidity - function settleOrder(uint128 marketId, uint128 asyncOrderId) external returns (uint256 finalOrderAmount, struct OrderFees.Data) - ``` - - Settle already created async order via this function - - if the strategy is onchain, the settlement is done similar to an atomic buy except with settlement time -if the strategy is offchain, this function will revert with OffchainLookup error and the client should perform offchain lookup and call the callback specified see: EIP-3668 - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `asyncOrderId` (*uint128*) - id of the async order created during commitment. - -**Returns** -* `finalOrderAmount` (*uint256*) - amount returned to trader after fees. -* `[1]` (*struct OrderFees.Data*) - OrderFees.Data breakdown of all the fees incurred for the transaction. -#### settlePythOrder - - ```solidity - function settlePythOrder(bytes result, bytes extraData) external payable returns (uint256 finalOrderAmount, struct OrderFees.Data fees) - ``` - - Callback function for Pyth settlement strategy - - This is the selector specified as callback when settlement strategy is pyth offchain. -The data returned from the offchain lookup should be sent as "result" -The extraData is the same as the one sent during the offchain lookup revert error. It is used to retrieve the commitment claim. -this function expects ETH that is passed through to the Pyth contract for the fee it's charging. -To determine the fee, the client should first call getUpdateFee() from Pyth's verifier contract. - -**Parameters** -* `result` (*bytes*) - result returned from the offchain lookup. -* `extraData` (*bytes*) - extra data sent during the offchain lookup revert error. - -**Returns** -* `finalOrderAmount` (*uint256*) - amount returned to trader after fees. -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction. - -#### OrderSettled - - ```solidity - event OrderSettled(uint128 marketId, uint128 asyncOrderId, uint256 finalOrderAmount, struct OrderFees.Data fees, uint256 collectedFees, address settler, uint256 price, enum Transaction.Type orderType) - ``` - - Gets fired when an order is settled. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `asyncOrderId` (*uint128*) - id of the async order. -* `finalOrderAmount` (*uint256*) - amount returned to trader after fees. -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction. -* `collectedFees` (*uint256*) - fees collected by the configured fee collector. -* `settler` (*address*) - address that settled the order. -* `price` (*uint256*) - -* `orderType` (*enum Transaction.Type*) - - -### Atomic Order Module - -#### buyExactIn - - ```solidity - function buyExactIn(uint128 synthMarketId, uint256 amountUsd, uint256 minAmountReceived, address referrer) external returns (uint256 synthAmount, struct OrderFees.Data fees) - ``` - - Initiates a buy trade returning synth for the specified amountUsd. - - Transfers the specified amountUsd, collects fees through configured fee collector, returns synth to the trader. -Leftover fees not collected get deposited into the market manager to improve market PnL. -Uses the buyFeedId configured for the market. - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market used for the trade. -* `amountUsd` (*uint256*) - Amount of snxUSD trader is providing allowance for the trade. -* `minAmountReceived` (*uint256*) - Min Amount of synth is expected the trader to receive otherwise the transaction will revert. -* `referrer` (*address*) - Optional address of the referrer, for fee share - -**Returns** -* `synthAmount` (*uint256*) - Synth received on the trade based on amount provided by trader. -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction. -#### buy - - ```solidity - function buy(uint128 marketId, uint256 usdAmount, uint256 minAmountReceived, address referrer) external returns (uint256 synthAmount, struct OrderFees.Data fees) - ``` - - alias for buyExactIn - -**Parameters** -* `marketId` (*uint128*) - (see buyExactIn) -* `usdAmount` (*uint256*) - (see buyExactIn) -* `minAmountReceived` (*uint256*) - (see buyExactIn) -* `referrer` (*address*) - (see buyExactIn) - -**Returns** -* `synthAmount` (*uint256*) - (see buyExactIn) -* `fees` (*struct OrderFees.Data*) - (see buyExactIn) -#### buyExactOut - - ```solidity - function buyExactOut(uint128 synthMarketId, uint256 synthAmount, uint256 maxUsdAmount, address referrer) external returns (uint256 usdAmountCharged, struct OrderFees.Data fees) - ``` - - user provides the synth amount they'd like to buy, and the function charges the USD amount which includes fees - - the inverse of buyExactIn - -**Parameters** -* `synthMarketId` (*uint128*) - market id value -* `synthAmount` (*uint256*) - the amount of synth the trader wants to buy -* `maxUsdAmount` (*uint256*) - max amount the trader is willing to pay for the specified synth -* `referrer` (*address*) - optional address of the referrer, for fee share - -**Returns** -* `usdAmountCharged` (*uint256*) - amount of USD charged for the trade -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction -#### quoteBuyExactIn - - ```solidity - function quoteBuyExactIn(uint128 synthMarketId, uint256 usdAmount) external view returns (uint256 synthAmount, struct OrderFees.Data fees) - ``` - - quote for buyExactIn. same parameters and return values as buyExactIn - -**Parameters** -* `synthMarketId` (*uint128*) - market id value -* `usdAmount` (*uint256*) - amount of USD to use for the trade - -**Returns** -* `synthAmount` (*uint256*) - return amount of synth given the USD amount - fees -* `fees` (*struct OrderFees.Data*) - breakdown of all the quoted fees for the buy txn -#### quoteBuyExactOut - - ```solidity - function quoteBuyExactOut(uint128 synthMarketId, uint256 synthAmount) external view returns (uint256 usdAmountCharged, struct OrderFees.Data) - ``` - - quote for buyExactOut. same parameters and return values as buyExactOut - -**Parameters** -* `synthMarketId` (*uint128*) - market id value -* `synthAmount` (*uint256*) - amount of synth requested - -**Returns** -* `usdAmountCharged` (*uint256*) - USD amount charged for the synth requested - fees -* `[1]` (*struct OrderFees.Data*) - fees breakdown of all the quoted fees for the buy txn -#### sellExactIn - - ```solidity - function sellExactIn(uint128 synthMarketId, uint256 sellAmount, uint256 minAmountReceived, address referrer) external returns (uint256 returnAmount, struct OrderFees.Data fees) - ``` - - Initiates a sell trade returning snxUSD for the specified amount of synth (sellAmount) - - Transfers the specified synth, collects fees through configured fee collector, returns snxUSD to the trader. -Leftover fees not collected get deposited into the market manager to improve market PnL. - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market used for the trade. -* `sellAmount` (*uint256*) - Amount of synth provided by trader for trade into snxUSD. -* `minAmountReceived` (*uint256*) - Min Amount of snxUSD trader expects to receive for the trade -* `referrer` (*address*) - Optional address of the referrer, for fee share - -**Returns** -* `returnAmount` (*uint256*) - Amount of snxUSD returned to user -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction. -#### sellExactOut - - ```solidity - function sellExactOut(uint128 marketId, uint256 usdAmount, uint256 maxSynthAmount, address referrer) external returns (uint256 synthToBurn, struct OrderFees.Data fees) - ``` - - initiates a trade where trader specifies USD amount they'd like to receive - - the inverse of sellExactIn - -**Parameters** -* `marketId` (*uint128*) - synth market id -* `usdAmount` (*uint256*) - amount of USD trader wants to receive -* `maxSynthAmount` (*uint256*) - max amount of synth trader is willing to use to receive the specified USD amount -* `referrer` (*address*) - optional address of the referrer, for fee share - -**Returns** -* `synthToBurn` (*uint256*) - amount of synth charged for the specified usd amount -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction -#### sell - - ```solidity - function sell(uint128 marketId, uint256 synthAmount, uint256 minUsdAmount, address referrer) external returns (uint256 usdAmountReceived, struct OrderFees.Data fees) - ``` - - alias for sellExactIn - -**Parameters** -* `marketId` (*uint128*) - (see sellExactIn) -* `synthAmount` (*uint256*) - (see sellExactIn) -* `minUsdAmount` (*uint256*) - (see sellExactIn) -* `referrer` (*address*) - (see sellExactIn) - -**Returns** -* `usdAmountReceived` (*uint256*) - (see sellExactIn) -* `fees` (*struct OrderFees.Data*) - (see sellExactIn) -#### quoteSellExactIn - - ```solidity - function quoteSellExactIn(uint128 marketId, uint256 synthAmount) external view returns (uint256 returnAmount, struct OrderFees.Data fees) - ``` - - quote for sellExactIn - - returns expected USD amount trader would receive for the specified synth amount - -**Parameters** -* `marketId` (*uint128*) - synth market id -* `synthAmount` (*uint256*) - synth amount trader is providing for the trade - -**Returns** -* `returnAmount` (*uint256*) - amount of USD expected back -* `fees` (*struct OrderFees.Data*) - breakdown of all the quoted fees for the txn -#### quoteSellExactOut - - ```solidity - function quoteSellExactOut(uint128 marketId, uint256 usdAmount) external view returns (uint256 synthToBurn, struct OrderFees.Data fees) - ``` - - quote for sellExactOut - - returns expected synth amount expected from trader for the requested USD amount - -**Parameters** -* `marketId` (*uint128*) - synth market id -* `usdAmount` (*uint256*) - USD amount trader wants to receive - -**Returns** -* `synthToBurn` (*uint256*) - amount of synth expected from trader -* `fees` (*struct OrderFees.Data*) - breakdown of all the quoted fees for the txn - -#### SynthBought - - ```solidity - event SynthBought(uint256 synthMarketId, uint256 synthReturned, struct OrderFees.Data fees, uint256 collectedFees, address referrer, uint256 price) - ``` - - Gets fired when buy trade is complete - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market used for the trade. -* `synthReturned` (*uint256*) - Synth received on the trade based on amount provided by trader. -* `fees` (*struct OrderFees.Data*) - breakdown of all fees incurred for transaction. -* `collectedFees` (*uint256*) - Fees collected by the configured FeeCollector for the market (rest of the fees are deposited to market manager). -* `referrer` (*address*) - Optional address of the referrer, for fee share -* `price` (*uint256*) - - -#### SynthSold - - ```solidity - event SynthSold(uint256 synthMarketId, uint256 amountReturned, struct OrderFees.Data fees, uint256 collectedFees, address referrer, uint256 price) - ``` - - Gets fired when sell trade is complete - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market used for the trade. -* `amountReturned` (*uint256*) - Amount of snxUSD returned to user based on synth provided by trader. -* `fees` (*struct OrderFees.Data*) - breakdown of all fees incurred for transaction. -* `collectedFees` (*uint256*) - Fees collected by the configured FeeCollector for the market (rest of the fees are deposited to market manager). -* `referrer` (*address*) - Optional address of the referrer, for fee share -* `price` (*uint256*) - - -### Market Configuration Module - -#### getMarketFees - - ```solidity - function getMarketFees(uint128 synthMarketId) external returns (uint256 atomicFixedFee, uint256 asyncFixedFee, int256 wrapFee, int256 unwrapFee) - ``` - - gets the atomic fixed fee for a given market - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the fee applies to. - -**Returns** -* `atomicFixedFee` (*uint256*) - fixed fee amount represented in bips with 18 decimals. -* `asyncFixedFee` (*uint256*) - fixed fee amount represented in bips with 18 decimals. -* `wrapFee` (*int256*) - wrapping fee in %, 18 decimals. Can be negative. -* `unwrapFee` (*int256*) - unwrapping fee in %, 18 decimals. Can be negative. -#### setAtomicFixedFee - - ```solidity - function setAtomicFixedFee(uint128 synthMarketId, uint256 atomicFixedFee) external - ``` - - sets the atomic fixed fee for a given market - - only marketOwner can set the fee - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the fee applies to. -* `atomicFixedFee` (*uint256*) - fixed fee amount represented in bips with 18 decimals. - -#### setAsyncFixedFee - - ```solidity - function setAsyncFixedFee(uint128 synthMarketId, uint256 asyncFixedFee) external - ``` - - sets the async fixed fee for a given market - - only marketOwner can set the fee - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the fee applies to. -* `asyncFixedFee` (*uint256*) - fixed fee amount represented in bips with 18 decimals. - -#### setMarketSkewScale - - ```solidity - function setMarketSkewScale(uint128 synthMarketId, uint256 skewScale) external - ``` - - sets the skew scale for a given market - - only marketOwner can set the skew scale - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the skew scale applies to. -* `skewScale` (*uint256*) - max amount of synth which makes the skew 100%. the fee is derived as a % of the max value. 100% premium means outstanding synth == skewScale. - -#### getMarketSkewScale - - ```solidity - function getMarketSkewScale(uint128 synthMarketId) external returns (uint256 skewScale) - ``` - - gets the skew scale for a given market - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the skew scale applies to. - -**Returns** -* `skewScale` (*uint256*) - max amount of synth which makes the skew 100%. the fee is derived as a % of the max value. 100% premium means outstanding synth == skewScale. -#### setMarketUtilizationFees - - ```solidity - function setMarketUtilizationFees(uint128 synthMarketId, uint256 utilizationFeeRate) external - ``` - - sets the market utilization fee for a given market - - only marketOwner can set the fee -100% utilization means the fee is 0. 120% utilization means the fee is 20% * this fee rate (in bips). - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the utilization fee applies to. -* `utilizationFeeRate` (*uint256*) - the rate is represented in bips with 18 decimals and is the rate at which fee increases based on the % above 100% utilization of the delegated collateral for the market. - -#### getMarketUtilizationFees - - ```solidity - function getMarketUtilizationFees(uint128 synthMarketId) external returns (uint256 utilizationFeeRate) - ``` - - gets the market utilization fee for a given market - - 100% utilization means the fee is 0. 120% utilization means the fee is 20% * this fee rate (in bips). - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the utilization fee applies to. - -**Returns** -* `utilizationFeeRate` (*uint256*) - the rate is represented in bips with 18 decimals and is the rate at which fee increases based on the % above 100% utilization of the delegated collateral for the market. -#### setCollateralLeverage - - ```solidity - function setCollateralLeverage(uint128 synthMarketId, uint256 collateralLeverage) external - ``` - - sets the collateral leverage for a given market - - only marketOwner can set the leverage -this leverage value is a value applied to delegated collateral which is compared to outstanding synth to determine utilization of market, and locked amounts - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the collateral leverage applies to. -* `collateralLeverage` (*uint256*) - the leverage is represented as % with 18 decimals. 1 = 1x leverage - -#### getCollateralLeverage - - ```solidity - function getCollateralLeverage(uint128 synthMarketId) external returns (uint256 collateralLeverage) - ``` - - gets the collateral leverage for a given market - - this leverage value is a value applied to delegated collateral which is compared to outstanding synth to determine utilization of market, and locked amounts - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the collateral leverage applies to. - -**Returns** -* `collateralLeverage` (*uint256*) - the leverage is represented as % with 18 decimals. 1 = 1x leverage -#### setCustomTransactorFees - - ```solidity - function setCustomTransactorFees(uint128 synthMarketId, address transactor, uint256 fixedFeeAmount) external - ``` - - sets the fixed fee for a given market and transactor - - overrides both the atomic and async fixed fees -only marketOwner can set the fee -especially useful for direct integrations where configured traders get a discount - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the custom transactor fee applies to. -* `transactor` (*address*) - address of the trader getting discounted fees. -* `fixedFeeAmount` (*uint256*) - the fixed fee applying to the provided transactor. - -#### getCustomTransactorFees - - ```solidity - function getCustomTransactorFees(uint128 synthMarketId, address transactor) external returns (uint256 fixedFeeAmount) - ``` - - gets the fixed fee for a given market and transactor - - overrides both the atomic and async fixed fees -especially useful for direct integrations where configured traders get a discount - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the custom transactor fee applies to. -* `transactor` (*address*) - address of the trader getting discounted fees. - -**Returns** -* `fixedFeeAmount` (*uint256*) - the fixed fee applying to the provided transactor. -#### setFeeCollector - - ```solidity - function setFeeCollector(uint128 synthMarketId, address feeCollector) external - ``` - - sets a custom fee collector for a given market - - only marketOwner can set the fee collector -a use case here would be if the market owner wants to collect the fees via this contract and distribute via rewards distributor to SNX holders for example. -if fee collector is not set, the fees are deposited into the market manager. - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the fee collector applies to. -* `feeCollector` (*address*) - address of the fee collector inheriting the IFeeCollector interface. - -#### getFeeCollector - - ```solidity - function getFeeCollector(uint128 synthMarketId) external returns (address feeCollector) - ``` - - gets a custom fee collector for a given market - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the fee collector applies to. - -**Returns** -* `feeCollector` (*address*) - address of the fee collector inheriting the IFeeCollector interface. -#### setWrapperFees - - ```solidity - function setWrapperFees(uint128 synthMarketId, int256 wrapFee, int256 unwrapFee) external - ``` - - sets wrapper related fees. - - only marketOwner can set the wrapper fees -fees can be negative. this is a way to unwind the wrapper if needed by providing incentives. - -**Parameters** -* `synthMarketId` (*uint128*) - Id of the market the wrapper fees apply to. -* `wrapFee` (*int256*) - wrapping fee in %, 18 decimals. Can be negative. -* `unwrapFee` (*int256*) - unwrapping fee in %, 18 decimals. Can be negative. - -#### updateReferrerShare - - ```solidity - function updateReferrerShare(uint128 marketId, address referrer, uint256 sharePercentage) external - ``` - - Update the referral share percentage for a given market - -**Parameters** -* `marketId` (*uint128*) - id of the market -* `referrer` (*address*) - The address of the referrer -* `sharePercentage` (*uint256*) - The new share percentage for the referrer - -#### getReferrerShare - - ```solidity - function getReferrerShare(uint128 marketId, address referrer) external returns (uint256 sharePercentage) - ``` - - get the referral share percentage for a given market - -**Parameters** -* `marketId` (*uint128*) - id of the market -* `referrer` (*address*) - The address of the referrer - -**Returns** -* `sharePercentage` (*uint256*) - The new share percentage for the referrer - -#### MarketUtilizationFeesSet - - ```solidity - event MarketUtilizationFeesSet(uint256 synthMarketId, uint256 utilizationFeeRate) - ``` - - emitted when market utilization fees are set for specified market - -**Parameters** -* `synthMarketId` (*uint256*) - market id -* `utilizationFeeRate` (*uint256*) - utilization fee rate value - -#### MarketSkewScaleSet - - ```solidity - event MarketSkewScaleSet(uint256 synthMarketId, uint256 skewScale) - ``` - - emitted when the skew scale is set for a market - -**Parameters** -* `synthMarketId` (*uint256*) - market id -* `skewScale` (*uint256*) - skew scale value - -#### CollateralLeverageSet - - ```solidity - event CollateralLeverageSet(uint256 synthMarketId, uint256 collateralLeverage) - ``` - - emitted when the collateral leverage is set for a market - -**Parameters** -* `synthMarketId` (*uint256*) - market id -* `collateralLeverage` (*uint256*) - leverage value - -#### AtomicFixedFeeSet - - ```solidity - event AtomicFixedFeeSet(uint256 synthMarketId, uint256 atomicFixedFee) - ``` - - emitted when the fixed fee for atomic orders is set. - -**Parameters** -* `synthMarketId` (*uint256*) - market id -* `atomicFixedFee` (*uint256*) - fee value - -#### AsyncFixedFeeSet - - ```solidity - event AsyncFixedFeeSet(uint256 synthMarketId, uint256 asyncFixedFee) - ``` - - emitted when the fixed fee for async orders is set. - -**Parameters** -* `synthMarketId` (*uint256*) - market id -* `asyncFixedFee` (*uint256*) - fee value - -#### TransactorFixedFeeSet - - ```solidity - event TransactorFixedFeeSet(uint256 synthMarketId, address transactor, uint256 fixedFeeAmount) - ``` - - emitted when the fixed fee is set for a given transactor - - this overrides the async/atomic fixed fees for a given transactor - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market to set the fees for. -* `transactor` (*address*) - fixed fee for the transactor (overrides the global fixed fee) -* `fixedFeeAmount` (*uint256*) - the fixed fee for the corresponding market, and transactor - -#### FeeCollectorSet - - ```solidity - event FeeCollectorSet(uint256 synthMarketId, address feeCollector) - ``` - - emitted when custom fee collector is set for a given market - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market to set the collector for. -* `feeCollector` (*address*) - the address of the fee collector to set. - -#### WrapperFeesSet - - ```solidity - event WrapperFeesSet(uint256 synthMarketId, int256 wrapFee, int256 unwrapFee) - ``` - - emitted when wrapper fees are set for a given market - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market to set the wrapper fees. -* `wrapFee` (*int256*) - wrapping fee in %, 18 decimals. Can be negative. -* `unwrapFee` (*int256*) - unwrapping fee in %, 18 decimals. Can be negative. - -#### ReferrerShareUpdated - - ```solidity - event ReferrerShareUpdated(uint128 marketId, address referrer, uint256 sharePercentage) - ``` - - Emitted when the share percentage for a referrer address has been updated. - -**Parameters** -* `marketId` (*uint128*) - Id of the market -* `referrer` (*address*) - The address of the referrer -* `sharePercentage` (*uint256*) - The new share percentage for the referrer - -### Spot Market Factory Module - -#### setSynthetix - - ```solidity - function setSynthetix(contract ISynthetixSystem synthetix) external - ``` - - Sets the v3 synthetix core system. - - Pulls in the USDToken and oracle manager from the synthetix core system and sets those appropriately. - -**Parameters** -* `synthetix` (*contract ISynthetixSystem*) - synthetix v3 core system address - -#### setSynthImplementation - - ```solidity - function setSynthImplementation(address synthImplementation) external - ``` - - When a new synth is created, this is the erc20 implementation that is used. - -**Parameters** -* `synthImplementation` (*address*) - erc20 implementation address - -#### createSynth - - ```solidity - function createSynth(string tokenName, string tokenSymbol, address synthOwner) external returns (uint128 synthMarketId) - ``` - - Creates a new synth market with synthetix v3 core system via market manager - - The synth is created using the initial synth implementation and creates a proxy for future upgrades of the synth implementation. -Sets up the market owner who can update configuration for the synth. - -**Parameters** -* `tokenName` (*string*) - name of synth (i.e Synthetix ETH) -* `tokenSymbol` (*string*) - symbol of synth (i.e snxETH) -* `synthOwner` (*address*) - owner of the market that's created. - -**Returns** -* `synthMarketId` (*uint128*) - id of the synth market that was created -#### getSynth - - ```solidity - function getSynth(uint128 marketId) external view returns (address synthAddress) - ``` - - Get the proxy address of the synth for the provided marketId - - Uses associated systems module to retrieve the token address. - -**Parameters** -* `marketId` (*uint128*) - id of the market - -**Returns** -* `synthAddress` (*address*) - address of the proxy for the synth -#### getSynthImpl - - ```solidity - function getSynthImpl(uint128 marketId) external view returns (address implAddress) - ``` - - Get the implementation address of the synth for the provided marketId. -This address should not be used directly--use `getSynth` instead - - Uses associated systems module to retrieve the token address. - -**Parameters** -* `marketId` (*uint128*) - id of the market - -**Returns** -* `implAddress` (*address*) - address of the proxy for the synth -#### updatePriceData - - ```solidity - function updatePriceData(uint128 marketId, bytes32 buyFeedId, bytes32 sellFeedId) external - ``` - - Update the price data for a given market. - - Only the market owner can call this function. - -**Parameters** -* `marketId` (*uint128*) - id of the market -* `buyFeedId` (*bytes32*) - the oracle manager buy feed node id -* `sellFeedId` (*bytes32*) - the oracle manager sell feed node id - -#### upgradeSynthImpl - - ```solidity - function upgradeSynthImpl(uint128 marketId) external - ``` - - upgrades the synth implementation to the current implementation for the specified market. -Anyone who is willing and able to spend the gas can call this method. - - The synth implementation is upgraded via the proxy. - -**Parameters** -* `marketId` (*uint128*) - id of the market - -#### setDecayRate - - ```solidity - function setDecayRate(uint128 marketId, uint256 rate) external - ``` - - Allows market to adjust decay rate of the synth - -**Parameters** -* `marketId` (*uint128*) - the market to update the synth decay rate for -* `rate` (*uint256*) - APY to decay of the synth to decay by, as a 18 decimal ratio - -#### nominateMarketOwner - - ```solidity - function nominateMarketOwner(uint128 synthMarketId, address newNominatedOwner) external - ``` - - Allows the current market owner to nominate a new owner. - - The nominated owner will have to call `acceptOwnership` in a separate transaction in order to finalize the action and become the new contract owner. - -**Parameters** -* `synthMarketId` (*uint128*) - synth market id value -* `newNominatedOwner` (*address*) - The address that is to become nominated. - -#### acceptMarketOwnership - - ```solidity - function acceptMarketOwnership(uint128 synthMarketId) external - ``` - - Allows a nominated address to accept ownership of the market. - - Reverts if the caller is not nominated. - -**Parameters** -* `synthMarketId` (*uint128*) - synth market id value - -#### renounceMarketNomination - - ```solidity - function renounceMarketNomination(uint128 synthMarketId) external - ``` - - Allows a nominated address to renounce ownership of the market. - - Reverts if the caller is not nominated. - -**Parameters** -* `synthMarketId` (*uint128*) - synth market id value - -#### getMarketOwner - - ```solidity - function getMarketOwner(uint128 synthMarketId) external view returns (address) - ``` - - Returns market owner. - -**Parameters** -* `synthMarketId` (*uint128*) - synth market id value - -#### name - - ```solidity - function name(uint128 marketId) external view returns (string) - ``` - - returns a human-readable name for a given market - -#### reportedDebt - - ```solidity - function reportedDebt(uint128 marketId) external view returns (uint256) - ``` - - returns amount of USD that the market would try to mint if everything was withdrawn - -#### minimumCredit - - ```solidity - function minimumCredit(uint128 marketId) external view returns (uint256) - ``` - - prevents reduction of available credit capacity by specifying this amount, for which withdrawals will be disallowed - -#### supportsInterface - - ```solidity - function supportsInterface(bytes4 interfaceID) external view returns (bool) - ``` - - Determines if the contract in question supports the specified interface. - -**Parameters** -* `interfaceID` (*bytes4*) - XOR of all selectors in the contract. - -**Returns** -* `[0]` (*bool*) - True if the contract supports the specified interface. - -#### SynthetixSystemSet - - ```solidity - event SynthetixSystemSet(address synthetix, address usdTokenAddress, address oracleManager) - ``` - - Gets fired when the synthetix is set - -**Parameters** -* `synthetix` (*address*) - address of the synthetix core contract -* `usdTokenAddress` (*address*) - address of the USDToken contract -* `oracleManager` (*address*) - address of the Oracle Manager contract - -#### SynthImplementationSet - - ```solidity - event SynthImplementationSet(address synthImplementation) - ``` - - Gets fired when the synth implementation is set - -**Parameters** -* `synthImplementation` (*address*) - address of the synth implementation - -#### SynthRegistered - - ```solidity - event SynthRegistered(uint256 synthMarketId) - ``` - - Gets fired when the synth is registered as a market. - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the synth market that was created - -#### SynthImplementationUpgraded - - ```solidity - event SynthImplementationUpgraded(uint256 synthMarketId, address proxy, address implementation) - ``` - - Gets fired when the synth's implementation is updated on the corresponding proxy. - -**Parameters** -* `synthMarketId` (*uint256*) - -* `proxy` (*address*) - the synth proxy servicing the latest implementation -* `implementation` (*address*) - the latest implementation of the synth - -#### SynthPriceDataUpdated - - ```solidity - event SynthPriceDataUpdated(uint256 synthMarketId, bytes32 buyFeedId, bytes32 sellFeedId) - ``` - - Gets fired when the market's price feeds are updated, compatible with oracle manager - -**Parameters** -* `synthMarketId` (*uint256*) - -* `buyFeedId` (*bytes32*) - the oracle manager feed id for the buy price -* `sellFeedId` (*bytes32*) - the oracle manager feed id for the sell price - -#### DecayRateUpdated - - ```solidity - event DecayRateUpdated(uint128 marketId, uint256 rate) - ``` - - Gets fired when the market's price feeds are updated, compatible with oracle manager - -**Parameters** -* `marketId` (*uint128*) - Id of the synth market -* `rate` (*uint256*) - the new decay rate (1e16 means 1% decay per year) - -#### MarketOwnerNominated - - ```solidity - event MarketOwnerNominated(uint128 marketId, address newOwner) - ``` - - Emitted when an address has been nominated. - -**Parameters** -* `marketId` (*uint128*) - id of the market -* `newOwner` (*address*) - The address that has been nominated. - -#### MarketNominationRenounced - - ```solidity - event MarketNominationRenounced(uint128 marketId, address nominee) - ``` - - Emitted when market nominee renounces nomination. - -**Parameters** -* `marketId` (*uint128*) - id of the market -* `nominee` (*address*) - The address that has been nominated. - -#### MarketOwnerChanged - - ```solidity - event MarketOwnerChanged(uint128 marketId, address oldOwner, address newOwner) - ``` - - Emitted when the owner of the market has changed. - -**Parameters** -* `marketId` (*uint128*) - id of the market -* `oldOwner` (*address*) - The previous owner of the market. -* `newOwner` (*address*) - The new owner of the market. - -### Synth Token Module - -#### setDecayRate - - ```solidity - function setDecayRate(uint256 _rate) external - ``` - - Updates the decay rate for a year - -**Parameters** -* `_rate` (*uint256*) - The decay rate with 18 decimals (1e16 means 1% decay per year). - -#### decayRate - - ```solidity - function decayRate() external returns (uint256) - ``` - - get decay rate for a year - -#### advanceEpoch - - ```solidity - function advanceEpoch() external returns (uint256) - ``` - - advance epoch manually in order to avoid precision loss - -#### isInitialized - - ```solidity - function isInitialized() external returns (bool) - ``` - - Returns wether the token has been initialized. - -**Returns** -* `[0]` (*bool*) - A boolean with the result of the query. -#### initialize - - ```solidity - function initialize(string tokenName, string tokenSymbol, uint8 tokenDecimals) external - ``` - - Initializes the token with name, symbol, and decimals. - -#### mint - - ```solidity - function mint(address to, uint256 amount) external - ``` - - Allows the owner to mint tokens. - -**Parameters** -* `to` (*address*) - The address to receive the newly minted tokens. -* `amount` (*uint256*) - The amount of tokens to mint. - -#### burn - - ```solidity - function burn(address from, uint256 amount) external - ``` - - Allows the owner to burn tokens. - -**Parameters** -* `from` (*address*) - The address whose tokens will be burnt. -* `amount` (*uint256*) - The amount of tokens to burn. - -#### setAllowance - - ```solidity - function setAllowance(address from, address spender, uint256 amount) external - ``` - - Allows an address that holds tokens to provide allowance to another. - -**Parameters** -* `from` (*address*) - The address that is providing allowance. -* `spender` (*address*) - The address that is given allowance. -* `amount` (*uint256*) - The amount of allowance being given. - -#### name - - ```solidity - function name() external view returns (string) - ``` - - Retrieves the name of the token, e.g. "Synthetix Network Token". - -**Returns** -* `[0]` (*string*) - A string with the name of the token. -#### symbol - - ```solidity - function symbol() external view returns (string) - ``` - - Retrieves the symbol of the token, e.g. "SNX". - -**Returns** -* `[0]` (*string*) - A string with the symbol of the token. -#### decimals - - ```solidity - function decimals() external view returns (uint8) - ``` - - Retrieves the number of decimals used by the token. The default is 18. - -**Returns** -* `[0]` (*uint8*) - The number of decimals. -#### totalSupply - - ```solidity - function totalSupply() external view returns (uint256) - ``` - - Returns the total number of tokens in circulation (minted - burnt). - -**Returns** -* `[0]` (*uint256*) - The total number of tokens. -#### balanceOf - - ```solidity - function balanceOf(address owner) external view returns (uint256) - ``` - - Returns the balance of a user. - -**Parameters** -* `owner` (*address*) - The address whose balance is being retrieved. - -**Returns** -* `[0]` (*uint256*) - The number of tokens owned by the user. -#### allowance - - ```solidity - function allowance(address owner, address spender) external view returns (uint256) - ``` - - Returns how many tokens a user has allowed another user to transfer on its behalf. - -**Parameters** -* `owner` (*address*) - The user who has given the allowance. -* `spender` (*address*) - The user who was given the allowance. - -**Returns** -* `[0]` (*uint256*) - The amount of tokens `spender` can transfer on `owner`'s behalf. -#### transfer - - ```solidity - function transfer(address to, uint256 amount) external returns (bool) - ``` - - Transfer tokens from one address to another. - -**Parameters** -* `to` (*address*) - The address that will receive the tokens. -* `amount` (*uint256*) - The amount of tokens to be transferred. - -**Returns** -* `[0]` (*bool*) - A boolean which is true if the operation succeeded. -#### approve - - ```solidity - function approve(address spender, uint256 amount) external returns (bool) - ``` - - Allows users to provide allowance to other users so that they can transfer tokens on their behalf. - -**Parameters** -* `spender` (*address*) - The address that is receiving the allowance. -* `amount` (*uint256*) - The amount of tokens that are being added to the allowance. - -**Returns** -* `[0]` (*bool*) - A boolean which is true if the operation succeeded. -#### increaseAllowance - - ```solidity - function increaseAllowance(address spender, uint256 addedValue) external returns (bool) - ``` - - Atomically increases the allowance granted to `spender` by the caller. - -This is an alternative to {approve} that can be used as a mitigation for -problems described in {IERC20-approve}. - -Emits an {Approval} event indicating the updated allowance. - -Requirements: - -- `spender` cannot be the zero address. - -#### decreaseAllowance - - ```solidity - function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) - ``` - - Atomically decreases the allowance granted to `spender` by the caller. - -This is an alternative to {approve} that can be used as a mitigation for -problems described in {IERC20-approve}. - -Emits an {Approval} event indicating the updated allowance. - -Requirements: - -- `spender` cannot be the zero address. -- `spender` must have allowance for the caller of at least -`subtractedValue`. - -#### transferFrom - - ```solidity - function transferFrom(address from, address to, uint256 amount) external returns (bool) - ``` - - Allows a user who has been given allowance to transfer tokens on another user's behalf. - -**Parameters** -* `from` (*address*) - The address that owns the tokens that are being transferred. -* `to` (*address*) - The address that will receive the tokens. -* `amount` (*uint256*) - The number of tokens to transfer. - -**Returns** -* `[0]` (*bool*) - A boolean which is true if the operation succeeded. - -#### Transfer - - ```solidity - event Transfer(address from, address to, uint256 amount) - ``` - - Emitted when tokens have been transferred. - -**Parameters** -* `from` (*address*) - The address that originally owned the tokens. -* `to` (*address*) - The address that received the tokens. -* `amount` (*uint256*) - The number of tokens that were transferred. - -#### Approval - - ```solidity - event Approval(address owner, address spender, uint256 amount) - ``` - - Emitted when a user has provided allowance to another user for transferring tokens on its behalf. - -**Parameters** -* `owner` (*address*) - The address that is providing the allowance. -* `spender` (*address*) - The address that received the allowance. -* `amount` (*uint256*) - The number of tokens that were added to `spender`'s allowance. - -### Wrapper Module - -#### setWrapper - - ```solidity - function setWrapper(uint128 marketId, address wrapCollateralType, uint256 maxWrappableAmount) external - ``` - - Used to set the wrapper supply cap for a given market and collateral type. - - If the supply cap is set to 0 or lower than the current outstanding supply, then the wrapper is disabled. -There is a synthetix v3 core system supply cap also set. If the current supply becomes higher than either the core system supply cap or the local market supply cap, wrapping will be disabled. - -**Parameters** -* `marketId` (*uint128*) - Id of the market to enable wrapping for. -* `wrapCollateralType` (*address*) - The collateral being used to wrap the synth. -* `maxWrappableAmount` (*uint256*) - The maximum amount of collateral that can be wrapped. - -#### wrap - - ```solidity - function wrap(uint128 marketId, uint256 wrapAmount, uint256 minAmountReceived) external returns (uint256 amountToMint, struct OrderFees.Data fees) - ``` - - Wraps the specified amount and returns similar value of synth minus the fees. - - Fees are collected from the user by way of the contract returning less synth than specified amount of collateral. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `wrapAmount` (*uint256*) - Amount of collateral to wrap. This amount gets deposited into the market collateral manager. -* `minAmountReceived` (*uint256*) - The minimum amount of synths the trader is expected to receive, otherwise the transaction will revert. - -**Returns** -* `amountToMint` (*uint256*) - Amount of synth returned to user. -* `fees` (*struct OrderFees.Data*) - breakdown of all fees. in this case, only wrapper fees are returned. -#### unwrap - - ```solidity - function unwrap(uint128 marketId, uint256 unwrapAmount, uint256 minAmountReceived) external returns (uint256 returnCollateralAmount, struct OrderFees.Data fees) - ``` - - Unwraps the synth and returns similar value of collateral minus the fees. - - Transfers the specified synth, collects fees through configured fee collector, returns collateral minus fees to trader. - -**Parameters** -* `marketId` (*uint128*) - Id of the market used for the trade. -* `unwrapAmount` (*uint256*) - Amount of synth trader is unwrapping. -* `minAmountReceived` (*uint256*) - The minimum amount of collateral the trader is expected to receive, otherwise the transaction will revert. - -**Returns** -* `returnCollateralAmount` (*uint256*) - Amount of collateral returned. -* `fees` (*struct OrderFees.Data*) - breakdown of all fees. in this case, only wrapper fees are returned. - -#### WrapperSet - - ```solidity - event WrapperSet(uint256 synthMarketId, address wrapCollateralType, uint256 maxWrappableAmount) - ``` - - Gets fired when wrapper supply is set for a given market, collateral type. - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market the wrapper is initialized for. -* `wrapCollateralType` (*address*) - the collateral used to wrap the synth. -* `maxWrappableAmount` (*uint256*) - the local supply cap for the wrapper. - -#### SynthWrapped - - ```solidity - event SynthWrapped(uint256 synthMarketId, uint256 amountWrapped, struct OrderFees.Data fees, uint256 feesCollected) - ``` - - Gets fired after user wraps synth - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market. -* `amountWrapped` (*uint256*) - amount of synth wrapped. -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction. -* `feesCollected` (*uint256*) - fees collected by the configured FeeCollector for the market (rest of the fees are deposited to market manager). - -#### SynthUnwrapped - - ```solidity - event SynthUnwrapped(uint256 synthMarketId, uint256 amountUnwrapped, struct OrderFees.Data fees, uint256 feesCollected) - ``` - - Gets fired after user unwraps synth - -**Parameters** -* `synthMarketId` (*uint256*) - Id of the market. -* `amountUnwrapped` (*uint256*) - amount of synth unwrapped. -* `fees` (*struct OrderFees.Data*) - breakdown of all the fees incurred for the transaction. -* `feesCollected` (*uint256*) - fees collected by the configured FeeCollector for the market (rest of the fees are deposited to market manager). - diff --git a/package.json b/package.json index 3d1d1b173e..cb743dd04b 100644 --- a/package.json +++ b/package.json @@ -37,8 +37,8 @@ "publish:dev": "lerna publish --force-publish --canary --dist-tag dev --preid dev.$(git rev-parse --short HEAD)", "publish-contracts": "yarn workspaces foreach --verbose run publish-contracts", "prepublishOnly": "node ./prepublishOnly.js", - "docgen": "yarn workspaces foreach --verbose run docgen && yarn docgen:contracts", - "docgen:contracts": "yarn workspace @synthetixio/docgen docgen:contracts", + "docgen:contracts": "yarn workspaces foreach --verbose run docgen && yarn workspace @synthetixio/docgen run docgen:contracts", + "docgen:abis": "yarn workspace @synthetixio/docgen run docgen:abis", "subgraphgen": "yarn workspaces foreach --verbose run subgraphgen" }, "devDependencies": { diff --git a/protocol/governance/docs/index.md b/protocol/governance/docs/index.md deleted file mode 100644 index 7538db4083..0000000000 --- a/protocol/governance/docs/index.md +++ /dev/null @@ -1,1117 +0,0 @@ -### Council Token Module - -#### isInitialized - - ```solidity - function isInitialized() external returns (bool) - ``` - - Returns whether the token has been initialized. - -**Returns** -* `[0]` (*bool*) - A boolean with the result of the query. -#### initialize - - ```solidity - function initialize(string tokenName, string tokenSymbol, string uri) external - ``` - - Initializes the token with name, symbol, and uri. - -#### mint - - ```solidity - function mint(address to, uint256 tokenId) external - ``` - - Allows the owner to mint tokens. - -**Parameters** -* `to` (*address*) - The address to receive the newly minted tokens. -* `tokenId` (*uint256*) - The ID of the newly minted token - -#### safeMint - - ```solidity - function safeMint(address to, uint256 tokenId, bytes data) external - ``` - - Allows the owner to mint tokens. Verifies that the receiver can receive the token - -**Parameters** -* `to` (*address*) - The address to receive the newly minted token. -* `tokenId` (*uint256*) - The ID of the newly minted token -* `data` (*bytes*) - any data which should be sent to the receiver - -#### burn - - ```solidity - function burn(uint256 tokenId) external - ``` - - Allows the owner to burn tokens. - -**Parameters** -* `tokenId` (*uint256*) - The token to burn - -#### setAllowance - - ```solidity - function setAllowance(uint256 tokenId, address spender) external - ``` - - Allows an address that holds tokens to provide allowance to another. - -**Parameters** -* `tokenId` (*uint256*) - The token which should be allowed to spender -* `spender` (*address*) - The address that is given allowance. - -#### setBaseTokenURI - - ```solidity - function setBaseTokenURI(string uri) external - ``` - - Allows the owner to update the base token URI. - -**Parameters** -* `uri` (*string*) - The new base token uri - -#### totalSupply - - ```solidity - function totalSupply() external view returns (uint256) - ``` - - Returns the total amount of tokens stored by the contract. - -#### tokenOfOwnerByIndex - - ```solidity - function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256) - ``` - - Returns a token ID owned by `owner` at a given `index` of its token list. -Use along with {balanceOf} to enumerate all of ``owner``'s tokens. - -Requirements: -- `owner` must be a valid address -- `index` must be less than the balance of the tokens for the owner - -#### tokenByIndex - - ```solidity - function tokenByIndex(uint256 index) external view returns (uint256) - ``` - - Returns a token ID at a given `index` of all the tokens stored by the contract. -Use along with {totalSupply} to enumerate all tokens. - -Requirements: -- `index` must be less than the total supply of the tokens - -#### balanceOf - - ```solidity - function balanceOf(address holder) external view returns (uint256 balance) - ``` - - Returns the number of tokens in ``owner``'s account. - -Requirements: - -- `holder` must be a valid address - -#### ownerOf - - ```solidity - function ownerOf(uint256 tokenId) external view returns (address owner) - ``` - - Returns the owner of the `tokenId` token. - -Requirements: - -- `tokenId` must exist. - -#### safeTransferFrom - - ```solidity - function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external - ``` - - Safely transfers `tokenId` token from `from` to `to`. - -Requirements: - -- `from` cannot be the zero address. -- `to` cannot be the zero address. -- `tokenId` token must exist and be owned by `from`. -- If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. -- If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - -Emits a {Transfer} event. - -#### safeTransferFrom - - ```solidity - function safeTransferFrom(address from, address to, uint256 tokenId) external - ``` - - Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients -are aware of the ERC721 protocol to prevent tokens from being forever locked. - -Requirements: - -- `from` cannot be the zero address. -- `to` cannot be the zero address. -- `tokenId` token must exist and be owned by `from`. -- If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. -- If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - -Emits a {Transfer} event. - -#### transferFrom - - ```solidity - function transferFrom(address from, address to, uint256 tokenId) external - ``` - - Transfers `tokenId` token from `from` to `to`. - -WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. - -Requirements: - -- `from` cannot be the zero address. -- `to` cannot be the zero address. -- `tokenId` token must be owned by `from`. -- If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - -Emits a {Transfer} event. - -#### approve - - ```solidity - function approve(address to, uint256 tokenId) external - ``` - - Gives permission to `to` to transfer `tokenId` token to another account. -The approval is cleared when the token is transferred. - -Only a single account can be approved at a time, so approving the zero address clears previous approvals. - -Requirements: - -- The caller must own the token or be an approved operator. -- `tokenId` must exist. - -Emits an {Approval} event. - -#### setApprovalForAll - - ```solidity - function setApprovalForAll(address operator, bool approved) external - ``` - - Approve or remove `operator` as an operator for the caller. -Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. - -Requirements: - -- The `operator` cannot be the caller. - -Emits an {ApprovalForAll} event. - -#### getApproved - - ```solidity - function getApproved(uint256 tokenId) external view returns (address operator) - ``` - - Returns the account approved for `tokenId` token. - -Requirements: - -- `tokenId` must exist. - -#### isApprovedForAll - - ```solidity - function isApprovedForAll(address owner, address operator) external view returns (bool) - ``` - - Returns if the `operator` is allowed to manage all of the assets of `owner`. - -See {setApprovalForAll} - -#### Transfer - - ```solidity - event Transfer(address from, address to, uint256 tokenId) - ``` - - Emitted when `tokenId` token is transferred from `from` to `to`. - -#### Approval - - ```solidity - event Approval(address owner, address approved, uint256 tokenId) - ``` - - Emitted when `owner` enables `approved` to manage the `tokenId` token. - -#### ApprovalForAll - - ```solidity - event ApprovalForAll(address owner, address operator, bool approved) - ``` - - Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. - -### IDebtShare - -#### balanceOfOnPeriod - - ```solidity - function balanceOfOnPeriod(address account, uint256 periodId) external view returns (uint256) - ``` - -### Election Inspector Module - -#### getEpochStartDateForIndex - - ```solidity - function getEpochStartDateForIndex(uint256 epochIndex) external view returns (uint64) - ``` - - Returns the date in which the given epoch started - -#### getEpochEndDateForIndex - - ```solidity - function getEpochEndDateForIndex(uint256 epochIndex) external view returns (uint64) - ``` - - Returns the date in which the given epoch ended - -#### getNominationPeriodStartDateForIndex - - ```solidity - function getNominationPeriodStartDateForIndex(uint256 epochIndex) external view returns (uint64) - ``` - - Returns the date in which the Nomination period in the given epoch started - -#### getVotingPeriodStartDateForIndex - - ```solidity - function getVotingPeriodStartDateForIndex(uint256 epochIndex) external view returns (uint64) - ``` - - Returns the date in which the Voting period in the given epoch started - -#### wasNominated - - ```solidity - function wasNominated(address candidate, uint256 epochIndex) external view returns (bool) - ``` - - Shows if a candidate was nominated in the given epoch - -#### getNomineesAtEpoch - - ```solidity - function getNomineesAtEpoch(uint256 epochIndex) external view returns (address[]) - ``` - - Returns a list of all nominated candidates in the given epoch - -#### getBallotVotedAtEpoch - - ```solidity - function getBallotVotedAtEpoch(address user, uint256 epochIndex) external view returns (bytes32) - ``` - - Returns the ballot id that user voted on in the given election - -#### hasVotedInEpoch - - ```solidity - function hasVotedInEpoch(address user, uint256 epochIndex) external view returns (bool) - ``` - - Returns if user has voted in the given election - -#### getBallotVotesInEpoch - - ```solidity - function getBallotVotesInEpoch(bytes32 ballotId, uint256 epochIndex) external view returns (uint256) - ``` - - Returns the number of votes given to a particular ballot in a given epoch - -#### getBallotCandidatesInEpoch - - ```solidity - function getBallotCandidatesInEpoch(bytes32 ballotId, uint256 epochIndex) external view returns (address[]) - ``` - - Returns the list of candidates that a particular ballot has in a given epoch - -#### getCandidateVotesInEpoch - - ```solidity - function getCandidateVotesInEpoch(address candidate, uint256 epochIndex) external view returns (uint256) - ``` - - Returns the number of votes a candidate received in a given epoch - -#### getElectionWinnersInEpoch - - ```solidity - function getElectionWinnersInEpoch(uint256 epochIndex) external view returns (address[]) - ``` - - Returns the winners of the given election - -### Election Module - -#### initOrUpgradeElectionModule - - ```solidity - function initOrUpgradeElectionModule(address[] firstCouncil, uint8 minimumActiveMembers, uint64 nominationPeriodStartDate, uint64 votingPeriodStartDate, uint64 epochEndDate) external - ``` - - Initializes the module and immediately starts the first epoch - -#### isElectionModuleInitialized - - ```solidity - function isElectionModuleInitialized() external view returns (bool) - ``` - - Shows whether the module has been initialized - -#### tweakEpochSchedule - - ```solidity - function tweakEpochSchedule(uint64 newNominationPeriodStartDate, uint64 newVotingPeriodStartDate, uint64 newEpochEndDate) external - ``` - - Adjusts the current epoch schedule requiring that the current period remains Administration, and that changes are small (see setMaxDateAdjustmentTolerance) - -#### modifyEpochSchedule - - ```solidity - function modifyEpochSchedule(uint64 newNominationPeriodStartDate, uint64 newVotingPeriodStartDate, uint64 newEpochEndDate) external - ``` - - Adjusts the current epoch schedule requiring that the current period remains Administration - -#### setMinEpochDurations - - ```solidity - function setMinEpochDurations(uint64 newMinNominationPeriodDuration, uint64 newMinVotingPeriodDuration, uint64 newMinEpochDuration) external - ``` - - Determines minimum values for epoch schedule adjustments - -#### setMaxDateAdjustmentTolerance - - ```solidity - function setMaxDateAdjustmentTolerance(uint64 newMaxDateAdjustmentTolerance) external - ``` - - Determines adjustment size for tweakEpochSchedule - -#### setDefaultBallotEvaluationBatchSize - - ```solidity - function setDefaultBallotEvaluationBatchSize(uint256 newDefaultBallotEvaluationBatchSize) external - ``` - - Determines batch size when evaluate() is called with numBallots = 0 - -#### setNextEpochSeatCount - - ```solidity - function setNextEpochSeatCount(uint8 newSeatCount) external - ``` - - Determines the number of council members in the next epoch - -#### setMinimumActiveMembers - - ```solidity - function setMinimumActiveMembers(uint8 newMinimumActiveMembers) external - ``` - - Determines the minimum number of council members before triggering an emergency election - -#### dismissMembers - - ```solidity - function dismissMembers(address[] members) external - ``` - - Allows the owner to remove one or more council members, triggering an election if a threshold is met - -#### nominate - - ```solidity - function nominate() external - ``` - - Allows anyone to self-nominate during the Nomination period - -#### withdrawNomination - - ```solidity - function withdrawNomination() external - ``` - - Self-withdrawal of nominations during the Nomination period - -#### cast - - ```solidity - function cast(address[] candidates) external - ``` - - Allows anyone with vote power to vote on nominated candidates during the Voting period - -#### withdrawVote - - ```solidity - function withdrawVote() external - ``` - - Allows votes to be withdraw - -#### evaluate - - ```solidity - function evaluate(uint256 numBallots) external - ``` - - Processes ballots in batches during the Evaluation period (after epochEndDate) - -#### resolve - - ```solidity - function resolve() external - ``` - - Shuffles NFTs and resolves an election after it has been evaluated - -#### getMinEpochDurations - - ```solidity - function getMinEpochDurations() external view returns (uint64 minNominationPeriodDuration, uint64 minVotingPeriodDuration, uint64 minEpochDuration) - ``` - - Exposes minimum durations required when adjusting epoch schedules - -#### getMaxDateAdjustmenTolerance - - ```solidity - function getMaxDateAdjustmenTolerance() external view returns (uint64) - ``` - - Exposes maximum size of adjustments when calling tweakEpochSchedule - -#### getDefaultBallotEvaluationBatchSize - - ```solidity - function getDefaultBallotEvaluationBatchSize() external view returns (uint256) - ``` - - Shows the default batch size when calling evaluate() with numBallots = 0 - -#### getNextEpochSeatCount - - ```solidity - function getNextEpochSeatCount() external view returns (uint8) - ``` - - Shows the number of council members that the next epoch will have - -#### getMinimumActiveMembers - - ```solidity - function getMinimumActiveMembers() external view returns (uint8) - ``` - - Returns the minimum active members that the council needs to avoid an emergency election - -#### getEpochIndex - - ```solidity - function getEpochIndex() external view returns (uint256) - ``` - - Returns the index of the current epoch. The first epoch's index is 1 - -#### getEpochStartDate - - ```solidity - function getEpochStartDate() external view returns (uint64) - ``` - - Returns the date in which the current epoch started - -#### getEpochEndDate - - ```solidity - function getEpochEndDate() external view returns (uint64) - ``` - - Returns the date in which the current epoch will end - -#### getNominationPeriodStartDate - - ```solidity - function getNominationPeriodStartDate() external view returns (uint64) - ``` - - Returns the date in which the Nomination period in the current epoch will start - -#### getVotingPeriodStartDate - - ```solidity - function getVotingPeriodStartDate() external view returns (uint64) - ``` - - Returns the date in which the Voting period in the current epoch will start - -#### getCurrentPeriod - - ```solidity - function getCurrentPeriod() external view returns (uint256) - ``` - - Returns the current period type: Administration, Nomination, Voting, Evaluation - -#### isNominated - - ```solidity - function isNominated(address candidate) external view returns (bool) - ``` - - Shows if a candidate has been nominated in the current epoch - -#### getNominees - - ```solidity - function getNominees() external view returns (address[]) - ``` - - Returns a list of all nominated candidates in the current epoch - -#### calculateBallotId - - ```solidity - function calculateBallotId(address[] candidates) external pure returns (bytes32) - ``` - - Hashes a list of candidates (used for identifying and storing ballots) - -#### getBallotVoted - - ```solidity - function getBallotVoted(address user) external view returns (bytes32) - ``` - - Returns the ballot id that user voted on in the current election - -#### hasVoted - - ```solidity - function hasVoted(address user) external view returns (bool) - ``` - - Returns if user has voted in the current election - -#### getVotePower - - ```solidity - function getVotePower(address user) external view returns (uint256) - ``` - - Returns the vote power of user in the current election - -#### getBallotVotes - - ```solidity - function getBallotVotes(bytes32 ballotId) external view returns (uint256) - ``` - - Returns the number of votes given to a particular ballot - -#### getBallotCandidates - - ```solidity - function getBallotCandidates(bytes32 ballotId) external view returns (address[]) - ``` - - Returns the list of candidates that a particular ballot has - -#### isElectionEvaluated - - ```solidity - function isElectionEvaluated() external view returns (bool) - ``` - - Returns whether all ballots in the current election have been counted - -#### getCandidateVotes - - ```solidity - function getCandidateVotes(address candidate) external view returns (uint256) - ``` - - Returns the number of votes a candidate received. Requires the election to be partially or totally evaluated - -#### getElectionWinners - - ```solidity - function getElectionWinners() external view returns (address[]) - ``` - - Returns the winners of the current election. Requires the election to be partially or totally evaluated - -#### getCouncilToken - - ```solidity - function getCouncilToken() external view returns (address) - ``` - - Returns the address of the council NFT token - -#### getCouncilMembers - - ```solidity - function getCouncilMembers() external view returns (address[]) - ``` - - Returns the current NFT token holders - -### Synthetix Election Module - -#### initOrUpgradeElectionModule - - ```solidity - function initOrUpgradeElectionModule(address[] firstCouncil, uint8 minimumActiveMembers, uint64 nominationPeriodStartDate, uint64 votingPeriodStartDate, uint64 epochEndDate, address debtShareContract) external - ``` - - Initializes the module and immediately starts the first epoch - -#### setDebtShareContract - - ```solidity - function setDebtShareContract(address newDebtShareContractAddress) external - ``` - - Sets the Synthetix v2 DebtShare contract that determines vote power - -#### getDebtShareContract - - ```solidity - function getDebtShareContract() external view returns (address) - ``` - - Returns the Synthetix v2 DebtShare contract that determines vote power - -#### setDebtShareSnapshotId - - ```solidity - function setDebtShareSnapshotId(uint256 snapshotId) external - ``` - - Sets the Synthetix v2 DebtShare snapshot that determines vote power for this epoch - -#### getDebtShareSnapshotId - - ```solidity - function getDebtShareSnapshotId() external view returns (uint256) - ``` - - Returns the Synthetix v2 DebtShare snapshot id set for this epoch - -#### getDebtShare - - ```solidity - function getDebtShare(address user) external view returns (uint256) - ``` - - Returns the Synthetix v2 debt share for the provided address, at this epoch's snapshot - -#### setCrossChainDebtShareMerkleRoot - - ```solidity - function setCrossChainDebtShareMerkleRoot(bytes32 merkleRoot, uint256 blocknumber) external - ``` - - Allows the system owner to declare a merkle root for user debt shares on other chains for this epoch - -#### getCrossChainDebtShareMerkleRoot - - ```solidity - function getCrossChainDebtShareMerkleRoot() external view returns (bytes32) - ``` - - Returns the current epoch's merkle root for user debt shares on other chains - -#### getCrossChainDebtShareMerkleRootBlockNumber - - ```solidity - function getCrossChainDebtShareMerkleRootBlockNumber() external view returns (uint256) - ``` - - Returns the current epoch's merkle root block number - -#### declareCrossChainDebtShare - - ```solidity - function declareCrossChainDebtShare(address account, uint256 debtShare, bytes32[] merkleProof) external - ``` - - Allows users to declare their Synthetix v2 debt shares on other chains - -#### getDeclaredCrossChainDebtShare - - ```solidity - function getDeclaredCrossChainDebtShare(address account) external view returns (uint256) - ``` - - Returns the Synthetix v2 debt shares for the provided address, at this epoch's snapshot, in other chains - -#### declareAndCast - - ```solidity - function declareAndCast(uint256 debtShare, bytes32[] merkleProof, address[] candidates) external - ``` - - Declares cross chain debt shares and casts a vote - -#### initOrUpgradeElectionModule - - ```solidity - function initOrUpgradeElectionModule(address[] firstCouncil, uint8 minimumActiveMembers, uint64 nominationPeriodStartDate, uint64 votingPeriodStartDate, uint64 epochEndDate) external - ``` - - Initializes the module and immediately starts the first epoch - -#### isElectionModuleInitialized - - ```solidity - function isElectionModuleInitialized() external view returns (bool) - ``` - - Shows whether the module has been initialized - -#### tweakEpochSchedule - - ```solidity - function tweakEpochSchedule(uint64 newNominationPeriodStartDate, uint64 newVotingPeriodStartDate, uint64 newEpochEndDate) external - ``` - - Adjusts the current epoch schedule requiring that the current period remains Administration, and that changes are small (see setMaxDateAdjustmentTolerance) - -#### modifyEpochSchedule - - ```solidity - function modifyEpochSchedule(uint64 newNominationPeriodStartDate, uint64 newVotingPeriodStartDate, uint64 newEpochEndDate) external - ``` - - Adjusts the current epoch schedule requiring that the current period remains Administration - -#### setMinEpochDurations - - ```solidity - function setMinEpochDurations(uint64 newMinNominationPeriodDuration, uint64 newMinVotingPeriodDuration, uint64 newMinEpochDuration) external - ``` - - Determines minimum values for epoch schedule adjustments - -#### setMaxDateAdjustmentTolerance - - ```solidity - function setMaxDateAdjustmentTolerance(uint64 newMaxDateAdjustmentTolerance) external - ``` - - Determines adjustment size for tweakEpochSchedule - -#### setDefaultBallotEvaluationBatchSize - - ```solidity - function setDefaultBallotEvaluationBatchSize(uint256 newDefaultBallotEvaluationBatchSize) external - ``` - - Determines batch size when evaluate() is called with numBallots = 0 - -#### setNextEpochSeatCount - - ```solidity - function setNextEpochSeatCount(uint8 newSeatCount) external - ``` - - Determines the number of council members in the next epoch - -#### setMinimumActiveMembers - - ```solidity - function setMinimumActiveMembers(uint8 newMinimumActiveMembers) external - ``` - - Determines the minimum number of council members before triggering an emergency election - -#### dismissMembers - - ```solidity - function dismissMembers(address[] members) external - ``` - - Allows the owner to remove one or more council members, triggering an election if a threshold is met - -#### nominate - - ```solidity - function nominate() external - ``` - - Allows anyone to self-nominate during the Nomination period - -#### withdrawNomination - - ```solidity - function withdrawNomination() external - ``` - - Self-withdrawal of nominations during the Nomination period - -#### cast - - ```solidity - function cast(address[] candidates) external - ``` - - Allows anyone with vote power to vote on nominated candidates during the Voting period - -#### withdrawVote - - ```solidity - function withdrawVote() external - ``` - - Allows votes to be withdraw - -#### evaluate - - ```solidity - function evaluate(uint256 numBallots) external - ``` - - Processes ballots in batches during the Evaluation period (after epochEndDate) - -#### resolve - - ```solidity - function resolve() external - ``` - - Shuffles NFTs and resolves an election after it has been evaluated - -#### getMinEpochDurations - - ```solidity - function getMinEpochDurations() external view returns (uint64 minNominationPeriodDuration, uint64 minVotingPeriodDuration, uint64 minEpochDuration) - ``` - - Exposes minimum durations required when adjusting epoch schedules - -#### getMaxDateAdjustmenTolerance - - ```solidity - function getMaxDateAdjustmenTolerance() external view returns (uint64) - ``` - - Exposes maximum size of adjustments when calling tweakEpochSchedule - -#### getDefaultBallotEvaluationBatchSize - - ```solidity - function getDefaultBallotEvaluationBatchSize() external view returns (uint256) - ``` - - Shows the default batch size when calling evaluate() with numBallots = 0 - -#### getNextEpochSeatCount - - ```solidity - function getNextEpochSeatCount() external view returns (uint8) - ``` - - Shows the number of council members that the next epoch will have - -#### getMinimumActiveMembers - - ```solidity - function getMinimumActiveMembers() external view returns (uint8) - ``` - - Returns the minimum active members that the council needs to avoid an emergency election - -#### getEpochIndex - - ```solidity - function getEpochIndex() external view returns (uint256) - ``` - - Returns the index of the current epoch. The first epoch's index is 1 - -#### getEpochStartDate - - ```solidity - function getEpochStartDate() external view returns (uint64) - ``` - - Returns the date in which the current epoch started - -#### getEpochEndDate - - ```solidity - function getEpochEndDate() external view returns (uint64) - ``` - - Returns the date in which the current epoch will end - -#### getNominationPeriodStartDate - - ```solidity - function getNominationPeriodStartDate() external view returns (uint64) - ``` - - Returns the date in which the Nomination period in the current epoch will start - -#### getVotingPeriodStartDate - - ```solidity - function getVotingPeriodStartDate() external view returns (uint64) - ``` - - Returns the date in which the Voting period in the current epoch will start - -#### getCurrentPeriod - - ```solidity - function getCurrentPeriod() external view returns (uint256) - ``` - - Returns the current period type: Administration, Nomination, Voting, Evaluation - -#### isNominated - - ```solidity - function isNominated(address candidate) external view returns (bool) - ``` - - Shows if a candidate has been nominated in the current epoch - -#### getNominees - - ```solidity - function getNominees() external view returns (address[]) - ``` - - Returns a list of all nominated candidates in the current epoch - -#### calculateBallotId - - ```solidity - function calculateBallotId(address[] candidates) external pure returns (bytes32) - ``` - - Hashes a list of candidates (used for identifying and storing ballots) - -#### getBallotVoted - - ```solidity - function getBallotVoted(address user) external view returns (bytes32) - ``` - - Returns the ballot id that user voted on in the current election - -#### hasVoted - - ```solidity - function hasVoted(address user) external view returns (bool) - ``` - - Returns if user has voted in the current election - -#### getVotePower - - ```solidity - function getVotePower(address user) external view returns (uint256) - ``` - - Returns the vote power of user in the current election - -#### getBallotVotes - - ```solidity - function getBallotVotes(bytes32 ballotId) external view returns (uint256) - ``` - - Returns the number of votes given to a particular ballot - -#### getBallotCandidates - - ```solidity - function getBallotCandidates(bytes32 ballotId) external view returns (address[]) - ``` - - Returns the list of candidates that a particular ballot has - -#### isElectionEvaluated - - ```solidity - function isElectionEvaluated() external view returns (bool) - ``` - - Returns whether all ballots in the current election have been counted - -#### getCandidateVotes - - ```solidity - function getCandidateVotes(address candidate) external view returns (uint256) - ``` - - Returns the number of votes a candidate received. Requires the election to be partially or totally evaluated - -#### getElectionWinners - - ```solidity - function getElectionWinners() external view returns (address[]) - ``` - - Returns the winners of the current election. Requires the election to be partially or totally evaluated - -#### getCouncilToken - - ```solidity - function getCouncilToken() external view returns (address) - ``` - - Returns the address of the council NFT token - -#### getCouncilMembers - - ```solidity - function getCouncilMembers() external view returns (address[]) - ``` - - Returns the current NFT token holders - diff --git a/protocol/oracle-manager/docs/index.md b/protocol/oracle-manager/docs/index.md deleted file mode 100644 index e92f5fcecb..0000000000 --- a/protocol/oracle-manager/docs/index.md +++ /dev/null @@ -1,251 +0,0 @@ -### Node Module - -#### registerNode - - ```solidity - function registerNode(enum NodeDefinition.NodeType nodeType, bytes parameters, bytes32[] parents) external returns (bytes32 nodeId) - ``` - - Registers a node - -**Parameters** -* `nodeType` (*enum NodeDefinition.NodeType*) - The nodeType assigned to this node. -* `parameters` (*bytes*) - The parameters assigned to this node. -* `parents` (*bytes32[]*) - The parents assigned to this node. - -**Returns** -* `nodeId` (*bytes32*) - The id of the registered node. -#### getNodeId - - ```solidity - function getNodeId(enum NodeDefinition.NodeType nodeType, bytes parameters, bytes32[] parents) external returns (bytes32 nodeId) - ``` - - Returns the ID of a node, whether or not it has been registered. - -**Parameters** -* `nodeType` (*enum NodeDefinition.NodeType*) - The nodeType assigned to this node. -* `parameters` (*bytes*) - The parameters assigned to this node. -* `parents` (*bytes32[]*) - The parents assigned to this node. - -**Returns** -* `nodeId` (*bytes32*) - The id of the node. -#### getNode - - ```solidity - function getNode(bytes32 nodeId) external pure returns (struct NodeDefinition.Data node) - ``` - - Returns a node's definition (type, parameters, and parents) - -**Parameters** -* `nodeId` (*bytes32*) - The node ID - -**Returns** -* `node` (*struct NodeDefinition.Data*) - The node's definition data -#### process - - ```solidity - function process(bytes32 nodeId) external view returns (struct NodeOutput.Data node) - ``` - - Returns a node current output data - -**Parameters** -* `nodeId` (*bytes32*) - The node ID - -**Returns** -* `node` (*struct NodeOutput.Data*) - The node's output data - -#### NodeRegistered - - ```solidity - event NodeRegistered(bytes32 nodeId, enum NodeDefinition.NodeType nodeType, bytes parameters, bytes32[] parents) - ``` - - Emitted when `registerNode` is called. - -**Parameters** -* `nodeId` (*bytes32*) - The id of the registered node. -* `nodeType` (*enum NodeDefinition.NodeType*) - The nodeType assigned to this node. -* `parameters` (*bytes*) - The parameters assigned to this node. -* `parents` (*bytes32[]*) - The parents assigned to this node. - -### ChainlinkNode - -#### process - - ```solidity - function process(bytes parameters) internal view returns (struct NodeOutput.Data nodeOutput) - ``` - -#### getTwapPrice - - ```solidity - function getTwapPrice(contract IAggregatorV3Interface chainlink, uint80 latestRoundId, int256 latestPrice, uint256 twapTimeInterval) internal view returns (int256 price) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal view returns (bool valid) - ``` - -### ConstantNode - -#### process - - ```solidity - function process(bytes parameters) internal view returns (struct NodeOutput.Data nodeOutput) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal pure returns (bool valid) - ``` - -### ExternalNode - -#### process - - ```solidity - function process(struct NodeOutput.Data[] prices, bytes parameters) internal view returns (struct NodeOutput.Data nodeOutput) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal returns (bool valid) - ``` - -### PriceDeviationCircuitBreakerNode - -#### process - - ```solidity - function process(struct NodeOutput.Data[] parentNodeOutputs, bytes parameters) internal pure returns (struct NodeOutput.Data nodeOutput) - ``` - -#### abs - - ```solidity - function abs(int256 x) private pure returns (int256 result) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal pure returns (bool valid) - ``` - -### PythNode - -#### process - - ```solidity - function process(bytes parameters) internal view returns (struct NodeOutput.Data nodeOutput) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal view returns (bool valid) - ``` - -### ReducerNode - -#### process - - ```solidity - function process(struct NodeOutput.Data[] parentNodeOutputs, bytes parameters) internal pure returns (struct NodeOutput.Data nodeOutput) - ``` - -#### median - - ```solidity - function median(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data medianPrice) - ``` - -#### mean - - ```solidity - function mean(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data meanPrice) - ``` - -#### recent - - ```solidity - function recent(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data recentPrice) - ``` - -#### max - - ```solidity - function max(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data maxPrice) - ``` - -#### min - - ```solidity - function min(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data minPrice) - ``` - -#### mul - - ```solidity - function mul(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data mulPrice) - ``` - -#### div - - ```solidity - function div(struct NodeOutput.Data[] parentNodeOutputs) internal pure returns (struct NodeOutput.Data divPrice) - ``` - -#### quickSort - - ```solidity - function quickSort(struct NodeOutput.Data[] arr, int256 left, int256 right) internal pure - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal pure returns (bool valid) - ``` - -### StalenessCircuitBreakerNode - -#### process - - ```solidity - function process(struct NodeOutput.Data[] parentNodeOutputs, bytes parameters) internal view returns (struct NodeOutput.Data nodeOutput) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal pure returns (bool valid) - ``` - -### UniswapNode - -#### process - - ```solidity - function process(bytes parameters) internal view returns (struct NodeOutput.Data nodeOutput) - ``` - -#### getQuoteAtTick - - ```solidity - function getQuoteAtTick(int24 tick, uint256 baseAmount, address baseToken, address quoteToken) internal pure returns (uint256 quoteAmount) - ``` - -#### isValid - - ```solidity - function isValid(struct NodeDefinition.Data nodeDefinition) internal view returns (bool valid) - ``` - diff --git a/protocol/synthetix/docs/index.md b/protocol/synthetix/docs/index.md deleted file mode 100644 index a186ef418a..0000000000 --- a/protocol/synthetix/docs/index.md +++ /dev/null @@ -1,2333 +0,0 @@ -### Account Module - -#### getAccountPermissions - - ```solidity - function getAccountPermissions(uint128 accountId) external view returns (struct IAccountModule.AccountPermissions[] accountPerms) - ``` - - Returns an array of `AccountPermission` for the provided `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose permissions are being retrieved. - -**Returns** -* `accountPerms` (*struct IAccountModule.AccountPermissions[]*) - An array of AccountPermission objects describing the permissions granted to the account. -#### createAccount - - ```solidity - function createAccount(uint128 requestedAccountId) external - ``` - - Mints an account token with id `requestedAccountId` to `msg.sender`. - -**Parameters** -* `requestedAccountId` (*uint128*) - The id requested for the account being created. Reverts if id already exists. Requirements: - `requestedAccountId` must not already be minted. - `requestedAccountId` must be less than type(uint128).max / 2 Emits a {AccountCreated} event. - -#### createAccount - - ```solidity - function createAccount() external returns (uint128 accountId) - ``` - - Mints an account token with an available id to `msg.sender`. - -Emits a {AccountCreated} event. - -#### notifyAccountTransfer - - ```solidity - function notifyAccountTransfer(address to, uint128 accountId) external - ``` - - Called by AccountTokenModule to notify the system when the account token is transferred. - - Resets user permissions and assigns ownership of the account token to the new holder. - -**Parameters** -* `to` (*address*) - The new holder of the account NFT. -* `accountId` (*uint128*) - The id of the account that was just transferred. Requirements: - `msg.sender` must be the account token. - -#### grantPermission - - ```solidity - function grantPermission(uint128 accountId, bytes32 permission, address user) external - ``` - - Grants `permission` to `user` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that granted the permission. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. -* `user` (*address*) - The target address that received the permission. Requirements: - `msg.sender` must own the account token with ID `accountId` or have the "admin" permission. Emits a {PermissionGranted} event. - -#### revokePermission - - ```solidity - function revokePermission(uint128 accountId, bytes32 permission, address user) external - ``` - - Revokes `permission` from `user` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that revoked the permission. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. -* `user` (*address*) - The target address that no longer has the permission. Requirements: - `msg.sender` must own the account token with ID `accountId` or have the "admin" permission. Emits a {PermissionRevoked} event. - -#### renouncePermission - - ```solidity - function renouncePermission(uint128 accountId, bytes32 permission) external - ``` - - Revokes `permission` from `msg.sender` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose permission was renounced. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. Emits a {PermissionRevoked} event. - -#### hasPermission - - ```solidity - function hasPermission(uint128 accountId, bytes32 permission, address user) external view returns (bool hasPermission) - ``` - - Returns `true` if `user` has been granted `permission` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose permission is being queried. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. -* `user` (*address*) - The target address whose permission is being queried. - -**Returns** -* `hasPermission` (*bool*) - A boolean with the response of the query. -#### isAuthorized - - ```solidity - function isAuthorized(uint128 accountId, bytes32 permission, address target) external view returns (bool isAuthorized) - ``` - - Returns `true` if `target` is authorized to `permission` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose permission is being queried. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. -* `target` (*address*) - The target address whose permission is being queried. - -**Returns** -* `isAuthorized` (*bool*) - A boolean with the response of the query. -#### getAccountTokenAddress - - ```solidity - function getAccountTokenAddress() external view returns (address accountNftToken) - ``` - - Returns the address for the account token used by the module. - -**Returns** -* `accountNftToken` (*address*) - The address of the account token. -#### getAccountOwner - - ```solidity - function getAccountOwner(uint128 accountId) external view returns (address owner) - ``` - - Returns the address that owns a given account, as recorded by the system. - -**Parameters** -* `accountId` (*uint128*) - The account id whose owner is being retrieved. - -**Returns** -* `owner` (*address*) - The owner of the given account id. -#### getAccountLastInteraction - - ```solidity - function getAccountLastInteraction(uint128 accountId) external view returns (uint256 timestamp) - ``` - - Returns the last unix timestamp that a permissioned action was taken with this account - -**Parameters** -* `accountId` (*uint128*) - The account id to check - -**Returns** -* `timestamp` (*uint256*) - The unix timestamp of the last time a permissioned action occured with the account - -#### AccountCreated - - ```solidity - event AccountCreated(uint128 accountId, address owner) - ``` - - Emitted when an account token with id `accountId` is minted to `sender`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account. -* `owner` (*address*) - The address that owns the created account. - -#### PermissionGranted - - ```solidity - event PermissionGranted(uint128 accountId, bytes32 permission, address user, address sender) - ``` - - Emitted when `user` is granted `permission` by `sender` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that granted the permission. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. -* `user` (*address*) - The target address to whom the permission was granted. -* `sender` (*address*) - The Address that granted the permission. - -#### PermissionRevoked - - ```solidity - event PermissionRevoked(uint128 accountId, bytes32 permission, address user, address sender) - ``` - - Emitted when `user` has `permission` renounced or revoked by `sender` for account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that has had the permission revoked. -* `permission` (*bytes32*) - The bytes32 identifier of the permission. -* `user` (*address*) - The target address for which the permission was revoked. -* `sender` (*address*) - The address that revoked the permission. - -### Account Token Module - -#### isInitialized - - ```solidity - function isInitialized() external returns (bool) - ``` - - Returns whether the token has been initialized. - -**Returns** -* `[0]` (*bool*) - A boolean with the result of the query. -#### initialize - - ```solidity - function initialize(string tokenName, string tokenSymbol, string uri) external - ``` - - Initializes the token with name, symbol, and uri. - -#### mint - - ```solidity - function mint(address to, uint256 tokenId) external - ``` - - Allows the owner to mint tokens. - -**Parameters** -* `to` (*address*) - The address to receive the newly minted tokens. -* `tokenId` (*uint256*) - The ID of the newly minted token - -#### safeMint - - ```solidity - function safeMint(address to, uint256 tokenId, bytes data) external - ``` - - Allows the owner to mint tokens. Verifies that the receiver can receive the token - -**Parameters** -* `to` (*address*) - The address to receive the newly minted token. -* `tokenId` (*uint256*) - The ID of the newly minted token -* `data` (*bytes*) - any data which should be sent to the receiver - -#### burn - - ```solidity - function burn(uint256 tokenId) external - ``` - - Allows the owner to burn tokens. - -**Parameters** -* `tokenId` (*uint256*) - The token to burn - -#### setAllowance - - ```solidity - function setAllowance(uint256 tokenId, address spender) external - ``` - - Allows an address that holds tokens to provide allowance to another. - -**Parameters** -* `tokenId` (*uint256*) - The token which should be allowed to spender -* `spender` (*address*) - The address that is given allowance. - -#### setBaseTokenURI - - ```solidity - function setBaseTokenURI(string uri) external - ``` - - Allows the owner to update the base token URI. - -**Parameters** -* `uri` (*string*) - The new base token uri - -#### totalSupply - - ```solidity - function totalSupply() external view returns (uint256) - ``` - - Returns the total amount of tokens stored by the contract. - -#### tokenOfOwnerByIndex - - ```solidity - function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256) - ``` - - Returns a token ID owned by `owner` at a given `index` of its token list. -Use along with {balanceOf} to enumerate all of ``owner``'s tokens. - -Requirements: -- `owner` must be a valid address -- `index` must be less than the balance of the tokens for the owner - -#### tokenByIndex - - ```solidity - function tokenByIndex(uint256 index) external view returns (uint256) - ``` - - Returns a token ID at a given `index` of all the tokens stored by the contract. -Use along with {totalSupply} to enumerate all tokens. - -Requirements: -- `index` must be less than the total supply of the tokens - -#### balanceOf - - ```solidity - function balanceOf(address holder) external view returns (uint256 balance) - ``` - - Returns the number of tokens in ``owner``'s account. - -Requirements: - -- `holder` must be a valid address - -#### ownerOf - - ```solidity - function ownerOf(uint256 tokenId) external view returns (address owner) - ``` - - Returns the owner of the `tokenId` token. - -Requirements: - -- `tokenId` must exist. - -#### safeTransferFrom - - ```solidity - function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external - ``` - - Safely transfers `tokenId` token from `from` to `to`. - -Requirements: - -- `from` cannot be the zero address. -- `to` cannot be the zero address. -- `tokenId` token must exist and be owned by `from`. -- If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. -- If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - -Emits a {Transfer} event. - -#### safeTransferFrom - - ```solidity - function safeTransferFrom(address from, address to, uint256 tokenId) external - ``` - - Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients -are aware of the ERC721 protocol to prevent tokens from being forever locked. - -Requirements: - -- `from` cannot be the zero address. -- `to` cannot be the zero address. -- `tokenId` token must exist and be owned by `from`. -- If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. -- If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - -Emits a {Transfer} event. - -#### transferFrom - - ```solidity - function transferFrom(address from, address to, uint256 tokenId) external - ``` - - Transfers `tokenId` token from `from` to `to`. - -WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. - -Requirements: - -- `from` cannot be the zero address. -- `to` cannot be the zero address. -- `tokenId` token must be owned by `from`. -- If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - -Emits a {Transfer} event. - -#### approve - - ```solidity - function approve(address to, uint256 tokenId) external - ``` - - Gives permission to `to` to transfer `tokenId` token to another account. -The approval is cleared when the token is transferred. - -Only a single account can be approved at a time, so approving the zero address clears previous approvals. - -Requirements: - -- The caller must own the token or be an approved operator. -- `tokenId` must exist. - -Emits an {Approval} event. - -#### setApprovalForAll - - ```solidity - function setApprovalForAll(address operator, bool approved) external - ``` - - Approve or remove `operator` as an operator for the caller. -Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. - -Requirements: - -- The `operator` cannot be the caller. - -Emits an {ApprovalForAll} event. - -#### getApproved - - ```solidity - function getApproved(uint256 tokenId) external view returns (address operator) - ``` - - Returns the account approved for `tokenId` token. - -Requirements: - -- `tokenId` must exist. - -#### isApprovedForAll - - ```solidity - function isApprovedForAll(address owner, address operator) external view returns (bool) - ``` - - Returns if the `operator` is allowed to manage all of the assets of `owner`. - -See {setApprovalForAll} - -#### Transfer - - ```solidity - event Transfer(address from, address to, uint256 tokenId) - ``` - - Emitted when `tokenId` token is transferred from `from` to `to`. - -#### Approval - - ```solidity - event Approval(address owner, address approved, uint256 tokenId) - ``` - - Emitted when `owner` enables `approved` to manage the `tokenId` token. - -#### ApprovalForAll - - ```solidity - event ApprovalForAll(address owner, address operator, bool approved) - ``` - - Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. - -### Associate Debt Module - -#### associateDebt - - ```solidity - function associateDebt(uint128 marketId, uint128 poolId, address collateralType, uint128 accountId, uint256 amount) external returns (int256 debtAmount) - ``` - - Allows a market to associate debt with a specific position. -The specified debt will be removed from all vault participants pro-rata. After removing the debt, the amount will -be allocated directly to the specified account. -**NOTE**: if the specified account is an existing staker on the vault, their position will be included in the pro-rata -reduction. Ex: if there are 10 users staking 10 USD of debt on a pool, and associate debt is called with 10 USD on one of those users, -their debt after the operation is complete will be 19 USD. This might seem unusual, but its actually ideal behavior when -your market has incurred some new debt, and it wants to allocate this amount directly to a specific user. In this case, the user's -debt balance would increase pro rata, but then get decreased pro-rata, and then increased to the full amount on their account. All -other accounts would be left with no change to their debt, however. - -**Parameters** -* `marketId` (*uint128*) - The id of the market to which debt was associated. -* `poolId` (*uint128*) - The id of the pool associated to the target market. -* `collateralType` (*address*) - The address of the collateral type that acts as collateral in the corresponding pool. -* `accountId` (*uint128*) - The id of the account whose debt is being associated. -* `amount` (*uint256*) - The amount of debt being associated with the specified account, denominated with 18 decimals of precision. - -**Returns** -* `debtAmount` (*int256*) - The updated debt of the position, denominated with 18 decimals of precision. - -#### DebtAssociated - - ```solidity - event DebtAssociated(uint128 marketId, uint128 poolId, address collateralType, uint128 accountId, uint256 amount, int256 updatedDebt) - ``` - - Emitted when `associateDebt` is called. - -**Parameters** -* `marketId` (*uint128*) - The id of the market to which debt was associated. -* `poolId` (*uint128*) - The id of the pool associated to the target market. -* `collateralType` (*address*) - The address of the collateral type that acts as collateral in the corresponding pool. -* `accountId` (*uint128*) - The id of the account whose debt is being associated. -* `amount` (*uint256*) - The amount of debt being associated with the specified account, denominated with 18 decimals of precision. -* `updatedDebt` (*int256*) - The total updated debt of the account, denominated with 18 decimals of precision - -### Collateral Configuration Module - -#### configureCollateral - - ```solidity - function configureCollateral(struct CollateralConfiguration.Data config) external - ``` - - Creates or updates the configuration for the given `collateralType`. - -**Parameters** -* `config` (*struct CollateralConfiguration.Data*) - The CollateralConfiguration object describing the new configuration. Requirements: - `msg.sender` must be the owner of the system. Emits a {CollateralConfigured} event. - -#### getCollateralConfigurations - - ```solidity - function getCollateralConfigurations(bool hideDisabled) external view returns (struct CollateralConfiguration.Data[] collaterals) - ``` - - Returns a list of detailed information pertaining to all collateral types registered in the system. - - Optionally returns only those that are currently enabled. - -**Parameters** -* `hideDisabled` (*bool*) - Wether to hide disabled collaterals or just return the full list of collaterals in the system. - -**Returns** -* `collaterals` (*struct CollateralConfiguration.Data[]*) - The list of collateral configuration objects set in the system. -#### getCollateralConfiguration - - ```solidity - function getCollateralConfiguration(address collateralType) external view returns (struct CollateralConfiguration.Data collateral) - ``` - - Returns detailed information pertaining the specified collateral type. - -**Parameters** -* `collateralType` (*address*) - The address for the collateral whose configuration is being queried. - -**Returns** -* `collateral` (*struct CollateralConfiguration.Data*) - The configuration object describing the given collateral. -#### getCollateralPrice - - ```solidity - function getCollateralPrice(address collateralType) external view returns (uint256 priceD18) - ``` - - Returns the current value of a specified collateral type. - -**Parameters** -* `collateralType` (*address*) - The address for the collateral whose price is being queried. - -**Returns** -* `priceD18` (*uint256*) - The price of the given collateral, denominated with 18 decimals of precision. - -#### CollateralConfigured - - ```solidity - event CollateralConfigured(address collateralType, struct CollateralConfiguration.Data config) - ``` - - Emitted when a collateral type’s configuration is created or updated. - -**Parameters** -* `collateralType` (*address*) - The address of the collateral type that was just configured. -* `config` (*struct CollateralConfiguration.Data*) - The object with the newly configured details. - -### Collateral Module - -#### deposit - - ```solidity - function deposit(uint128 accountId, address collateralType, uint256 tokenAmount) external - ``` - - Deposits `tokenAmount` of collateral of type `collateralType` into account `accountId`. - - Anyone can deposit into anyone's active account without restriction. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that is making the deposit. -* `collateralType` (*address*) - The address of the token to be deposited. -* `tokenAmount` (*uint256*) - The amount being deposited, denominated in the token's native decimal representation. Emits a {Deposited} event. - -#### withdraw - - ```solidity - function withdraw(uint128 accountId, address collateralType, uint256 tokenAmount) external - ``` - - Withdraws `tokenAmount` of collateral of type `collateralType` from account `accountId`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that is making the withdrawal. -* `collateralType` (*address*) - The address of the token to be withdrawn. -* `tokenAmount` (*uint256*) - The amount being withdrawn, denominated in the token's native decimal representation. Requirements: - `msg.sender` must be the owner of the account, have the `ADMIN` permission, or have the `WITHDRAW` permission. Emits a {Withdrawn} event. - -#### getAccountCollateral - - ```solidity - function getAccountCollateral(uint128 accountId, address collateralType) external view returns (uint256 totalDeposited, uint256 totalAssigned, uint256 totalLocked) - ``` - - Returns the total values pertaining to account `accountId` for `collateralType`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose collateral is being queried. -* `collateralType` (*address*) - The address of the collateral type whose amount is being queried. - -**Returns** -* `totalDeposited` (*uint256*) - The total collateral deposited in the account, denominated with 18 decimals of precision. -* `totalAssigned` (*uint256*) - The amount of collateral in the account that is delegated to pools, denominated with 18 decimals of precision. -* `totalLocked` (*uint256*) - The amount of collateral in the account that cannot currently be undelegated from a pool, denominated with 18 decimals of precision. -#### getAccountAvailableCollateral - - ```solidity - function getAccountAvailableCollateral(uint128 accountId, address collateralType) external view returns (uint256 amountD18) - ``` - - Returns the amount of collateral of type `collateralType` deposited with account `accountId` that can be withdrawn or delegated to pools. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose collateral is being queried. -* `collateralType` (*address*) - The address of the collateral type whose amount is being queried. - -**Returns** -* `amountD18` (*uint256*) - The amount of collateral that is available for withdrawal or delegation, denominated with 18 decimals of precision. -#### cleanExpiredLocks - - ```solidity - function cleanExpiredLocks(uint128 accountId, address collateralType, uint256 offset, uint256 count) external returns (uint256 cleared) - ``` - - Clean expired locks from locked collateral arrays for an account/collateral type. It includes offset and items to prevent gas exhaustion. If both, offset and items, are 0 it will traverse the whole array (unlimited). - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose locks are being cleared. -* `collateralType` (*address*) - The address of the collateral type to clean locks for. -* `offset` (*uint256*) - The index of the first lock to clear. -* `count` (*uint256*) - The number of slots to check for cleaning locks. Set to 0 to clean all locks at/after offset - -**Returns** -* `cleared` (*uint256*) - the number of locks that were actually expired (and therefore cleared) -#### getLocks - - ```solidity - function getLocks(uint128 accountId, address collateralType, uint256 offset, uint256 count) external view returns (struct CollateralLock.Data[] locks) - ``` - - Get a list of locks existing in account. Lists all locks in storage, even if they are expired - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose locks we want to read -* `collateralType` (*address*) - The address of the collateral type for locks we want to read -* `offset` (*uint256*) - The index of the first lock to read -* `count` (*uint256*) - The number of slots to check for cleaning locks. Set to 0 to read all locks after offset - -#### createLock - - ```solidity - function createLock(uint128 accountId, address collateralType, uint256 amount, uint64 expireTimestamp) external - ``` - - Create a new lock on the given account. you must have `admin` permission on the specified account to create a lock. - - Collateral can be withdrawn from the system if it is not assigned or delegated to a pool. Collateral locks are an additional restriction that applies on top of that. I.e. if collateral is not assigned to a pool, but has a lock, it cannot be withdrawn. -Collateral locks are initially intended for the Synthetix v2 to v3 migration, but may be used in the future by the Spartan Council, for example, to create and hand off accounts whose withdrawals from the system are locked for a given amount of time. - -**Parameters** -* `accountId` (*uint128*) - The id of the account for which a lock is to be created. -* `collateralType` (*address*) - The address of the collateral type for which the lock will be created. -* `amount` (*uint256*) - The amount of collateral tokens to wrap in the lock being created, denominated with 18 decimals of precision. -* `expireTimestamp` (*uint64*) - The date in which the lock will become clearable. - -#### Deposited - - ```solidity - event Deposited(uint128 accountId, address collateralType, uint256 tokenAmount, address sender) - ``` - - Emitted when `tokenAmount` of collateral of type `collateralType` is deposited to account `accountId` by `sender`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that deposited collateral. -* `collateralType` (*address*) - The address of the collateral that was deposited. -* `tokenAmount` (*uint256*) - The amount of collateral that was deposited, denominated in the token's native decimal representation. -* `sender` (*address*) - The address of the account that triggered the deposit. - -#### CollateralLockCreated - - ```solidity - event CollateralLockCreated(uint128 accountId, address collateralType, uint256 tokenAmount, uint64 expireTimestamp) - ``` - - Emitted when a lock is created on someone's account - -**Parameters** -* `accountId` (*uint128*) - The id of the account that received a lock -* `collateralType` (*address*) - The address of the collateral type that was locked -* `tokenAmount` (*uint256*) - The amount of collateral that was locked, demoninated in system units (1e18) -* `expireTimestamp` (*uint64*) - unix timestamp at which the lock is due to expire - -#### CollateralLockExpired - - ```solidity - event CollateralLockExpired(uint128 accountId, address collateralType, uint256 tokenAmount, uint64 expireTimestamp) - ``` - - Emitted when a lock is cleared from an account due to expiration - -**Parameters** -* `accountId` (*uint128*) - The id of the account that has the expired lock -* `collateralType` (*address*) - The address of the collateral type that was unlocked -* `tokenAmount` (*uint256*) - The amount of collateral that was unlocked, demoninated in system units (1e18) -* `expireTimestamp` (*uint64*) - unix timestamp at which the unlock is due to expire - -#### Withdrawn - - ```solidity - event Withdrawn(uint128 accountId, address collateralType, uint256 tokenAmount, address sender) - ``` - - Emitted when `tokenAmount` of collateral of type `collateralType` is withdrawn from account `accountId` by `sender`. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that withdrew collateral. -* `collateralType` (*address*) - The address of the collateral that was withdrawn. -* `tokenAmount` (*uint256*) - The amount of collateral that was withdrawn, denominated in the token's native decimal representation. -* `sender` (*address*) - The address of the account that triggered the withdrawal. - -### Cross ChainUSD Module - -#### transferCrossChain - - ```solidity - function transferCrossChain(uint64 destChainId, uint256 amount) external payable returns (uint256 gasTokenUsed) - ``` - - Allows users to transfer tokens cross-chain using CCIP. - -**Parameters** -* `destChainId` (*uint64*) - The id of the chain where tokens are to be transferred to. -* `amount` (*uint256*) - The amount of tokens to be transferred, denominated with 18 decimals of precision. - -**Returns** -* `gasTokenUsed` (*uint256*) - The amount of fees paid in the cross-chain transfer, denominated with 18 decimals of precision. - -#### TransferCrossChainInitiated - - ```solidity - event TransferCrossChainInitiated(uint64 destChainId, uint256 amount, address sender) - ``` - -### IssueUSD Module - -#### mintUsd - - ```solidity - function mintUsd(uint128 accountId, uint128 poolId, address collateralType, uint256 amount) external - ``` - - Mints {amount} of snxUSD with the specified liquidity position. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that is minting snxUSD. -* `poolId` (*uint128*) - The id of the pool whose collateral will be used to back up the mint. -* `collateralType` (*address*) - The address of the collateral that will be used to back up the mint. -* `amount` (*uint256*) - The amount of snxUSD to be minted, denominated with 18 decimals of precision. Requirements: - `msg.sender` must be the owner of the account, have the `ADMIN` permission, or have the `MINT` permission. - After minting, the collateralization ratio of the liquidity position must not be below the target collateralization ratio for the corresponding collateral type. Emits a {UsdMinted} event. - -#### burnUsd - - ```solidity - function burnUsd(uint128 accountId, uint128 poolId, address collateralType, uint256 amount) external - ``` - - Burns {amount} of snxUSD with the specified liquidity position. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that is burning snxUSD. -* `poolId` (*uint128*) - The id of the pool whose collateral was used to back up the snxUSD. -* `collateralType` (*address*) - The address of the collateral that was used to back up the snxUSD. -* `amount` (*uint256*) - The amount of snxUSD to be burnt, denominated with 18 decimals of precision. Emits a {UsdMinted} event. - -#### UsdMinted - - ```solidity - event UsdMinted(uint128 accountId, uint128 poolId, address collateralType, uint256 amount, address sender) - ``` - - Emitted when {sender} mints {amount} of snxUSD with the specified liquidity position. - -**Parameters** -* `accountId` (*uint128*) - The id of the account for which snxUSD was emitted. -* `poolId` (*uint128*) - The id of the pool whose collateral was used to emit the snxUSD. -* `collateralType` (*address*) - The address of the collateral that is backing up the emitted snxUSD. -* `amount` (*uint256*) - The amount of snxUSD emitted, denominated with 18 decimals of precision. -* `sender` (*address*) - The address that triggered the operation. - -#### UsdBurned - - ```solidity - event UsdBurned(uint128 accountId, uint128 poolId, address collateralType, uint256 amount, address sender) - ``` - - Emitted when {sender} burns {amount} of snxUSD with the specified liquidity position. - -**Parameters** -* `accountId` (*uint128*) - The id of the account for which snxUSD was burned. -* `poolId` (*uint128*) - The id of the pool whose collateral was used to emit the snxUSD. -* `collateralType` (*address*) - The address of the collateral that was backing up the emitted snxUSD. -* `amount` (*uint256*) - The amount of snxUSD burned, denominated with 18 decimals of precision. -* `sender` (*address*) - The address that triggered the operation. - -#### IssuanceFeePaid - - ```solidity - event IssuanceFeePaid(uint128 accountId, uint128 poolId, address collateralType, uint256 feeAmount) - ``` - -### Liquidation Module - -#### liquidate - - ```solidity - function liquidate(uint128 accountId, uint128 poolId, address collateralType, uint128 liquidateAsAccountId) external returns (struct ILiquidationModule.LiquidationData liquidationData) - ``` - - Liquidates a position by distributing its debt and collateral among other positions in its vault. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose position is to be liquidated. -* `poolId` (*uint128*) - The id of the pool which holds the position that is to be liquidated. -* `collateralType` (*address*) - The address of the collateral being used in the position that is to be liquidated. -* `liquidateAsAccountId` (*uint128*) - Account id that will receive the rewards from the liquidation. - -**Returns** -* `liquidationData` (*struct ILiquidationModule.LiquidationData*) - Information about the position that was liquidated. -#### liquidateVault - - ```solidity - function liquidateVault(uint128 poolId, address collateralType, uint128 liquidateAsAccountId, uint256 maxUsd) external returns (struct ILiquidationModule.LiquidationData liquidationData) - ``` - - Liquidates an entire vault. - - Can only be done if the vault itself is under collateralized. -LiquidateAsAccountId determines which account to deposit the seized collateral into (this is necessary particularly if the collateral in the vault is vesting). -Will only liquidate a portion of the debt for the vault if `maxUsd` is supplied. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose vault is being liquidated. -* `collateralType` (*address*) - The address of the collateral whose vault is being liquidated. -* `liquidateAsAccountId` (*uint128*) - -* `maxUsd` (*uint256*) - The maximum amount of USD that the liquidator is willing to provide for the liquidation, denominated with 18 decimals of precision. - -**Returns** -* `liquidationData` (*struct ILiquidationModule.LiquidationData*) - Information about the vault that was liquidated. -#### isPositionLiquidatable - - ```solidity - function isPositionLiquidatable(uint128 accountId, uint128 poolId, address collateralType) external returns (bool canLiquidate) - ``` - - Determines whether a specified position is liquidatable. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose position is being queried for liquidation. -* `poolId` (*uint128*) - The id of the pool whose position is being queried for liquidation. -* `collateralType` (*address*) - The address of the collateral backing up the position being queried for liquidation. - -**Returns** -* `canLiquidate` (*bool*) - A boolean with the response to the query. -#### isVaultLiquidatable - - ```solidity - function isVaultLiquidatable(uint128 poolId, address collateralType) external returns (bool canVaultLiquidate) - ``` - - Determines whether a specified vault is liquidatable. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that owns the vault that is being queried for liquidation. -* `collateralType` (*address*) - The address of the collateral being held at the vault that is being queried for liquidation. - -**Returns** -* `canVaultLiquidate` (*bool*) - A boolean with the response to the query. - -#### Liquidation - - ```solidity - event Liquidation(uint128 accountId, uint128 poolId, address collateralType, struct ILiquidationModule.LiquidationData liquidationData, uint128 liquidateAsAccountId, address sender) - ``` - - Emitted when an account is liquidated. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that was liquidated. -* `poolId` (*uint128*) - The pool id of the position that was liquidated. -* `collateralType` (*address*) - The collateral type used in the position that was liquidated. -* `liquidationData` (*struct ILiquidationModule.LiquidationData*) - The amount of collateral liquidated, debt liquidated, and collateral awarded to the liquidator. -* `liquidateAsAccountId` (*uint128*) - Account id that will receive the rewards from the liquidation. -* `sender` (*address*) - The address of the account that is triggering the liquidation. - -#### VaultLiquidation - - ```solidity - event VaultLiquidation(uint128 poolId, address collateralType, struct ILiquidationModule.LiquidationData liquidationData, uint128 liquidateAsAccountId, address sender) - ``` - - Emitted when a vault is liquidated. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose vault was liquidated. -* `collateralType` (*address*) - The collateral address of the vault that was liquidated. -* `liquidationData` (*struct ILiquidationModule.LiquidationData*) - The amount of collateral liquidated, debt liquidated, and collateral awarded to the liquidator. -* `liquidateAsAccountId` (*uint128*) - Account id that will receive the rewards from the liquidation. -* `sender` (*address*) - The address of the account that is triggering the liquidation. - -### Market Collateral Module - -#### depositMarketCollateral - - ```solidity - function depositMarketCollateral(uint128 marketId, address collateralType, uint256 amount) external - ``` - - Allows a market to deposit collateral. - -**Parameters** -* `marketId` (*uint128*) - The id of the market in which the collateral was directly deposited. -* `collateralType` (*address*) - The address of the collateral that was deposited in the market. -* `amount` (*uint256*) - The amount of collateral that was deposited, denominated in the token's native decimal representation. - -#### withdrawMarketCollateral - - ```solidity - function withdrawMarketCollateral(uint128 marketId, address collateralType, uint256 amount) external - ``` - - Allows a market to withdraw collateral that it has previously deposited. - -**Parameters** -* `marketId` (*uint128*) - The id of the market from which the collateral was withdrawn. -* `collateralType` (*address*) - The address of the collateral that was withdrawn from the market. -* `amount` (*uint256*) - The amount of collateral that was withdrawn, denominated in the token's native decimal representation. - -#### configureMaximumMarketCollateral - - ```solidity - function configureMaximumMarketCollateral(uint128 marketId, address collateralType, uint256 amount) external - ``` - - Allow the system owner to configure the maximum amount of a given collateral type that a specified market is allowed to deposit. - -**Parameters** -* `marketId` (*uint128*) - The id of the market for which the maximum is to be configured. -* `collateralType` (*address*) - The address of the collateral for which the maximum is to be applied. -* `amount` (*uint256*) - The amount that is to be set as the new maximum, denominated with 18 decimals of precision. - -#### getMaximumMarketCollateral - - ```solidity - function getMaximumMarketCollateral(uint128 marketId, address collateralType) external returns (uint256 amountD18) - ``` - - Return the total maximum amount of a given collateral type that a specified market is allowed to deposit. - -**Parameters** -* `marketId` (*uint128*) - The id of the market for which the maximum is being queried. -* `collateralType` (*address*) - The address of the collateral for which the maximum is being queried. - -**Returns** -* `amountD18` (*uint256*) - The maximum amount of collateral set for the market, denominated with 18 decimals of precision. -#### getMarketCollateralAmount - - ```solidity - function getMarketCollateralAmount(uint128 marketId, address collateralType) external view returns (uint256 amountD18) - ``` - - Return the total amount of a given collateral type that a specified market has deposited. - -**Parameters** -* `marketId` (*uint128*) - The id of the market for which the directly deposited collateral amount is being queried. -* `collateralType` (*address*) - The address of the collateral for which the amount is being queried. - -**Returns** -* `amountD18` (*uint256*) - The total amount of collateral of this type delegated to the market, denominated with 18 decimals of precision. -#### getMarketCollateralValue - - ```solidity - function getMarketCollateralValue(uint128 marketId) external returns (uint256 valueD18) - ``` - - Return the total value of collateral that a specified market has deposited. - -**Parameters** -* `marketId` (*uint128*) - The id of the market for which the directly deposited collateral amount is being queried. - -**Returns** -* `valueD18` (*uint256*) - The total value of collateral deposited by the market, denominated with 18 decimals of precision. - -#### MarketCollateralDeposited - - ```solidity - event MarketCollateralDeposited(uint128 marketId, address collateralType, uint256 tokenAmount, address sender) - ``` - - Emitted when `amount` of collateral of type `collateralType` is deposited to market `marketId` by `sender`. - -**Parameters** -* `marketId` (*uint128*) - The id of the market in which collateral was deposited. -* `collateralType` (*address*) - The address of the collateral that was directly deposited in the market. -* `tokenAmount` (*uint256*) - The amount of tokens that were deposited, denominated in the token's native decimal representation. -* `sender` (*address*) - The address that triggered the deposit. - -#### MarketCollateralWithdrawn - - ```solidity - event MarketCollateralWithdrawn(uint128 marketId, address collateralType, uint256 tokenAmount, address sender) - ``` - - Emitted when `amount` of collateral of type `collateralType` is withdrawn from market `marketId` by `sender`. - -**Parameters** -* `marketId` (*uint128*) - The id of the market from which collateral was withdrawn. -* `collateralType` (*address*) - The address of the collateral that was withdrawn from the market. -* `tokenAmount` (*uint256*) - The amount of tokens that were withdrawn, denominated in the token's native decimal representation. -* `sender` (*address*) - The address that triggered the withdrawal. - -#### MaximumMarketCollateralConfigured - - ```solidity - event MaximumMarketCollateralConfigured(uint128 marketId, address collateralType, uint256 systemAmount, address owner) - ``` - - Emitted when the system owner specifies the maximum depositable collateral of a given type in a given market. - -**Parameters** -* `marketId` (*uint128*) - The id of the market for which the maximum was configured. -* `collateralType` (*address*) - The address of the collateral for which the maximum was configured. -* `systemAmount` (*uint256*) - The amount to which the maximum was set, denominated with 18 decimals of precision. -* `owner` (*address*) - The owner of the system, which triggered the configuration change. - -### Market Manager Module - -#### registerMarket - - ```solidity - function registerMarket(address market) external returns (uint128 newMarketId) - ``` - - Connects an external market to the system. - - Creates a Market object to track the external market, and returns the newly created market id. - -**Parameters** -* `market` (*address*) - The address of the external market that is to be registered in the system. - -**Returns** -* `newMarketId` (*uint128*) - The id with which the market will be registered in the system. -#### depositMarketUsd - - ```solidity - function depositMarketUsd(uint128 marketId, address target, uint256 amount) external returns (uint256 feeAmount) - ``` - - Allows an external market connected to the system to deposit USD in the system. - - The system burns the incoming USD, increases the market's credit capacity, and reduces its issuance. -See `IMarket`. - -**Parameters** -* `marketId` (*uint128*) - The id of the market in which snxUSD will be deposited. -* `target` (*address*) - The address of the account on who's behalf the deposit will be made. -* `amount` (*uint256*) - The amount of snxUSD to be deposited, denominated with 18 decimals of precision. - -**Returns** -* `feeAmount` (*uint256*) - the amount of fees paid (billed as additional debt towards liquidity providers) -#### withdrawMarketUsd - - ```solidity - function withdrawMarketUsd(uint128 marketId, address target, uint256 amount) external returns (uint256 feeAmount) - ``` - - Allows an external market connected to the system to withdraw snxUSD from the system. - - The system mints the requested snxUSD (provided that the market has sufficient credit), reduces the market's credit capacity, and increases its net issuance. -See `IMarket`. - -**Parameters** -* `marketId` (*uint128*) - The id of the market from which snxUSD will be withdrawn. -* `target` (*address*) - The address of the account that will receive the withdrawn snxUSD. -* `amount` (*uint256*) - The amount of snxUSD to be withdraw, denominated with 18 decimals of precision. - -**Returns** -* `feeAmount` (*uint256*) - the amount of fees paid (billed as additional debt towards liquidity providers) -#### getMarketFees - - ```solidity - function getMarketFees(uint128 marketId, uint256 amount) external view returns (uint256 depositFeeAmount, uint256 withdrawFeeAmount) - ``` - - Get the amount of fees paid in USD for a call to `depositMarketUsd` and `withdrawMarketUsd` for the given market and amount - -**Parameters** -* `marketId` (*uint128*) - The market to check fees for -* `amount` (*uint256*) - The amount deposited or withdrawn in USD - -**Returns** -* `depositFeeAmount` (*uint256*) - the amount of USD paid for a call to `depositMarketUsd` -* `withdrawFeeAmount` (*uint256*) - the amount of USD paid for a call to `withdrawMarketUsd` -#### getWithdrawableMarketUsd - - ```solidity - function getWithdrawableMarketUsd(uint128 marketId) external view returns (uint256 withdrawableD18) - ``` - - Returns the total withdrawable snxUSD amount for the specified market. - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose withdrawable USD amount is being queried. - -**Returns** -* `withdrawableD18` (*uint256*) - The total amount of snxUSD that the market could withdraw at the time of the query, denominated with 18 decimals of precision. -#### getMarketNetIssuance - - ```solidity - function getMarketNetIssuance(uint128 marketId) external view returns (int128 issuanceD18) - ``` - - Returns the net issuance of the specified market (snxUSD withdrawn - snxUSD deposited). - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose net issuance is being queried. - -**Returns** -* `issuanceD18` (*int128*) - The net issuance of the market, denominated with 18 decimals of precision. -#### getMarketReportedDebt - - ```solidity - function getMarketReportedDebt(uint128 marketId) external view returns (uint256 reportedDebtD18) - ``` - - Returns the reported debt of the specified market. - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose reported debt is being queried. - -**Returns** -* `reportedDebtD18` (*uint256*) - The market's reported debt, denominated with 18 decimals of precision. -#### getMarketTotalDebt - - ```solidity - function getMarketTotalDebt(uint128 marketId) external view returns (int256 totalDebtD18) - ``` - - Returns the total debt of the specified market. - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose debt is being queried. - -**Returns** -* `totalDebtD18` (*int256*) - The total debt of the market, denominated with 18 decimals of precision. -#### getMarketCollateral - - ```solidity - function getMarketCollateral(uint128 marketId) external view returns (uint256 valueD18) - ``` - - Returns the total snxUSD value of the collateral for the specified market. - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose collateral is being queried. - -**Returns** -* `valueD18` (*uint256*) - The market's total snxUSD value of collateral, denominated with 18 decimals of precision. -#### getMarketDebtPerShare - - ```solidity - function getMarketDebtPerShare(uint128 marketId) external returns (int256 debtPerShareD18) - ``` - - Returns the value per share of the debt of the specified market. - - This is not a view function, and actually updates the entire debt distribution chain. - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose debt per share is being queried. - -**Returns** -* `debtPerShareD18` (*int256*) - The market's debt per share value, denominated with 18 decimals of precision. -#### isMarketCapacityLocked - - ```solidity - function isMarketCapacityLocked(uint128 marketId) external view returns (bool isLocked) - ``` - - Returns whether the capacity of the specified market is locked. - -**Parameters** -* `marketId` (*uint128*) - The id of the market whose capacity is being queried. - -**Returns** -* `isLocked` (*bool*) - A boolean that is true if the market's capacity is locked at the time of the query. -#### getUsdToken - - ```solidity - function getUsdToken() external view returns (contract IERC20) - ``` - - Returns the USD token associated with this synthetix core system - -#### getOracleManager - - ```solidity - function getOracleManager() external view returns (contract IOracleManager) - ``` - - Retrieve the systems' configured oracle manager address - -#### distributeDebtToPools - - ```solidity - function distributeDebtToPools(uint128 marketId, uint256 maxIter) external returns (bool finishedDistributing) - ``` - - Update a market's current debt registration with the system. -This function is provided as an escape hatch for pool griefing, preventing -overwhelming the system with a series of very small pools and creating high gas -costs to update an account. - -**Parameters** -* `marketId` (*uint128*) - the id of the market that needs pools bumped -* `maxIter` (*uint256*) - - -**Returns** -* `finishedDistributing` (*bool*) - whether or not all bumpable pools have been bumped and target price has been reached -#### setMarketMinDelegateTime - - ```solidity - function setMarketMinDelegateTime(uint128 marketId, uint32 minDelegateTime) external - ``` - - allows for a market to set its minimum delegation time. This is useful for preventing stakers from frontrunning rewards or losses -by limiting the frequency of `delegateCollateral` (or `setPoolConfiguration`) calls. By default, there is no minimum delegation time. - -**Parameters** -* `marketId` (*uint128*) - the id of the market that wants to set delegation time. -* `minDelegateTime` (*uint32*) - the minimum number of seconds between delegation calls. Note: this value must be less than the globally defined maximum minDelegateTime - -#### getMarketMinDelegateTime - - ```solidity - function getMarketMinDelegateTime(uint128 marketId) external view returns (uint32) - ``` - - Retrieve the minimum delegation time of a market - -**Parameters** -* `marketId` (*uint128*) - the id of the market - -#### setMinLiquidityRatio - - ```solidity - function setMinLiquidityRatio(uint128 marketId, uint256 minLiquidityRatio) external - ``` - - Allows the system owner (not the pool owner) to set a market-specific minimum liquidity ratio. - -**Parameters** -* `marketId` (*uint128*) - the id of the market -* `minLiquidityRatio` (*uint256*) - The new market-specific minimum liquidity ratio, denominated with 18 decimals of precision. (100% is represented by 1 followed by 18 zeros.) - -#### getMinLiquidityRatio - - ```solidity - function getMinLiquidityRatio(uint128 marketId) external view returns (uint256 minRatioD18) - ``` - - Retrieves the market-specific minimum liquidity ratio. - -**Parameters** -* `marketId` (*uint128*) - the id of the market - -**Returns** -* `minRatioD18` (*uint256*) - The current market-specific minimum liquidity ratio, denominated with 18 decimals of precision. (100% is represented by 1 followed by 18 zeros.) -#### getMarketPools - - ```solidity - function getMarketPools(uint128 marketId) external returns (uint128[] inRangePoolIds, uint128[] outRangePoolIds) - ``` - -#### getMarketPoolDebtDistribution - - ```solidity - function getMarketPoolDebtDistribution(uint128 marketId, uint128 poolId) external returns (uint256 sharesD18, uint128 totalSharesD18, int128 valuePerShareD27) - ``` - -#### MarketRegistered - - ```solidity - event MarketRegistered(address market, uint128 marketId, address sender) - ``` - - Emitted when a new market is registered in the system. - -**Parameters** -* `market` (*address*) - The address of the external market that was registered in the system. -* `marketId` (*uint128*) - The id with which the market was registered in the system. -* `sender` (*address*) - The account that trigger the registration of the market. - -#### MarketUsdDeposited - - ```solidity - event MarketUsdDeposited(uint128 marketId, address target, uint256 amount, address market) - ``` - - Emitted when a market deposits snxUSD in the system. - -**Parameters** -* `marketId` (*uint128*) - The id of the market that deposited snxUSD in the system. -* `target` (*address*) - The address of the account that provided the snxUSD in the deposit. -* `amount` (*uint256*) - The amount of snxUSD deposited in the system, denominated with 18 decimals of precision. -* `market` (*address*) - The address of the external market that is depositing. - -#### MarketUsdWithdrawn - - ```solidity - event MarketUsdWithdrawn(uint128 marketId, address target, uint256 amount, address market) - ``` - - Emitted when a market withdraws snxUSD from the system. - -**Parameters** -* `marketId` (*uint128*) - The id of the market that withdrew snxUSD from the system. -* `target` (*address*) - The address of the account that received the snxUSD in the withdrawal. -* `amount` (*uint256*) - The amount of snxUSD withdrawn from the system, denominated with 18 decimals of precision. -* `market` (*address*) - The address of the external market that is withdrawing. - -#### MarketSystemFeePaid - - ```solidity - event MarketSystemFeePaid(uint128 marketId, uint256 feeAmount) - ``` - -#### SetMinDelegateTime - - ```solidity - event SetMinDelegateTime(uint128 marketId, uint32 minDelegateTime) - ``` - - Emitted when a market sets an updated minimum delegation time - -**Parameters** -* `marketId` (*uint128*) - The id of the market that the setting is applied to -* `minDelegateTime` (*uint32*) - The minimum amount of time between delegation changes - -#### SetMarketMinLiquidityRatio - - ```solidity - event SetMarketMinLiquidityRatio(uint128 marketId, uint256 minLiquidityRatio) - ``` - - Emitted when a market-specific minimum liquidity ratio is set - -**Parameters** -* `marketId` (*uint128*) - The id of the market that the setting is applied to -* `minLiquidityRatio` (*uint256*) - The new market-specific minimum liquidity ratio - -### Multicall Module - -#### multicall - - ```solidity - function multicall(bytes[] data) external payable returns (bytes[] results) - ``` - - Executes multiple transaction payloads in a single transaction. - - Each transaction is executed using `delegatecall`, and targets the system address. - -**Parameters** -* `data` (*bytes[]*) - Array of calldata objects, one for each function that is to be called in the system. - -**Returns** -* `results` (*bytes[]*) - Array of each `delegatecall`'s response corresponding to the incoming calldata array. - -### Pool Configuration Module - -#### setPreferredPool - - ```solidity - function setPreferredPool(uint128 poolId) external - ``` - - Sets the unique system preferred pool. - - Note: The preferred pool does not receive any special treatment. It is only signaled as preferred here. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that is to be set as preferred. - -#### addApprovedPool - - ```solidity - function addApprovedPool(uint128 poolId) external - ``` - - Marks a pool as approved by the system owner. - - Approved pools do not receive any special treatment. They are only signaled as approved here. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that is to be approved. - -#### removeApprovedPool - - ```solidity - function removeApprovedPool(uint128 poolId) external - ``` - - Un-marks a pool as preferred by the system owner. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that is to be no longer approved. - -#### getPreferredPool - - ```solidity - function getPreferredPool() external view returns (uint128 poolId) - ``` - - Retrieves the unique system preferred pool. - -**Returns** -* `poolId` (*uint128*) - The id of the pool that is currently set as preferred in the system. -#### getApprovedPools - - ```solidity - function getApprovedPools() external view returns (uint256[] poolIds) - ``` - - Retrieves the pool that are approved by the system owner. - -**Returns** -* `poolIds` (*uint256[]*) - An array with all of the pool ids that are approved in the system. - -#### PreferredPoolSet - - ```solidity - event PreferredPoolSet(uint256 poolId) - ``` - - Emitted when the system owner sets the preferred pool. - -**Parameters** -* `poolId` (*uint256*) - The id of the pool that was set as preferred. - -#### PoolApprovedAdded - - ```solidity - event PoolApprovedAdded(uint256 poolId) - ``` - - Emitted when the system owner adds an approved pool. - -**Parameters** -* `poolId` (*uint256*) - The id of the pool that was approved. - -#### PoolApprovedRemoved - - ```solidity - event PoolApprovedRemoved(uint256 poolId) - ``` - - Emitted when the system owner removes an approved pool. - -**Parameters** -* `poolId` (*uint256*) - The id of the pool that is no longer approved. - -### Pool Module - -#### createPool - - ```solidity - function createPool(uint128 requestedPoolId, address owner) external - ``` - - Creates a pool with the requested pool id. - -**Parameters** -* `requestedPoolId` (*uint128*) - The requested id for the new pool. Reverts if the id is not available. -* `owner` (*address*) - The address that will own the newly created pool. - -#### setPoolConfiguration - - ```solidity - function setPoolConfiguration(uint128 poolId, struct MarketConfiguration.Data[] marketDistribution) external - ``` - - Allows the pool owner to configure the pool. - - The pool's configuration is composed of an array of MarketConfiguration objects, which describe which markets the pool provides liquidity to, in what proportion, and to what extent. -Incoming market ids need to be provided in ascending order. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose configuration is being set. -* `marketDistribution` (*struct MarketConfiguration.Data[]*) - The array of market configuration objects that define the list of markets that are connected to the system. - -#### getPoolConfiguration - - ```solidity - function getPoolConfiguration(uint128 poolId) external view returns (struct MarketConfiguration.Data[] markets) - ``` - - Retrieves the MarketConfiguration of the specified pool. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose configuration is being queried. - -**Returns** -* `markets` (*struct MarketConfiguration.Data[]*) - The array of MarketConfiguration objects that describe the pool's configuration. -#### setPoolName - - ```solidity - function setPoolName(uint128 poolId, string name) external - ``` - - Allows the owner of the pool to set the pool's name. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose name is being set. -* `name` (*string*) - The new name to give to the pool. - -#### getPoolName - - ```solidity - function getPoolName(uint128 poolId) external view returns (string poolName) - ``` - - Returns the pool's name. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose name is being queried. - -**Returns** -* `poolName` (*string*) - The current name of the pool. -#### nominatePoolOwner - - ```solidity - function nominatePoolOwner(address nominatedOwner, uint128 poolId) external - ``` - - Allows the current pool owner to nominate a new owner. - -**Parameters** -* `nominatedOwner` (*address*) - The address to nominate os the new pool owner. -* `poolId` (*uint128*) - The id whose ownership is being transferred. - -#### acceptPoolOwnership - - ```solidity - function acceptPoolOwnership(uint128 poolId) external - ``` - - After a new pool owner has been nominated, allows it to accept the nomination and thus ownership of the pool. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool for which the caller is to accept ownership. - -#### revokePoolNomination - - ```solidity - function revokePoolNomination(uint128 poolId) external - ``` - - After a new pool owner has been nominated, allows it to reject the nomination. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool for which the new owner nomination is to be revoked. - -#### renouncePoolNomination - - ```solidity - function renouncePoolNomination(uint128 poolId) external - ``` - - Allows the current nominated owner to renounce the nomination. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool for which the caller is renouncing ownership nomination. - -#### getPoolOwner - - ```solidity - function getPoolOwner(uint128 poolId) external view returns (address owner) - ``` - - Returns the current pool owner. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose ownership is being queried. - -**Returns** -* `owner` (*address*) - The current owner of the pool. -#### getNominatedPoolOwner - - ```solidity - function getNominatedPoolOwner(uint128 poolId) external view returns (address nominatedOwner) - ``` - - Returns the current nominated pool owner. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose nominated owner is being queried. - -**Returns** -* `nominatedOwner` (*address*) - The current nominated owner of the pool. -#### setMinLiquidityRatio - - ```solidity - function setMinLiquidityRatio(uint256 minLiquidityRatio) external - ``` - - Allows the system owner (not the pool owner) to set the system-wide minimum liquidity ratio. - -**Parameters** -* `minLiquidityRatio` (*uint256*) - The new system-wide minimum liquidity ratio, denominated with 18 decimals of precision. (100% is represented by 1 followed by 18 zeros.) - -#### getMinLiquidityRatio - - ```solidity - function getMinLiquidityRatio() external view returns (uint256 minRatioD18) - ``` - - Retrieves the system-wide minimum liquidity ratio. - -**Returns** -* `minRatioD18` (*uint256*) - The current system-wide minimum liquidity ratio, denominated with 18 decimals of precision. (100% is represented by 1 followed by 18 zeros.) -#### rebalancePool - - ```solidity - function rebalancePool(uint128 poolId, address optionalCollateralType) external - ``` - - Distributes cached debt in a pool to its vaults and updates market credit capacities. - -**Parameters** -* `poolId` (*uint128*) - the pool to rebalance -* `optionalCollateralType` (*address*) - in addition to rebalancing the pool, calculate updated collaterals and debts for the specified vault - -#### PoolCreated - - ```solidity - event PoolCreated(uint128 poolId, address owner, address sender) - ``` - - Gets fired when pool will be created. - -**Parameters** -* `poolId` (*uint128*) - The id of the newly created pool. -* `owner` (*address*) - The owner of the newly created pool. -* `sender` (*address*) - The address that triggered the creation of the pool. - -#### PoolOwnerNominated - - ```solidity - event PoolOwnerNominated(uint128 poolId, address nominatedOwner, address owner) - ``` - - Gets fired when pool owner proposes a new owner. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool for which the nomination ocurred. -* `nominatedOwner` (*address*) - The address that was nominated as the new owner of the pool. -* `owner` (*address*) - The address of the current owner of the pool. - -#### PoolOwnershipAccepted - - ```solidity - event PoolOwnershipAccepted(uint128 poolId, address owner) - ``` - - Gets fired when pool nominee accepts nomination. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool for which the owner nomination was accepted. -* `owner` (*address*) - The address of the new owner of the pool, which accepted the nomination. - -#### PoolNominationRevoked - - ```solidity - event PoolNominationRevoked(uint128 poolId, address owner) - ``` - - Gets fired when pool owner revokes nomination. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool in which the nomination was revoked. -* `owner` (*address*) - The current owner of the pool. - -#### PoolNominationRenounced - - ```solidity - event PoolNominationRenounced(uint128 poolId, address owner) - ``` - - Gets fired when pool nominee renounces nomination. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool for which the owner nomination was renounced. -* `owner` (*address*) - The current owner of the pool. - -#### PoolNameUpdated - - ```solidity - event PoolNameUpdated(uint128 poolId, string name, address sender) - ``` - - Gets fired when pool name changes. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose name was updated. -* `name` (*string*) - The new name of the pool. -* `sender` (*address*) - The address that triggered the rename of the pool. - -#### PoolConfigurationSet - - ```solidity - event PoolConfigurationSet(uint128 poolId, struct MarketConfiguration.Data[] markets, address sender) - ``` - - Gets fired when pool gets configured. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose configuration was set. -* `markets` (*struct MarketConfiguration.Data[]*) - Array of configuration data of the markets that were connected to the pool. -* `sender` (*address*) - The address that triggered the pool configuration. - -#### SetMinLiquidityRatio - - ```solidity - event SetMinLiquidityRatio(uint256 minLiquidityRatio) - ``` - - Emitted when a system-wide minimum liquidity ratio is set - -**Parameters** -* `minLiquidityRatio` (*uint256*) - The new system-wide minimum liquidity ratio - -### Rewards Manager Module - -#### registerRewardsDistributor - - ```solidity - function registerRewardsDistributor(uint128 poolId, address collateralType, address distributor) external - ``` - - Called by pool owner to register rewards for vault participants. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose rewards are to be managed by the specified distributor. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the reward distributor to be registered. - -#### removeRewardsDistributor - - ```solidity - function removeRewardsDistributor(uint128 poolId, address collateralType, address distributor) external - ``` - - Called by pool owner to remove a registered rewards distributor for vault participants. -WARNING: if you remove a rewards distributor, the same address can never be re-registered again. If you -simply want to turn off -rewards, call `distributeRewards` with 0 emission. If you need to completely reset the rewards distributor -again, create a new rewards distributor at a new address and register the new one. -This function is provided since the number of rewards distributors added to an account is finite, -so you can remove an unused rewards distributor if need be. -NOTE: unclaimed rewards can still be claimed after a rewards distributor is removed (though any -rewards-over-time will be halted) - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose rewards are to be managed by the specified distributor. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the reward distributor to be registered. - -#### distributeRewards - - ```solidity - function distributeRewards(uint128 poolId, address collateralType, uint256 amount, uint64 start, uint32 duration) external - ``` - - Called by a registered distributor to set up rewards for vault participants. - - Will revert if the caller is not a registered distributor. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool to distribute rewards to. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `amount` (*uint256*) - The amount of rewards to be distributed. -* `start` (*uint64*) - The date at which the rewards will begin to be claimable. -* `duration` (*uint32*) - The period after which all distributed rewards will be claimable. - -#### claimRewards - - ```solidity - function claimRewards(uint128 accountId, uint128 poolId, address collateralType, address distributor) external returns (uint256 amountClaimedD18) - ``` - - Allows a user with appropriate permissions to claim rewards associated with a position. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that is to claim the rewards. -* `poolId` (*uint128*) - The id of the pool to claim rewards on. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the rewards distributor associated with the rewards being claimed. - -**Returns** -* `amountClaimedD18` (*uint256*) - The amount of rewards that were available for the account and thus claimed. -#### updateRewards - - ```solidity - function updateRewards(uint128 poolId, address collateralType, uint128 accountId) external returns (uint256[] claimableD18, address[] distributors) - ``` - - For a given position, return the rewards that can currently be claimed. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool being queried. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `accountId` (*uint128*) - The id of the account whose available rewards are being queried. - -**Returns** -* `claimableD18` (*uint256[]*) - An array of ids of the reward entries that are claimable by the position. -* `distributors` (*address[]*) - An array with the addresses of the reward distributors associated with the claimable rewards. -#### getRewardRate - - ```solidity - function getRewardRate(uint128 poolId, address collateralType, address distributor) external view returns (uint256 rateD18) - ``` - - Returns the number of individual units of amount emitted per second per share for the given poolId, collateralType, distributor vault. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool being queried. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the rewards distributor associated with the rewards in question. - -**Returns** -* `rateD18` (*uint256*) - The queried rewards rate. - -#### RewardsDistributed - - ```solidity - event RewardsDistributed(uint128 poolId, address collateralType, address distributor, uint256 amount, uint256 start, uint256 duration) - ``` - - Emitted when the pool owner or an existing reward distributor sets up rewards for vault participants. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool on which rewards were distributed. -* `collateralType` (*address*) - The collateral type of the pool on which rewards were distributed. -* `distributor` (*address*) - The reward distributor associated to the rewards that were distributed. -* `amount` (*uint256*) - The amount of rewards that were distributed. -* `start` (*uint256*) - The date one which the rewards will begin to be claimable. -* `duration` (*uint256*) - The time in which all of the distributed rewards will be claimable. - -#### RewardsClaimed - - ```solidity - event RewardsClaimed(uint128 accountId, uint128 poolId, address collateralType, address distributor, uint256 amount) - ``` - - Emitted when a vault participant claims rewards. - -**Parameters** -* `accountId` (*uint128*) - The id of the account that claimed the rewards. -* `poolId` (*uint128*) - The id of the pool where the rewards were claimed. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the rewards distributor associated with these rewards. -* `amount` (*uint256*) - The amount of rewards that were claimed. - -#### RewardsDistributorRegistered - - ```solidity - event RewardsDistributorRegistered(uint128 poolId, address collateralType, address distributor) - ``` - - Emitted when a new rewards distributor is registered. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose reward distributor was registered. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the newly registered reward distributor. - -#### RewardsDistributorRemoved - - ```solidity - event RewardsDistributorRemoved(uint128 poolId, address collateralType, address distributor) - ``` - - Emitted when an already registered rewards distributor is removed. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool whose reward distributor was registered. -* `collateralType` (*address*) - The address of the collateral used in the pool's rewards. -* `distributor` (*address*) - The address of the registered reward distributor. - -### USD Token Module - -#### burnWithAllowance - - ```solidity - function burnWithAllowance(address from, address spender, uint256 amount) external - ``` - - Allows the core system to burn snxUSD held by the `from` address, provided that it has given allowance to `spender`. - -**Parameters** -* `from` (*address*) - The address that holds the snxUSD to be burned. -* `spender` (*address*) - The address to which the holder has given allowance to. -* `amount` (*uint256*) - The amount of snxUSD to be burned, denominated with 18 decimals of precision. - -#### burn - - ```solidity - function burn(uint256 amount) external - ``` - - Destroys `amount` of snxUSD tokens from the caller. This is derived from ERC20Burnable.sol and is currently included for testing purposes with CCIP token pools. - -**Parameters** -* `amount` (*uint256*) - The amount of snxUSD to be burned, denominated with 18 decimals of precision. - -#### isInitialized - - ```solidity - function isInitialized() external returns (bool) - ``` - - Returns wether the token has been initialized. - -**Returns** -* `[0]` (*bool*) - A boolean with the result of the query. -#### initialize - - ```solidity - function initialize(string tokenName, string tokenSymbol, uint8 tokenDecimals) external - ``` - - Initializes the token with name, symbol, and decimals. - -#### mint - - ```solidity - function mint(address to, uint256 amount) external - ``` - - Allows the owner to mint tokens. - -**Parameters** -* `to` (*address*) - The address to receive the newly minted tokens. -* `amount` (*uint256*) - The amount of tokens to mint. - -#### burn - - ```solidity - function burn(address from, uint256 amount) external - ``` - - Allows the owner to burn tokens. - -**Parameters** -* `from` (*address*) - The address whose tokens will be burnt. -* `amount` (*uint256*) - The amount of tokens to burn. - -#### setAllowance - - ```solidity - function setAllowance(address from, address spender, uint256 amount) external - ``` - - Allows an address that holds tokens to provide allowance to another. - -**Parameters** -* `from` (*address*) - The address that is providing allowance. -* `spender` (*address*) - The address that is given allowance. -* `amount` (*uint256*) - The amount of allowance being given. - -#### name - - ```solidity - function name() external view returns (string) - ``` - - Retrieves the name of the token, e.g. "Synthetix Network Token". - -**Returns** -* `[0]` (*string*) - A string with the name of the token. -#### symbol - - ```solidity - function symbol() external view returns (string) - ``` - - Retrieves the symbol of the token, e.g. "SNX". - -**Returns** -* `[0]` (*string*) - A string with the symbol of the token. -#### decimals - - ```solidity - function decimals() external view returns (uint8) - ``` - - Retrieves the number of decimals used by the token. The default is 18. - -**Returns** -* `[0]` (*uint8*) - The number of decimals. -#### totalSupply - - ```solidity - function totalSupply() external view returns (uint256) - ``` - - Returns the total number of tokens in circulation (minted - burnt). - -**Returns** -* `[0]` (*uint256*) - The total number of tokens. -#### balanceOf - - ```solidity - function balanceOf(address owner) external view returns (uint256) - ``` - - Returns the balance of a user. - -**Parameters** -* `owner` (*address*) - The address whose balance is being retrieved. - -**Returns** -* `[0]` (*uint256*) - The number of tokens owned by the user. -#### allowance - - ```solidity - function allowance(address owner, address spender) external view returns (uint256) - ``` - - Returns how many tokens a user has allowed another user to transfer on its behalf. - -**Parameters** -* `owner` (*address*) - The user who has given the allowance. -* `spender` (*address*) - The user who was given the allowance. - -**Returns** -* `[0]` (*uint256*) - The amount of tokens `spender` can transfer on `owner`'s behalf. -#### transfer - - ```solidity - function transfer(address to, uint256 amount) external returns (bool) - ``` - - Transfer tokens from one address to another. - -**Parameters** -* `to` (*address*) - The address that will receive the tokens. -* `amount` (*uint256*) - The amount of tokens to be transferred. - -**Returns** -* `[0]` (*bool*) - A boolean which is true if the operation succeeded. -#### approve - - ```solidity - function approve(address spender, uint256 amount) external returns (bool) - ``` - - Allows users to provide allowance to other users so that they can transfer tokens on their behalf. - -**Parameters** -* `spender` (*address*) - The address that is receiving the allowance. -* `amount` (*uint256*) - The amount of tokens that are being added to the allowance. - -**Returns** -* `[0]` (*bool*) - A boolean which is true if the operation succeeded. -#### increaseAllowance - - ```solidity - function increaseAllowance(address spender, uint256 addedValue) external returns (bool) - ``` - - Atomically increases the allowance granted to `spender` by the caller. - -This is an alternative to {approve} that can be used as a mitigation for -problems described in {IERC20-approve}. - -Emits an {Approval} event indicating the updated allowance. - -Requirements: - -- `spender` cannot be the zero address. - -#### decreaseAllowance - - ```solidity - function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) - ``` - - Atomically decreases the allowance granted to `spender` by the caller. - -This is an alternative to {approve} that can be used as a mitigation for -problems described in {IERC20-approve}. - -Emits an {Approval} event indicating the updated allowance. - -Requirements: - -- `spender` cannot be the zero address. -- `spender` must have allowance for the caller of at least -`subtractedValue`. - -#### transferFrom - - ```solidity - function transferFrom(address from, address to, uint256 amount) external returns (bool) - ``` - - Allows a user who has been given allowance to transfer tokens on another user's behalf. - -**Parameters** -* `from` (*address*) - The address that owns the tokens that are being transferred. -* `to` (*address*) - The address that will receive the tokens. -* `amount` (*uint256*) - The number of tokens to transfer. - -**Returns** -* `[0]` (*bool*) - A boolean which is true if the operation succeeded. - -#### Transfer - - ```solidity - event Transfer(address from, address to, uint256 amount) - ``` - - Emitted when tokens have been transferred. - -**Parameters** -* `from` (*address*) - The address that originally owned the tokens. -* `to` (*address*) - The address that received the tokens. -* `amount` (*uint256*) - The number of tokens that were transferred. - -#### Approval - - ```solidity - event Approval(address owner, address spender, uint256 amount) - ``` - - Emitted when a user has provided allowance to another user for transferring tokens on its behalf. - -**Parameters** -* `owner` (*address*) - The address that is providing the allowance. -* `spender` (*address*) - The address that received the allowance. -* `amount` (*uint256*) - The number of tokens that were added to `spender`'s allowance. - -### Vault Module - -#### delegateCollateral - - ```solidity - function delegateCollateral(uint128 accountId, uint128 poolId, address collateralType, uint256 amount, uint256 leverage) external - ``` - - Updates an account's delegated collateral amount for the specified pool and collateral type pair. - -**Parameters** -* `accountId` (*uint128*) - The id of the account associated with the position that will be updated. -* `poolId` (*uint128*) - The id of the pool associated with the position. -* `collateralType` (*address*) - The address of the collateral used in the position. -* `amount` (*uint256*) - The new amount of collateral delegated in the position, denominated with 18 decimals of precision. -* `leverage` (*uint256*) - The new leverage amount used in the position, denominated with 18 decimals of precision. Requirements: - `msg.sender` must be the owner of the account, have the `ADMIN` permission, or have the `DELEGATE` permission. - If increasing the amount delegated, it must not exceed the available collateral (`getAccountAvailableCollateral`) associated with the account. - If decreasing the amount delegated, the liquidity position must have a collateralization ratio greater than the target collateralization ratio for the corresponding collateral type. Emits a {DelegationUpdated} event. - -#### getPositionCollateralRatio - - ```solidity - function getPositionCollateralRatio(uint128 accountId, uint128 poolId, address collateralType) external returns (uint256 ratioD18) - ``` - - Returns the collateralization ratio of the specified liquidity position. If debt is negative, this function will return 0. - - Call this function using `callStatic` to treat it as a view function. -The return value is a percentage with 18 decimals places. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose collateralization ratio is being queried. -* `poolId` (*uint128*) - The id of the pool in which the account's position is held. -* `collateralType` (*address*) - The address of the collateral used in the queried position. - -**Returns** -* `ratioD18` (*uint256*) - The collateralization ratio of the position (collateral / debt), denominated with 18 decimals of precision. -#### getPositionDebt - - ```solidity - function getPositionDebt(uint128 accountId, uint128 poolId, address collateralType) external returns (int256 debtD18) - ``` - - Returns the debt of the specified liquidity position. Credit is expressed as negative debt. - - This is not a view function, and actually updates the entire debt distribution chain. -Call this function using `callStatic` to treat it as a view function. - -**Parameters** -* `accountId` (*uint128*) - The id of the account being queried. -* `poolId` (*uint128*) - The id of the pool in which the account's position is held. -* `collateralType` (*address*) - The address of the collateral used in the queried position. - -**Returns** -* `debtD18` (*int256*) - The amount of debt held by the position, denominated with 18 decimals of precision. -#### getPositionCollateral - - ```solidity - function getPositionCollateral(uint128 accountId, uint128 poolId, address collateralType) external view returns (uint256 collateralAmountD18, uint256 collateralValueD18) - ``` - - Returns the amount and value of the collateral associated with the specified liquidity position. - - Call this function using `callStatic` to treat it as a view function. -collateralAmount is represented as an integer with 18 decimals. -collateralValue is represented as an integer with the number of decimals specified by the collateralType. - -**Parameters** -* `accountId` (*uint128*) - The id of the account being queried. -* `poolId` (*uint128*) - The id of the pool in which the account's position is held. -* `collateralType` (*address*) - The address of the collateral used in the queried position. - -**Returns** -* `collateralAmountD18` (*uint256*) - The amount of collateral used in the position, denominated with 18 decimals of precision. -* `collateralValueD18` (*uint256*) - The value of collateral used in the position, denominated with 18 decimals of precision. -#### getPosition - - ```solidity - function getPosition(uint128 accountId, uint128 poolId, address collateralType) external returns (uint256 collateralAmountD18, uint256 collateralValueD18, int256 debtD18, uint256 collateralizationRatioD18) - ``` - - Returns all information pertaining to a specified liquidity position in the vault module. - -**Parameters** -* `accountId` (*uint128*) - The id of the account being queried. -* `poolId` (*uint128*) - The id of the pool in which the account's position is held. -* `collateralType` (*address*) - The address of the collateral used in the queried position. - -**Returns** -* `collateralAmountD18` (*uint256*) - The amount of collateral used in the position, denominated with 18 decimals of precision. -* `collateralValueD18` (*uint256*) - The value of the collateral used in the position, denominated with 18 decimals of precision. -* `debtD18` (*int256*) - The amount of debt held in the position, denominated with 18 decimals of precision. -* `collateralizationRatioD18` (*uint256*) - The collateralization ratio of the position (collateral / debt), denominated with 18 decimals of precision. -#### getVaultDebt - - ```solidity - function getVaultDebt(uint128 poolId, address collateralType) external returns (int256 debtD18) - ``` - - Returns the total debt (or credit) that the vault is responsible for. Credit is expressed as negative debt. - - This is not a view function, and actually updates the entire debt distribution chain. -Call this function using `callStatic` to treat it as a view function. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that owns the vault whose debt is being queried. -* `collateralType` (*address*) - The address of the collateral of the associated vault. - -**Returns** -* `debtD18` (*int256*) - The overall debt of the vault, denominated with 18 decimals of precision. -#### getVaultCollateral - - ```solidity - function getVaultCollateral(uint128 poolId, address collateralType) external returns (uint256 collateralAmountD18, uint256 collateralValueD18) - ``` - - Returns the amount and value of the collateral held by the vault. - - Call this function using `callStatic` to treat it as a view function. -collateralAmount is represented as an integer with 18 decimals. -collateralValue is represented as an integer with the number of decimals specified by the collateralType. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that owns the vault whose collateral is being queried. -* `collateralType` (*address*) - The address of the collateral of the associated vault. - -**Returns** -* `collateralAmountD18` (*uint256*) - The collateral amount of the vault, denominated with 18 decimals of precision. -* `collateralValueD18` (*uint256*) - The collateral value of the vault, denominated with 18 decimals of precision. -#### getVaultCollateralRatio - - ```solidity - function getVaultCollateralRatio(uint128 poolId, address collateralType) external returns (uint256 ratioD18) - ``` - - Returns the collateralization ratio of the vault. If debt is negative, this function will return 0. - - Call this function using `callStatic` to treat it as a view function. -The return value is a percentage with 18 decimals places. - -**Parameters** -* `poolId` (*uint128*) - The id of the pool that owns the vault whose collateralization ratio is being queried. -* `collateralType` (*address*) - The address of the collateral of the associated vault. - -**Returns** -* `ratioD18` (*uint256*) - The collateralization ratio of the vault, denominated with 18 decimals of precision. - -#### DelegationUpdated - - ```solidity - event DelegationUpdated(uint128 accountId, uint128 poolId, address collateralType, uint256 amount, uint256 leverage, address sender) - ``` - - Emitted when {sender} updates the delegation of collateral in the specified liquidity position. - -**Parameters** -* `accountId` (*uint128*) - The id of the account whose position was updated. -* `poolId` (*uint128*) - The id of the pool in which the position was updated. -* `collateralType` (*address*) - The address of the collateral associated to the position. -* `amount` (*uint256*) - The new amount of the position, denominated with 18 decimals of precision. -* `leverage` (*uint256*) - The new leverage value of the position, denominated with 18 decimals of precision. -* `sender` (*address*) - The address that triggered the update of the position. - diff --git a/utils/docgen/.gitignore b/utils/docgen/.gitignore new file mode 100644 index 0000000000..eba984afcc --- /dev/null +++ b/utils/docgen/.gitignore @@ -0,0 +1,3 @@ +abis/ +docs/ +deployments/ diff --git a/utils/docgen/abis.js b/utils/docgen/abis.js old mode 100644 new mode 100755 index d9e26ee533..9221a0506c --- a/utils/docgen/abis.js +++ b/utils/docgen/abis.js @@ -1,106 +1,206 @@ -/* eslint-disable no-unused-vars */ -const { inspect } = require('@usecannon/cli'); +#!/usr/bin/env node + const fs = require('fs/promises'); const prettier = require('prettier'); -const CHAIN_IDS = [1, 5, 10, 420, 84531, 11155111]; -const PROXIES = { - CoreProxy: 'SynthetixCore', - AccountProxyCore: 'snxAccountNFT', - AccountProxyPerps: 'PerpsAccountNFT', - Proxy: 'OracleManager', - USDProxy: 'snxUSDToken', - SpotMarketProxy: 'SpotMarket', - PerpsMarketProxy: 'PerpsMarket', -}; - -function deepFind(obj, key) { - if (key in obj) return obj[key]; - - for (let i = 0; i < Object.keys(obj).length; i++) { - if (typeof obj[Object.keys(obj)[i]] === 'object') { - let result = deepFind(obj[Object.keys(obj)[i]], key); - if (result) return result; - } - } - - return null; +const [chainIdString, deploymentsFile] = process.argv.slice(2); +if (!chainIdString || !deploymentsFile) { + console.log('Usage: node ./abis.js '); + console.log(' example: node ./abis.js 1 ./deployments/1.json'); + process.exit(1); } +const chainId = parseInt(chainIdString, 10); +const deployments = require(deploymentsFile); -function noop() {} +//const CHAIN_IDS = [1, 5, 10, 420, 80001, 84531, 11155111]; -function overrideStdoutWrite(callback = noop) { - const _write = process.stdout.write; - process.stdout.write = (...args) => callback(...args); - return () => { - process.stdout.write = _write; - }; +function etherscanLink(chain, address) { + switch (chain) { + case 1: + return `https://etherscan.io/address/${address}`; + case 5: + return `https://goerli.etherscan.io/address/${address}`; + case 11155111: + return `https://sepolia.etherscan.io/address/${address}`; + case 10: + return `https://optimistic.etherscan.io/address/${address}`; + case 420: + return `https://goerli-optimism.etherscan.io/address/${address}`; + case 80001: + return `https://mumbai.polygonscan.com/address/${address}`; + case 84531: + return `https://goerli.basescan.org/address/${address}`; + } } -function overrideConsole(callback = noop) { - const _log = console.log; - console.log = (...args) => callback(...args); - - const _warn = console.warn; - console.warn = (...args) => callback(...args); - - const _error = console.error; - console.error = (...args) => callback(...args); - - return () => { - console.log = _log; - console.warn = _warn; - console.error = _error; - }; +function chainName(chain) { + switch (chain) { + case 1: + return 'Mainnet'; + case 5: + return 'Goerli'; + case 11155111: + return 'Sepolia'; + case 10: + return 'Optimism'; + case 420: + return 'Optimistic Goerli'; + case 80001: + return 'Polygon Mumbai'; + case 84531: + return 'Base Goerli'; + } } async function run() { await fs.mkdir(`${__dirname}/abis`, { recursive: true }); + await fs.mkdir(`${__dirname}/docs`, { recursive: true }); + const prettierOptions = JSON.parse(await fs.readFile(`${__dirname}/../../.prettierrc`, 'utf8')); + const prettyJson = (obj) => + prettier.format(JSON.stringify(obj, null, 2), { parser: 'json', ...prettierOptions }); + + await fs.writeFile(`./docs/${chainId}.md`, `## ${chainName(chainId)}\n\n`, 'utf8'); + await fs.appendFile(`./docs/${chainId}.md`, `Chain ID: ${chainId}\n\n`, 'utf8'); + await fs.appendFile(`./docs/${chainId}.md`, '| System | Address | ABI |\n', 'utf8'); + await fs.appendFile(`./docs/${chainId}.md`, '| --- | --- | --- |\n', 'utf8'); + const system = deployments?.state?.['provision.system']?.artifacts?.imports?.system; + if (system) { + console.log(`Writing ${chainId}-SynthetixCore.json`); + await fs.writeFile( + `./abis/${chainId}-SynthetixCore.json`, + prettyJson(system.contracts.CoreProxy), + 'utf8' + ); + await fs.appendFile( + `./docs/${chainId}.md`, + `| Synthetix Core | [${system.contracts.CoreProxy.address}](${etherscanLink( + chainId, + system.contracts.CoreProxy.address + )}) | [View/Download](./abis/${chainId}-SynthetixCore.json) |\n`, + 'utf8' + ); - for (const chainId of CHAIN_IDS) { - const unhookStdout = overrideStdoutWrite(); - const unhookConsole = overrideConsole(); - const jsonOutput = await inspect('synthetix-omnibus', chainId, 'main', true); - unhookStdout(); - unhookConsole(); - - const files = Object.entries(PROXIES) - .map(([proxyKey, proxyName]) => { - if (proxyKey.startsWith('AccountProxy')) { - const getCoreAccountProxy = proxyKey === 'AccountProxyCore'; - const specificJsonOutput = getCoreAccountProxy - ? jsonOutput.state['provision.system'] - : jsonOutput.state['provision.perpsFactory']?.artifacts?.imports?.perpsFactory; - if (specificJsonOutput) { - const abi = deepFind(specificJsonOutput, 'AccountProxy'); - if (abi) { - return { chainId, proxyKey, proxyName, abi }; - } - } - } else { - const abi = deepFind(jsonOutput, proxyKey); - if (abi) { - return { chainId, proxyKey, proxyName, abi }; - } - } - }) - .filter(Boolean); - - for (const { chainId, proxyName, abi } of files) { - const filename = `./abis/${chainId}-${proxyName}.json`; - console.log('Writing', filename); + console.log(`Writing ${chainId}-snxAccountNFT.json`); + await fs.writeFile( + `./abis/${chainId}-snxAccountNFT.json`, + prettyJson(system.contracts.AccountProxy), + 'utf8' + ); + await fs.appendFile( + `./docs/${chainId}.md`, + `| snxAccount NFT | [${system.contracts.AccountProxy.address}](${etherscanLink( + chainId, + system.contracts.AccountProxy.address + )}) | [View/Download](./abis/${chainId}-snxAccountNFT.json) |\n`, + 'utf8' + ); + + console.log(`Writing ${chainId}-snxUSDToken.json`); + await fs.writeFile( + `./abis/${chainId}-snxUSDToken.json`, + prettyJson(system.contracts.USDProxy), + 'utf8' + ); + await fs.appendFile( + `./docs/${chainId}.md`, + `| snxUSD Token | [${system.contracts.USDProxy.address}](${etherscanLink( + chainId, + system.contracts.USDProxy.address + )}) | [View/Download](./abis/${chainId}-snxUSDToken.json) |\n`, + 'utf8' + ); + + const { oracle_manager: oracleManager } = system.imports; + if (oracleManager) { + console.log(`Writing ${chainId}-OracleManager.json`); await fs.writeFile( - filename, - prettier.format(JSON.stringify(abi, null, 2), { - parser: 'json', - ...prettierOptions, - }), + `./abis/${chainId}-OracleManager.json`, + prettyJson(oracleManager.contracts.Proxy), + 'utf8' + ); + await fs.appendFile( + `./docs/${chainId}.md`, + `| Oracle Manager | [${oracleManager.contracts.Proxy.address}](${etherscanLink( + chainId, + oracleManager.contracts.Proxy.address + )}) | [View/Download](./abis/${chainId}-OracleManager.json) |\n`, 'utf8' ); } } - console.log('OK'); + + const spotFactory = + deployments?.state?.['provision.spotFactory']?.artifacts?.imports?.spotFactory; + if (spotFactory) { + console.log(`Writing ${chainId}-SpotMarket.json`); + await fs.writeFile( + `./abis/${chainId}-SpotMarket.json`, + prettyJson(spotFactory.contracts.SpotMarketProxy), + 'utf8' + ); + await fs.appendFile( + `./docs/${chainId}.md`, + `| Spot Market | [${spotFactory.contracts.SpotMarketProxy.address}](${etherscanLink( + chainId, + spotFactory.contracts.SpotMarketProxy.address + )}) | [View/Download](./abis/${chainId}-SpotMarket.json) |\n`, + 'utf8' + ); + } + + const perpsFactory = + deployments?.state?.['provision.perpsFactory']?.artifacts?.imports?.perpsFactory; + if (perpsFactory) { + console.log(`Writing ${chainId}-PerpsMarket.json`); + await fs.writeFile( + `./abis/${chainId}-PerpsMarket.json`, + prettyJson(perpsFactory.contracts.PerpsMarketProxy), + 'utf8' + ); + await fs.appendFile( + `./docs/${chainId}.md`, + `| Perps Market | [${perpsFactory.contracts.PerpsMarketProxy.address}](${etherscanLink( + chainId, + perpsFactory.contracts.PerpsMarketProxy.address + )}) | [View/Download](./abis/${chainId}-PerpsMarket.json) |\n`, + 'utf8' + ); + + console.log(`Writing ${chainId}-PerpsAccountNFT.json`); + await fs.writeFile( + `./abis/${chainId}-PerpsAccountNFT.json`, + prettyJson(perpsFactory.contracts.AccountProxy), + 'utf8' + ); + await fs.appendFile( + `./docs/${chainId}.md`, + `| Perps Market Account NFT | [${ + perpsFactory.contracts.AccountProxy.address + }](${etherscanLink( + chainId, + perpsFactory.contracts.AccountProxy.address + )}) | [View/Download](./abis/${chainId}-PerpsAccountNFT.json) |\n`, + 'utf8' + ); + } + + console.log(`Writing ${chainId}.md`); + // SNX token + const configureSnxCollateral = + deployments?.state?.['invoke.configureSnxCollateral']?.artifacts?.txns?.configureSnxCollateral; + const [snxCollateralConfiguredEvent] = configureSnxCollateral?.events?.CollateralConfigured ?? []; + const [snxAddress] = snxCollateralConfiguredEvent?.args ?? []; + if (snxAddress) { + await fs.appendFile( + `./docs/${chainId}.md`, + `| SNX Token | [${snxAddress}](${etherscanLink( + chainId, + snxAddress + )}) | _ERC-20 compliant_ |\n`, + 'utf8' + ); + } } run(); diff --git a/utils/docgen/abis/1-OracleManager.json b/utils/docgen/abis/1-OracleManager.json deleted file mode 100644 index d3bf9e76df..0000000000 --- a/utils/docgen/abis/1-OracleManager.json +++ /dev/null @@ -1,495 +0,0 @@ -{ - "address": "0x0aaF300E148378489a8A471DD3e9E53E30cb42e3", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "deviation", - "type": "int256" - } - ], - "name": "DeviationToleranceExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInputPrice", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "internalType": "struct NodeDefinition.Data", - "name": "nodeType", - "type": "tuple" - } - ], - "name": "InvalidNodeDefinition", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "price", - "type": "int256" - } - ], - "name": "InvalidPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "NodeNotRegistered", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt56ToInt24", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint160", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint56ToInt56", - "type": "error" - }, - { - "inputs": [], - "name": "StalenessToleranceExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "UnprocessableNode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum ReducerNode.Operations", - "name": "operation", - "type": "uint8" - } - ], - "name": "UnsupportedOperation", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "NodeRegistered", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "getNode", - "outputs": [ - { - "components": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "internalType": "struct NodeDefinition.Data", - "name": "node", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "getNodeId", - "outputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "process", - "outputs": [ - { - "components": [ - { - "internalType": "int256", - "name": "price", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "__slotAvailableForFutureUse1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "__slotAvailableForFutureUse2", - "type": "uint256" - } - ], - "internalType": "struct NodeOutput.Data", - "name": "node", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "registerNode", - "outputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgrade_proxy" -} diff --git a/utils/docgen/abis/1-SynthetixCore.json b/utils/docgen/abis/1-SynthetixCore.json deleted file mode 100644 index 080cd9cbc4..0000000000 --- a/utils/docgen/abis/1-SynthetixCore.json +++ /dev/null @@ -1,4587 +0,0 @@ -{ - "address": "0xffffffaEff0B96Ea8e4f94b2253f31abdD875847", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "ValueAlreadyInSet", - "type": "error" - }, - { - "inputs": [], - "name": "ValueNotInSet", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "FeatureFlagAllowAllSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "FeatureFlagDeniersReset", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "FeatureFlagDenyAllSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "addToFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getDeniers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowlist", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagDenyAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isFeatureAllowed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "removeFromFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "setDeniers", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "setFeatureFlagAllowAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "setFeatureFlagDenyAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "which", - "type": "bytes32" - } - ], - "name": "FeatureUnavailable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "InvalidAccountId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "InvalidPermission", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "origin", - "type": "address" - } - ], - "name": "OnlyAccountTokenProxy", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "PermissionDenied", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "PermissionNotGranted", - "type": "error" - }, - { - "inputs": [], - "name": "PositionOutOfBounds", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "AccountCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "createAccount", - "outputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "requestedAccountId", - "type": "uint128" - } - ], - "name": "createAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountLastInteraction", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountPermissions", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "bytes32[]", - "name": "permissions", - "type": "bytes32[]" - } - ], - "internalType": "struct IAccountModule.AccountPermissions[]", - "name": "accountPerms", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAccountTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "grantPermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "hasPermission", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "notifyAccountTransfer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "renouncePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "revokePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "AccountNotFound", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyDistribution", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "debt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ratio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minRatio", - "type": "uint256" - } - ], - "name": "InsufficientCollateralRatio", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "MarketNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "NotFundedByPool", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint128ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "updatedDebt", - "type": "int256" - } - ], - "name": "DebtAssociated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "associateDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "currentTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requiredTime", - "type": "uint256" - } - ], - "name": "AccountActivityTimeoutPending", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "CollateralDepositDisabled", - "type": "error" - }, - { - "inputs": [], - "name": "CollateralNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "FailedTransfer", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "InsufficientAccountCollateral", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint64", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - } - ], - "name": "PrecisionLost", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "CollateralLockCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "CollateralLockExpired", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Withdrawn", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "offset", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "cleanExpiredLocks", - "outputs": [ - { - "internalType": "uint256", - "name": "cleared", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "createLock", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getAccountAvailableCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getAccountCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "totalDeposited", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalAssigned", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalLocked", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "offset", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "getLocks", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "amountD18", - "type": "uint128" - }, - { - "internalType": "uint64", - "name": "lockExpirationTime", - "type": "uint64" - } - ], - "internalType": "struct CollateralLock.Data[]", - "name": "locks", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct CollateralConfiguration.Data", - "name": "config", - "type": "tuple" - } - ], - "name": "CollateralConfigured", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data", - "name": "config", - "type": "tuple" - } - ], - "name": "configureCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getCollateralConfiguration", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "hideDisabled", - "type": "bool" - } - ], - "name": "getCollateralConfigurations", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getCollateralPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "currentDebt", - "type": "int256" - } - ], - "name": "InsufficientDebt", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "PoolNotFound", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "name": "IssuanceFeePaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "UsdBurned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "UsdMinted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnUsd", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mintUsd", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "CannotScaleEmptyMapping", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "debt", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "currentCRatio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "cratio", - "type": "uint256" - } - ], - "name": "IneligibleForLiquidation", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientMappedAmount", - "type": "error" - }, - { - "inputs": [], - "name": "MustBeVaultLiquidated", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt128ToUint128", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Liquidation", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "VaultLiquidation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "isPositionLiquidatable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "isVaultLiquidatable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - } - ], - "name": "liquidate", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxUsd", - "type": "uint256" - } - ], - "name": "liquidateVault", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmountToDeposit", - "type": "uint256" - } - ], - "name": "InsufficientMarketCollateralDepositable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmountToWithdraw", - "type": "uint256" - } - ], - "name": "InsufficientMarketCollateralWithdrawable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketCollateralDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketCollateralWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "systemAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "MaximumMarketCollateralConfigured", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "configureMaximumMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "depositMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getMarketCollateralAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmountD18", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketCollateralValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getMaximumMarketCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "withdrawMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "IncorrectMarketInterface", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "NotEnoughLiquidity", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "name": "MarketSystemFeePaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketUsdDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketUsdWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "SetMarketMinLiquidityRatio", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "minDelegateTime", - "type": "uint32" - } - ], - "name": "SetMinDelegateTime", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "depositMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxIter", - "type": "uint256" - } - ], - "name": "distributeDebtToPools", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketDebtPerShare", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "getMarketFees", - "outputs": [ - { - "internalType": "uint256", - "name": "depositFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawFeeAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketMinDelegateTime", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketNetIssuance", - "outputs": [ - { - "internalType": "int128", - "name": "", - "type": "int128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketReportedDebt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketTotalDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMinLiquidityRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getOracleManager", - "outputs": [ - { - "internalType": "contract IOracleManager", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUsdToken", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getWithdrawableMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "isMarketCapacityLocked", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "registerMarket", - "outputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "minDelegateTime", - "type": "uint32" - } - ], - "name": "setMarketMinDelegateTime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "setMinLiquidityRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdrawMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PoolApprovedAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PoolApprovedRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PreferredPoolSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "addApprovedPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getApprovedPools", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPreferredPool", - "outputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "removeApprovedPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "setPreferredPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketId", - "type": "uint256" - } - ], - "name": "CapacityLocked", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "timeRemaining", - "type": "uint32" - } - ], - "name": "MinDelegationTimeoutPending", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "PoolAlreadyExists", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "indexed": false, - "internalType": "struct MarketConfiguration.Data[]", - "name": "markets", - "type": "tuple[]" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolConfigurationSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolNameUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolNominationRenounced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolNominationRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "nominatedOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolOwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolOwnershipAccepted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "SetMinLiquidityRatio", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "acceptPoolOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "requestedPoolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "createPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getMinLiquidityRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getNominatedPoolOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolConfiguration", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "internalType": "struct MarketConfiguration.Data[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolName", - "outputs": [ - { - "internalType": "string", - "name": "poolName", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nominatedOwner", - "type": "address" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "nominatePoolOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "renouncePoolNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "revokePoolNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "setMinLiquidityRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "internalType": "struct MarketConfiguration.Data[]", - "name": "newMarketConfigurations", - "type": "tuple[]" - } - ], - "name": "setPoolConfiguration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "setPoolName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint32", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint32ToInt32", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint64ToInt64", - "type": "error" - }, - { - "inputs": [], - "name": "RewardDistributorNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardUnavailable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "distributor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "RewardsClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "distributor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "RewardsDistributed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardsDistributorRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardsDistributorRemoved", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "claimRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "start", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "duration", - "type": "uint32" - } - ], - "name": "distributeRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "getRewardRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "registerRewardsDistributor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "removeRewardsDistributor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "updateRewards", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "oracleManagerAddress", - "type": "address" - } - ], - "name": "configureOracleManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfig", - "outputs": [ - { - "internalType": "bytes32", - "name": "v", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ccipSend", - "type": "address" - }, - { - "internalType": "address", - "name": "ccipReceive", - "type": "address" - }, - { - "internalType": "address", - "name": "ccipTokenPool", - "type": "address" - } - ], - "name": "registerCcip", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "v", - "type": "bytes32" - } - ], - "name": "setConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minDelegation", - "type": "uint256" - } - ], - "name": "InsufficientDelegation", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidCollateralAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - } - ], - "name": "InvalidLeverage", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "DelegationUpdated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "newCollateralAmountD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - } - ], - "name": "delegateCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPosition", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "debt", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "collateralizationRatio", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionCollateralRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultCollateralRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgrade_core_proxy" -} diff --git a/utils/docgen/abis/1-snxAccountNFT.json b/utils/docgen/abis/1-snxAccountNFT.json deleted file mode 100644 index da55ced49b..0000000000 --- a/utils/docgen/abis/1-snxAccountNFT.json +++ /dev/null @@ -1,815 +0,0 @@ -{ - "address": "0x0E429603D3Cb1DFae4E6F52Add5fE82d96d77Dac", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "CannotSelfApprove", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requestedIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "IndexOverrun", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidTransferRecipient", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenAlreadyMinted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenDoesNotExist", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeMint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "setAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "setBaseTokenURI", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenOfOwnerByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "tokenURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.init_account" -} diff --git a/utils/docgen/abis/1-snxUSDToken.json b/utils/docgen/abis/1-snxUSDToken.json deleted file mode 100644 index fa398dac66..0000000000 --- a/utils/docgen/abis/1-snxUSDToken.json +++ /dev/null @@ -1,847 +0,0 @@ -{ - "address": "0xb2F30A7C980f052f02563fb518dcc39e6bf38175", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnWithAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "tokenDecimals", - "type": "uint8" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "setAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "destChainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferCrossChain", - "outputs": [ - { - "internalType": "uint256", - "name": "feesPaid", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.init_usd" -} diff --git a/utils/docgen/abis/10-OracleManager.json b/utils/docgen/abis/10-OracleManager.json deleted file mode 100644 index d3bf9e76df..0000000000 --- a/utils/docgen/abis/10-OracleManager.json +++ /dev/null @@ -1,495 +0,0 @@ -{ - "address": "0x0aaF300E148378489a8A471DD3e9E53E30cb42e3", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "deviation", - "type": "int256" - } - ], - "name": "DeviationToleranceExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInputPrice", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "internalType": "struct NodeDefinition.Data", - "name": "nodeType", - "type": "tuple" - } - ], - "name": "InvalidNodeDefinition", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "price", - "type": "int256" - } - ], - "name": "InvalidPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "NodeNotRegistered", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt56ToInt24", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint160", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint56ToInt56", - "type": "error" - }, - { - "inputs": [], - "name": "StalenessToleranceExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "UnprocessableNode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum ReducerNode.Operations", - "name": "operation", - "type": "uint8" - } - ], - "name": "UnsupportedOperation", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "NodeRegistered", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "getNode", - "outputs": [ - { - "components": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "internalType": "struct NodeDefinition.Data", - "name": "node", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "getNodeId", - "outputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "process", - "outputs": [ - { - "components": [ - { - "internalType": "int256", - "name": "price", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "__slotAvailableForFutureUse1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "__slotAvailableForFutureUse2", - "type": "uint256" - } - ], - "internalType": "struct NodeOutput.Data", - "name": "node", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "registerNode", - "outputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgrade_proxy" -} diff --git a/utils/docgen/abis/10-SpotMarket.json b/utils/docgen/abis/10-SpotMarket.json deleted file mode 100644 index e6dbfea352..0000000000 --- a/utils/docgen/abis/10-SpotMarket.json +++ /dev/null @@ -1,3757 +0,0 @@ -{ - "address": "0x38908Ee087D7db73A1Bd1ecab9AAb8E8c9C74595", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "which", - "type": "bytes32" - } - ], - "name": "FeatureUnavailable", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidMarketOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "synthImplementation", - "type": "uint256" - } - ], - "name": "InvalidSynthImplementation", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "marketOwner", - "type": "address" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "OnlyMarketOwner", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rate", - "type": "uint256" - } - ], - "name": "DecayRateUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "nominee", - "type": "address" - } - ], - "name": "MarketNominationRenounced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "MarketOwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "MarketOwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "synthImplementation", - "type": "address" - } - ], - "name": "SynthImplementationSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "SynthImplementationUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "buyFeedId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "sellFeedId", - "type": "bytes32" - } - ], - "name": "SynthPriceDataUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - } - ], - "name": "SynthRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "synthetix", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "usdTokenAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "oracleManager", - "type": "address" - } - ], - "name": "SynthetixSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "acceptMarketOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "address", - "name": "synthOwner", - "type": "address" - } - ], - "name": "createSynth", - "outputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "getMarketOwner", - "outputs": [ - { - "internalType": "address", - "name": "marketOwner", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getSynth", - "outputs": [ - { - "internalType": "address", - "name": "synthAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getSynthImpl", - "outputs": [ - { - "internalType": "address", - "name": "implAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "minimumCredit", - "outputs": [ - { - "internalType": "uint256", - "name": "lockedAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "marketName", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateMarketOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "renounceMarketNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "reportedDebt", - "outputs": [ - { - "internalType": "uint256", - "name": "reportedDebtAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "rate", - "type": "uint256" - } - ], - "name": "setDecayRate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "synthImplementation", - "type": "address" - } - ], - "name": "setSynthImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ISynthetixSystem", - "name": "synthetix", - "type": "address" - } - ], - "name": "setSynthetix", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "isSupported", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "buyFeedId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "sellFeedId", - "type": "bytes32" - } - ], - "name": "updatePriceData", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "upgradeSynthImpl", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "maxSynthAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "synthAmountCharged", - "type": "uint256" - } - ], - "name": "ExceedsMaxSynthAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "maxUsdAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "usdAmountCharged", - "type": "uint256" - } - ], - "name": "ExceedsMaxUsdAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "current", - "type": "uint256" - } - ], - "name": "InsufficientAmountReceived", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "InvalidMarket", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidPrices", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "synthReturned", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "indexed": false, - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collectedFees", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "referrer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - } - ], - "name": "SynthBought", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountReturned", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "indexed": false, - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collectedFees", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "referrer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - } - ], - "name": "SynthSold", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "usdAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountReceived", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "buy", - "outputs": [ - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "usdAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountReceived", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "buyExactIn", - "outputs": [ - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxUsdAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "buyExactOut", - "outputs": [ - { - "internalType": "uint256", - "name": "usdAmountCharged", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "usdAmount", - "type": "uint256" - } - ], - "name": "quoteBuyExactIn", - "outputs": [ - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - } - ], - "name": "quoteBuyExactOut", - "outputs": [ - { - "internalType": "uint256", - "name": "usdAmountCharged", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - } - ], - "name": "quoteSellExactIn", - "outputs": [ - { - "internalType": "uint256", - "name": "returnAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "usdAmount", - "type": "uint256" - } - ], - "name": "quoteSellExactOut", - "outputs": [ - { - "internalType": "uint256", - "name": "synthToBurn", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minUsdAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "sell", - "outputs": [ - { - "internalType": "uint256", - "name": "usdAmountReceived", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountReceived", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "sellExactIn", - "outputs": [ - { - "internalType": "uint256", - "name": "returnAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "usdAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxSynthAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "sellExactOut", - "outputs": [ - { - "internalType": "uint256", - "name": "synthToBurn", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expirationTime", - "type": "uint256" - } - ], - "name": "IneligibleForCancellation", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "actual", - "type": "uint256" - } - ], - "name": "InsufficientSharesAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum Transaction.Type", - "name": "transactionType", - "type": "uint8" - } - ], - "name": "InvalidAsyncTransactionType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "asyncOrderId", - "type": "uint256" - } - ], - "name": "InvalidClaim", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minimumAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "InvalidCommitmentAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "settlementStrategyId", - "type": "uint256" - } - ], - "name": "InvalidSettlementStrategy", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "asyncOrderId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settledAt", - "type": "uint256" - } - ], - "name": "OrderAlreadySettled", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "asyncOrderId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "id", - "type": "uint128" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "enum Transaction.Type", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "amountEscrowed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementStrategyId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minimumSettlementAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settledAt", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "indexed": false, - "internalType": "struct AsyncOrderClaim.Data", - "name": "asyncOrderClaim", - "type": "tuple" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "OrderCancelled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "enum Transaction.Type", - "name": "orderType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountProvided", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "asyncOrderId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "OrderCommitted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "asyncOrderId", - "type": "uint128" - } - ], - "name": "cancelOrder", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "enum Transaction.Type", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "amountProvided", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementStrategyId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minimumSettlementAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "commitOrder", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "id", - "type": "uint128" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "enum Transaction.Type", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "amountEscrowed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementStrategyId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minimumSettlementAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settledAt", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "internalType": "struct AsyncOrderClaim.Data", - "name": "asyncOrderClaim", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "asyncOrderId", - "type": "uint128" - } - ], - "name": "getAsyncOrderClaim", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "id", - "type": "uint128" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "enum Transaction.Type", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "amountEscrowed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementStrategyId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minimumSettlementAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settledAt", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "internalType": "struct AsyncOrderClaim.Data", - "name": "asyncOrderClaim", - "type": "tuple" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum SettlementStrategy.Type", - "name": "strategyType", - "type": "uint8" - } - ], - "name": "InvalidSettlementStrategy", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidVerificationResponse", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minimum", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "actual", - "type": "uint256" - } - ], - "name": "MinimumSettlementAmountNotMet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "string[]", - "name": "urls", - "type": "string[]" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - }, - { - "internalType": "bytes4", - "name": "callbackFunction", - "type": "bytes4" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "OffchainLookup", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "startTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expirationTime", - "type": "uint256" - } - ], - "name": "OutsideSettlementWindow", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint64", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "deviation", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tolerance", - "type": "uint256" - } - ], - "name": "PriceDeviationToleranceExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum SettlementStrategy.Type", - "name": "strategyType", - "type": "uint8" - } - ], - "name": "SettlementStrategyNotFound", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "asyncOrderId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "finalOrderAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "indexed": false, - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collectedFees", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "settler", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - } - ], - "name": "OrderSettled", - "type": "event" - }, - { - "inputs": [], - "name": "PRECISION", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "asyncOrderId", - "type": "uint128" - } - ], - "name": "settleOrder", - "outputs": [ - { - "internalType": "uint256", - "name": "finalOrderAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "result", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "settlePythOrder", - "outputs": [ - { - "internalType": "uint256", - "name": "finalOrderAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - } - ], - "name": "SettlementStrategyAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "SettlementStrategyUpdated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "enum SettlementStrategy.Type", - "name": "strategyType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "settlementDelay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementWindowDuration", - "type": "uint256" - }, - { - "internalType": "address", - "name": "priceVerificationContract", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "feedId", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "url", - "type": "string" - }, - { - "internalType": "uint256", - "name": "settlementReward", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "priceDeviationTolerance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minimumUsdExchangeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxRoundingLoss", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "disabled", - "type": "bool" - } - ], - "internalType": "struct SettlementStrategy.Data", - "name": "strategy", - "type": "tuple" - } - ], - "name": "addSettlementStrategy", - "outputs": [ - { - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - } - ], - "name": "getSettlementStrategy", - "outputs": [ - { - "components": [ - { - "internalType": "enum SettlementStrategy.Type", - "name": "strategyType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "settlementDelay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementWindowDuration", - "type": "uint256" - }, - { - "internalType": "address", - "name": "priceVerificationContract", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "feedId", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "url", - "type": "string" - }, - { - "internalType": "uint256", - "name": "settlementReward", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "priceDeviationTolerance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minimumUsdExchangeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxRoundingLoss", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "disabled", - "type": "bool" - } - ], - "internalType": "struct SettlementStrategy.Data", - "name": "settlementStrategy", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "setSettlementStrategyEnabled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "FailedTransfer", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "message", - "type": "bytes32" - } - ], - "name": "InvalidCollateralType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "maxWrappableAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentSupply", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountToWrap", - "type": "uint256" - } - ], - "name": "WrapperExceedsMaxAmount", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountUnwrapped", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "indexed": false, - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feesCollected", - "type": "uint256" - } - ], - "name": "SynthUnwrapped", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountWrapped", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "indexed": false, - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feesCollected", - "type": "uint256" - } - ], - "name": "SynthWrapped", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "wrapCollateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "maxWrappableAmount", - "type": "uint256" - } - ], - "name": "WrapperSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "wrapCollateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxWrappableAmount", - "type": "uint256" - } - ], - "name": "setWrapper", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "unwrapAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountReceived", - "type": "uint256" - } - ], - "name": "unwrap", - "outputs": [ - { - "internalType": "uint256", - "name": "returnCollateralAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "wrapAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountReceived", - "type": "uint256" - } - ], - "name": "wrap", - "outputs": [ - { - "internalType": "uint256", - "name": "amountToMint", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "InvalidCollateralLeverage", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "invalidFeeCollector", - "type": "address" - } - ], - "name": "InvalidFeeCollectorInterface", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidWrapperFees", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "asyncFixedFee", - "type": "uint256" - } - ], - "name": "AsyncFixedFeeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "atomicFixedFee", - "type": "uint256" - } - ], - "name": "AtomicFixedFeeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateralLeverage", - "type": "uint256" - } - ], - "name": "CollateralLeverageSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "feeCollector", - "type": "address" - } - ], - "name": "FeeCollectorSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "skewScale", - "type": "uint256" - } - ], - "name": "MarketSkewScaleSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "utilizationFeeRate", - "type": "uint256" - } - ], - "name": "MarketUtilizationFeesSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "referrer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "sharePercentage", - "type": "uint256" - } - ], - "name": "ReferrerShareUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "transactor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fixedFeeAmount", - "type": "uint256" - } - ], - "name": "TransactorFixedFeeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "wrapFee", - "type": "int256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "unwrapFee", - "type": "int256" - } - ], - "name": "WrapperFeesSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "getCollateralLeverage", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralLeverage", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "transactor", - "type": "address" - } - ], - "name": "getCustomTransactorFees", - "outputs": [ - { - "internalType": "uint256", - "name": "fixedFeeAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "getFeeCollector", - "outputs": [ - { - "internalType": "address", - "name": "feeCollector", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "getMarketFees", - "outputs": [ - { - "internalType": "uint256", - "name": "atomicFixedFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "asyncFixedFee", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "wrapFee", - "type": "int256" - }, - { - "internalType": "int256", - "name": "unwrapFee", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "getMarketSkewScale", - "outputs": [ - { - "internalType": "uint256", - "name": "skewScale", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "getMarketUtilizationFees", - "outputs": [ - { - "internalType": "uint256", - "name": "utilizationFeeRate", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "getReferrerShare", - "outputs": [ - { - "internalType": "uint256", - "name": "sharePercentage", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "asyncFixedFee", - "type": "uint256" - } - ], - "name": "setAsyncFixedFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "atomicFixedFee", - "type": "uint256" - } - ], - "name": "setAtomicFixedFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "collateralLeverage", - "type": "uint256" - } - ], - "name": "setCollateralLeverage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "transactor", - "type": "address" - }, - { - "internalType": "uint256", - "name": "fixedFeeAmount", - "type": "uint256" - } - ], - "name": "setCustomTransactorFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "feeCollector", - "type": "address" - } - ], - "name": "setFeeCollector", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "skewScale", - "type": "uint256" - } - ], - "name": "setMarketSkewScale", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "utilizationFeeRate", - "type": "uint256" - } - ], - "name": "setMarketUtilizationFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "int256", - "name": "wrapFee", - "type": "int256" - }, - { - "internalType": "int256", - "name": "unwrapFee", - "type": "int256" - } - ], - "name": "setWrapperFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "sharePercentage", - "type": "uint256" - } - ], - "name": "updateReferrerShare", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "ValueAlreadyInSet", - "type": "error" - }, - { - "inputs": [], - "name": "ValueNotInSet", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "FeatureFlagAllowAllSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "FeatureFlagDeniersReset", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "FeatureFlagDenyAllSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "addToFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getDeniers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowlist", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagDenyAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isFeatureAllowed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "removeFromFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "setDeniers", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "setFeatureFlagAllowAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "setFeatureFlagDenyAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgradeSpotMarketProxy" -} diff --git a/utils/docgen/abis/10-SynthetixCore.json b/utils/docgen/abis/10-SynthetixCore.json deleted file mode 100644 index 05e616d4e6..0000000000 --- a/utils/docgen/abis/10-SynthetixCore.json +++ /dev/null @@ -1,4649 +0,0 @@ -{ - "address": "0xffffffaEff0B96Ea8e4f94b2253f31abdD875847", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "ValueAlreadyInSet", - "type": "error" - }, - { - "inputs": [], - "name": "ValueNotInSet", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "FeatureFlagAllowAllSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "FeatureFlagDeniersReset", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "FeatureFlagDenyAllSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "addToFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getDeniers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowlist", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagDenyAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isFeatureAllowed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "removeFromFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "setDeniers", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "setFeatureFlagAllowAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "setFeatureFlagDenyAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "which", - "type": "bytes32" - } - ], - "name": "FeatureUnavailable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "InvalidAccountId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "InvalidPermission", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "origin", - "type": "address" - } - ], - "name": "OnlyAccountTokenProxy", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "PermissionDenied", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "PermissionNotGranted", - "type": "error" - }, - { - "inputs": [], - "name": "PositionOutOfBounds", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "AccountCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "createAccount", - "outputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "requestedAccountId", - "type": "uint128" - } - ], - "name": "createAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountLastInteraction", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountPermissions", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "bytes32[]", - "name": "permissions", - "type": "bytes32[]" - } - ], - "internalType": "struct IAccountModule.AccountPermissions[]", - "name": "accountPerms", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAccountTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "grantPermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "hasPermission", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "notifyAccountTransfer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "renouncePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "revokePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "AccountNotFound", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyDistribution", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "debt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ratio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minRatio", - "type": "uint256" - } - ], - "name": "InsufficientCollateralRatio", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "MarketNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "NotFundedByPool", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint128ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "updatedDebt", - "type": "int256" - } - ], - "name": "DebtAssociated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "associateDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "currentTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requiredTime", - "type": "uint256" - } - ], - "name": "AccountActivityTimeoutPending", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "CollateralDepositDisabled", - "type": "error" - }, - { - "inputs": [], - "name": "CollateralNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "FailedTransfer", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "InsufficientAccountCollateral", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint64", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - } - ], - "name": "PrecisionLost", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "CollateralLockCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "CollateralLockExpired", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Withdrawn", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "offset", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "cleanExpiredLocks", - "outputs": [ - { - "internalType": "uint256", - "name": "cleared", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "createLock", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getAccountAvailableCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getAccountCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "totalDeposited", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalAssigned", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalLocked", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "offset", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "getLocks", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "amountD18", - "type": "uint128" - }, - { - "internalType": "uint64", - "name": "lockExpirationTime", - "type": "uint64" - } - ], - "internalType": "struct CollateralLock.Data[]", - "name": "locks", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct CollateralConfiguration.Data", - "name": "config", - "type": "tuple" - } - ], - "name": "CollateralConfigured", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data", - "name": "config", - "type": "tuple" - } - ], - "name": "configureCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getCollateralConfiguration", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "hideDisabled", - "type": "bool" - } - ], - "name": "getCollateralConfigurations", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getCollateralPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "currentDebt", - "type": "int256" - } - ], - "name": "InsufficientDebt", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "PoolNotFound", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "name": "IssuanceFeePaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "UsdBurned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "UsdMinted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnUsd", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mintUsd", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "CannotScaleEmptyMapping", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "debt", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "currentCRatio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "cratio", - "type": "uint256" - } - ], - "name": "IneligibleForLiquidation", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientMappedAmount", - "type": "error" - }, - { - "inputs": [], - "name": "MustBeVaultLiquidated", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt128ToUint128", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Liquidation", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "VaultLiquidation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "isPositionLiquidatable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "isVaultLiquidatable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - } - ], - "name": "liquidate", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxUsd", - "type": "uint256" - } - ], - "name": "liquidateVault", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmountToDeposit", - "type": "uint256" - } - ], - "name": "InsufficientMarketCollateralDepositable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmountToWithdraw", - "type": "uint256" - } - ], - "name": "InsufficientMarketCollateralWithdrawable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketCollateralDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketCollateralWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "systemAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "MaximumMarketCollateralConfigured", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "configureMaximumMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "depositMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getMarketCollateralAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmountD18", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketCollateralValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getMaximumMarketCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "withdrawMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "IncorrectMarketInterface", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "NotEnoughLiquidity", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "name": "MarketSystemFeePaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketUsdDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketUsdWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "SetMarketMinLiquidityRatio", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "minDelegateTime", - "type": "uint32" - } - ], - "name": "SetMinDelegateTime", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "depositMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxIter", - "type": "uint256" - } - ], - "name": "distributeDebtToPools", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketDebtPerShare", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "getMarketFees", - "outputs": [ - { - "internalType": "uint256", - "name": "depositFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawFeeAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketMinDelegateTime", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketNetIssuance", - "outputs": [ - { - "internalType": "int128", - "name": "", - "type": "int128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketReportedDebt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketTotalDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMinLiquidityRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getOracleManager", - "outputs": [ - { - "internalType": "contract IOracleManager", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUsdToken", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getWithdrawableMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "isMarketCapacityLocked", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "registerMarket", - "outputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "minDelegateTime", - "type": "uint32" - } - ], - "name": "setMarketMinDelegateTime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "setMinLiquidityRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdrawMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "RecursiveMulticall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PoolApprovedAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PoolApprovedRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PreferredPoolSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "addApprovedPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getApprovedPools", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPreferredPool", - "outputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "removeApprovedPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "setPreferredPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketId", - "type": "uint256" - } - ], - "name": "CapacityLocked", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "timeRemaining", - "type": "uint32" - } - ], - "name": "MinDelegationTimeoutPending", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "PoolAlreadyExists", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "indexed": false, - "internalType": "struct MarketConfiguration.Data[]", - "name": "markets", - "type": "tuple[]" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolConfigurationSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolNameUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolNominationRenounced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolNominationRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "nominatedOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolOwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolOwnershipAccepted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "SetMinLiquidityRatio", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "acceptPoolOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "requestedPoolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "createPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getMinLiquidityRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getNominatedPoolOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolConfiguration", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "internalType": "struct MarketConfiguration.Data[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolName", - "outputs": [ - { - "internalType": "string", - "name": "poolName", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nominatedOwner", - "type": "address" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "nominatePoolOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "rebalancePool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "renouncePoolNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "revokePoolNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "setMinLiquidityRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "internalType": "struct MarketConfiguration.Data[]", - "name": "newMarketConfigurations", - "type": "tuple[]" - } - ], - "name": "setPoolConfiguration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "setPoolName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint32", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint32ToInt32", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint64ToInt64", - "type": "error" - }, - { - "inputs": [], - "name": "RewardDistributorNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardUnavailable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "distributor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "RewardsClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "distributor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "RewardsDistributed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardsDistributorRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardsDistributorRemoved", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "claimRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "start", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "duration", - "type": "uint32" - } - ], - "name": "distributeRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "getRewardRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "registerRewardsDistributor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "removeRewardsDistributor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "updateRewards", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "oracleManagerAddress", - "type": "address" - } - ], - "name": "configureOracleManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfig", - "outputs": [ - { - "internalType": "bytes32", - "name": "v", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfigAddress", - "outputs": [ - { - "internalType": "address", - "name": "v", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfigUint", - "outputs": [ - { - "internalType": "uint256", - "name": "v", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ccipSend", - "type": "address" - }, - { - "internalType": "address", - "name": "ccipReceive", - "type": "address" - }, - { - "internalType": "address", - "name": "ccipTokenPool", - "type": "address" - } - ], - "name": "registerCcip", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "v", - "type": "bytes32" - } - ], - "name": "setConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minDelegation", - "type": "uint256" - } - ], - "name": "InsufficientDelegation", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidCollateralAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - } - ], - "name": "InvalidLeverage", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "DelegationUpdated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "newCollateralAmountD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - } - ], - "name": "delegateCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPosition", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "debt", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "collateralizationRatio", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionCollateralRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultCollateralRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgrade_core_proxy" -} diff --git a/utils/docgen/abis/10-snxAccountNFT.json b/utils/docgen/abis/10-snxAccountNFT.json deleted file mode 100644 index da55ced49b..0000000000 --- a/utils/docgen/abis/10-snxAccountNFT.json +++ /dev/null @@ -1,815 +0,0 @@ -{ - "address": "0x0E429603D3Cb1DFae4E6F52Add5fE82d96d77Dac", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "CannotSelfApprove", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requestedIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "IndexOverrun", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidTransferRecipient", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenAlreadyMinted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenDoesNotExist", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeMint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "setAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "setBaseTokenURI", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenOfOwnerByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "tokenURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.init_account" -} diff --git a/utils/docgen/abis/10-snxUSDToken.json b/utils/docgen/abis/10-snxUSDToken.json deleted file mode 100644 index fa398dac66..0000000000 --- a/utils/docgen/abis/10-snxUSDToken.json +++ /dev/null @@ -1,847 +0,0 @@ -{ - "address": "0xb2F30A7C980f052f02563fb518dcc39e6bf38175", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnWithAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "tokenDecimals", - "type": "uint8" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "setAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "destChainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferCrossChain", - "outputs": [ - { - "internalType": "uint256", - "name": "feesPaid", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.init_usd" -} diff --git a/utils/docgen/abis/11155111-OracleManager.json b/utils/docgen/abis/11155111-OracleManager.json deleted file mode 100644 index d3bf9e76df..0000000000 --- a/utils/docgen/abis/11155111-OracleManager.json +++ /dev/null @@ -1,495 +0,0 @@ -{ - "address": "0x0aaF300E148378489a8A471DD3e9E53E30cb42e3", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "deviation", - "type": "int256" - } - ], - "name": "DeviationToleranceExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInputPrice", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "internalType": "struct NodeDefinition.Data", - "name": "nodeType", - "type": "tuple" - } - ], - "name": "InvalidNodeDefinition", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "price", - "type": "int256" - } - ], - "name": "InvalidPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "NodeNotRegistered", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt56ToInt24", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint160", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint56ToInt56", - "type": "error" - }, - { - "inputs": [], - "name": "StalenessToleranceExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "UnprocessableNode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum ReducerNode.Operations", - "name": "operation", - "type": "uint8" - } - ], - "name": "UnsupportedOperation", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "NodeRegistered", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "getNode", - "outputs": [ - { - "components": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "internalType": "struct NodeDefinition.Data", - "name": "node", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "getNodeId", - "outputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "process", - "outputs": [ - { - "components": [ - { - "internalType": "int256", - "name": "price", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "__slotAvailableForFutureUse1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "__slotAvailableForFutureUse2", - "type": "uint256" - } - ], - "internalType": "struct NodeOutput.Data", - "name": "node", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "registerNode", - "outputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgrade_proxy" -} diff --git a/utils/docgen/abis/11155111-SynthetixCore.json b/utils/docgen/abis/11155111-SynthetixCore.json deleted file mode 100644 index 05e616d4e6..0000000000 --- a/utils/docgen/abis/11155111-SynthetixCore.json +++ /dev/null @@ -1,4649 +0,0 @@ -{ - "address": "0xffffffaEff0B96Ea8e4f94b2253f31abdD875847", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "ValueAlreadyInSet", - "type": "error" - }, - { - "inputs": [], - "name": "ValueNotInSet", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "FeatureFlagAllowAllSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "FeatureFlagDeniersReset", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "FeatureFlagDenyAllSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "addToFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getDeniers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowlist", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagDenyAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isFeatureAllowed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "removeFromFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "setDeniers", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "setFeatureFlagAllowAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "setFeatureFlagDenyAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "which", - "type": "bytes32" - } - ], - "name": "FeatureUnavailable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "InvalidAccountId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "InvalidPermission", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "origin", - "type": "address" - } - ], - "name": "OnlyAccountTokenProxy", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "PermissionDenied", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "PermissionNotGranted", - "type": "error" - }, - { - "inputs": [], - "name": "PositionOutOfBounds", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "AccountCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "createAccount", - "outputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "requestedAccountId", - "type": "uint128" - } - ], - "name": "createAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountLastInteraction", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountPermissions", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "bytes32[]", - "name": "permissions", - "type": "bytes32[]" - } - ], - "internalType": "struct IAccountModule.AccountPermissions[]", - "name": "accountPerms", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAccountTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "grantPermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "hasPermission", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "notifyAccountTransfer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "renouncePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "revokePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "AccountNotFound", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyDistribution", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "debt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ratio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minRatio", - "type": "uint256" - } - ], - "name": "InsufficientCollateralRatio", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "MarketNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "NotFundedByPool", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint128ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "updatedDebt", - "type": "int256" - } - ], - "name": "DebtAssociated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "associateDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "currentTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requiredTime", - "type": "uint256" - } - ], - "name": "AccountActivityTimeoutPending", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "CollateralDepositDisabled", - "type": "error" - }, - { - "inputs": [], - "name": "CollateralNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "FailedTransfer", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "InsufficientAccountCollateral", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint64", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - } - ], - "name": "PrecisionLost", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "CollateralLockCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "CollateralLockExpired", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Withdrawn", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "offset", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "cleanExpiredLocks", - "outputs": [ - { - "internalType": "uint256", - "name": "cleared", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "createLock", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getAccountAvailableCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getAccountCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "totalDeposited", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalAssigned", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalLocked", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "offset", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "getLocks", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "amountD18", - "type": "uint128" - }, - { - "internalType": "uint64", - "name": "lockExpirationTime", - "type": "uint64" - } - ], - "internalType": "struct CollateralLock.Data[]", - "name": "locks", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct CollateralConfiguration.Data", - "name": "config", - "type": "tuple" - } - ], - "name": "CollateralConfigured", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data", - "name": "config", - "type": "tuple" - } - ], - "name": "configureCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getCollateralConfiguration", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "hideDisabled", - "type": "bool" - } - ], - "name": "getCollateralConfigurations", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getCollateralPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "currentDebt", - "type": "int256" - } - ], - "name": "InsufficientDebt", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "PoolNotFound", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "name": "IssuanceFeePaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "UsdBurned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "UsdMinted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnUsd", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mintUsd", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "CannotScaleEmptyMapping", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "debt", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "currentCRatio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "cratio", - "type": "uint256" - } - ], - "name": "IneligibleForLiquidation", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientMappedAmount", - "type": "error" - }, - { - "inputs": [], - "name": "MustBeVaultLiquidated", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt128ToUint128", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Liquidation", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "VaultLiquidation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "isPositionLiquidatable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "isVaultLiquidatable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - } - ], - "name": "liquidate", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxUsd", - "type": "uint256" - } - ], - "name": "liquidateVault", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmountToDeposit", - "type": "uint256" - } - ], - "name": "InsufficientMarketCollateralDepositable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmountToWithdraw", - "type": "uint256" - } - ], - "name": "InsufficientMarketCollateralWithdrawable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketCollateralDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketCollateralWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "systemAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "MaximumMarketCollateralConfigured", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "configureMaximumMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "depositMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getMarketCollateralAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmountD18", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketCollateralValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getMaximumMarketCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "withdrawMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "IncorrectMarketInterface", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "NotEnoughLiquidity", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "name": "MarketSystemFeePaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketUsdDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketUsdWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "SetMarketMinLiquidityRatio", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "minDelegateTime", - "type": "uint32" - } - ], - "name": "SetMinDelegateTime", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "depositMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxIter", - "type": "uint256" - } - ], - "name": "distributeDebtToPools", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketDebtPerShare", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "getMarketFees", - "outputs": [ - { - "internalType": "uint256", - "name": "depositFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawFeeAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketMinDelegateTime", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketNetIssuance", - "outputs": [ - { - "internalType": "int128", - "name": "", - "type": "int128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketReportedDebt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketTotalDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMinLiquidityRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getOracleManager", - "outputs": [ - { - "internalType": "contract IOracleManager", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUsdToken", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getWithdrawableMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "isMarketCapacityLocked", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "registerMarket", - "outputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "minDelegateTime", - "type": "uint32" - } - ], - "name": "setMarketMinDelegateTime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "setMinLiquidityRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdrawMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "RecursiveMulticall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PoolApprovedAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PoolApprovedRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PreferredPoolSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "addApprovedPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getApprovedPools", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPreferredPool", - "outputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "removeApprovedPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "setPreferredPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketId", - "type": "uint256" - } - ], - "name": "CapacityLocked", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "timeRemaining", - "type": "uint32" - } - ], - "name": "MinDelegationTimeoutPending", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "PoolAlreadyExists", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "indexed": false, - "internalType": "struct MarketConfiguration.Data[]", - "name": "markets", - "type": "tuple[]" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolConfigurationSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolNameUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolNominationRenounced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolNominationRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "nominatedOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolOwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolOwnershipAccepted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "SetMinLiquidityRatio", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "acceptPoolOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "requestedPoolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "createPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getMinLiquidityRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getNominatedPoolOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolConfiguration", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "internalType": "struct MarketConfiguration.Data[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolName", - "outputs": [ - { - "internalType": "string", - "name": "poolName", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nominatedOwner", - "type": "address" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "nominatePoolOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "rebalancePool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "renouncePoolNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "revokePoolNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "setMinLiquidityRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "internalType": "struct MarketConfiguration.Data[]", - "name": "newMarketConfigurations", - "type": "tuple[]" - } - ], - "name": "setPoolConfiguration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "setPoolName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint32", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint32ToInt32", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint64ToInt64", - "type": "error" - }, - { - "inputs": [], - "name": "RewardDistributorNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardUnavailable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "distributor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "RewardsClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "distributor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "RewardsDistributed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardsDistributorRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardsDistributorRemoved", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "claimRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "start", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "duration", - "type": "uint32" - } - ], - "name": "distributeRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "getRewardRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "registerRewardsDistributor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "removeRewardsDistributor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "updateRewards", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "oracleManagerAddress", - "type": "address" - } - ], - "name": "configureOracleManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfig", - "outputs": [ - { - "internalType": "bytes32", - "name": "v", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfigAddress", - "outputs": [ - { - "internalType": "address", - "name": "v", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfigUint", - "outputs": [ - { - "internalType": "uint256", - "name": "v", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ccipSend", - "type": "address" - }, - { - "internalType": "address", - "name": "ccipReceive", - "type": "address" - }, - { - "internalType": "address", - "name": "ccipTokenPool", - "type": "address" - } - ], - "name": "registerCcip", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "v", - "type": "bytes32" - } - ], - "name": "setConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minDelegation", - "type": "uint256" - } - ], - "name": "InsufficientDelegation", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidCollateralAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - } - ], - "name": "InvalidLeverage", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "DelegationUpdated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "newCollateralAmountD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - } - ], - "name": "delegateCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPosition", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "debt", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "collateralizationRatio", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionCollateralRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultCollateralRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgrade_core_proxy" -} diff --git a/utils/docgen/abis/11155111-snxAccountNFT.json b/utils/docgen/abis/11155111-snxAccountNFT.json deleted file mode 100644 index da55ced49b..0000000000 --- a/utils/docgen/abis/11155111-snxAccountNFT.json +++ /dev/null @@ -1,815 +0,0 @@ -{ - "address": "0x0E429603D3Cb1DFae4E6F52Add5fE82d96d77Dac", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "CannotSelfApprove", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requestedIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "IndexOverrun", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidTransferRecipient", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenAlreadyMinted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenDoesNotExist", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeMint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "setAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "setBaseTokenURI", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenOfOwnerByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "tokenURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.init_account" -} diff --git a/utils/docgen/abis/11155111-snxUSDToken.json b/utils/docgen/abis/11155111-snxUSDToken.json deleted file mode 100644 index fa398dac66..0000000000 --- a/utils/docgen/abis/11155111-snxUSDToken.json +++ /dev/null @@ -1,847 +0,0 @@ -{ - "address": "0xb2F30A7C980f052f02563fb518dcc39e6bf38175", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnWithAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "tokenDecimals", - "type": "uint8" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "setAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "destChainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferCrossChain", - "outputs": [ - { - "internalType": "uint256", - "name": "feesPaid", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.init_usd" -} diff --git a/utils/docgen/abis/420-OracleManager.json b/utils/docgen/abis/420-OracleManager.json deleted file mode 100644 index 92a12c9cea..0000000000 --- a/utils/docgen/abis/420-OracleManager.json +++ /dev/null @@ -1,495 +0,0 @@ -{ - "address": "0x12aE0D5CD26f212bFE242DA78139d463019f7a73", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "deviation", - "type": "int256" - } - ], - "name": "DeviationToleranceExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInputPrice", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "internalType": "struct NodeDefinition.Data", - "name": "nodeType", - "type": "tuple" - } - ], - "name": "InvalidNodeDefinition", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "price", - "type": "int256" - } - ], - "name": "InvalidPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "NodeNotRegistered", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt56ToInt24", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint160", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint56ToInt56", - "type": "error" - }, - { - "inputs": [], - "name": "StalenessToleranceExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "UnprocessableNode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum ReducerNode.Operations", - "name": "operation", - "type": "uint8" - } - ], - "name": "UnsupportedOperation", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "NodeRegistered", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "getNode", - "outputs": [ - { - "components": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "internalType": "struct NodeDefinition.Data", - "name": "node", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "getNodeId", - "outputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "process", - "outputs": [ - { - "components": [ - { - "internalType": "int256", - "name": "price", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "__slotAvailableForFutureUse1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "__slotAvailableForFutureUse2", - "type": "uint256" - } - ], - "internalType": "struct NodeOutput.Data", - "name": "node", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "registerNode", - "outputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgrade_proxy" -} diff --git a/utils/docgen/abis/420-PerpsAccountNFT.json b/utils/docgen/abis/420-PerpsAccountNFT.json deleted file mode 100644 index 00285918eb..0000000000 --- a/utils/docgen/abis/420-PerpsAccountNFT.json +++ /dev/null @@ -1,815 +0,0 @@ -{ - "address": "0x7373943403E7f1913C5C468fB82ea86A6E3911c1", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "CannotSelfApprove", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requestedIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "IndexOverrun", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidTransferRecipient", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenAlreadyMinted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenDoesNotExist", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeMint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "setAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "setBaseTokenURI", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenOfOwnerByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "tokenURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.init_account" -} diff --git a/utils/docgen/abis/420-PerpsMarket.json b/utils/docgen/abis/420-PerpsMarket.json deleted file mode 100644 index cd7aee84ac..0000000000 --- a/utils/docgen/abis/420-PerpsMarket.json +++ /dev/null @@ -1,3372 +0,0 @@ -{ - "address": "0x54D71285871C5a0914F5B53740b70bA3eDb51Fbb", - "abi": [ - { - "inputs": [ - { - "internalType": "bytes32", - "name": "which", - "type": "bytes32" - } - ], - "name": "FeatureUnavailable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "InvalidAccountId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "InvalidPermission", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "origin", - "type": "address" - } - ], - "name": "OnlyAccountTokenProxy", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "PermissionDenied", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "PermissionNotGranted", - "type": "error" - }, - { - "inputs": [], - "name": "PositionOutOfBounds", - "type": "error" - }, - { - "inputs": [], - "name": "ValueAlreadyInSet", - "type": "error" - }, - { - "inputs": [], - "name": "ValueNotInSet", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "AccountCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "createAccount", - "outputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "requestedAccountId", - "type": "uint128" - } - ], - "name": "createAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountLastInteraction", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountPermissions", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "bytes32[]", - "name": "permissions", - "type": "bytes32[]" - } - ], - "internalType": "struct IAccountModule.AccountPermissions[]", - "name": "accountPerms", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAccountTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "grantPermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "hasPermission", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "notifyAccountTransfer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "renouncePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "revokePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "InvalidMarketOwner", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "perpsMarketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "MarketOwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "perpsMarketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "MarketOwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "perpsMarketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "feedId", - "type": "bytes32" - } - ], - "name": "MarketPriceDataUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "perpsMarketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "marketOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "string", - "name": "marketName", - "type": "string" - }, - { - "indexed": false, - "internalType": "string", - "name": "marketSymbol", - "type": "string" - } - ], - "name": "MarketRegistered", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "perpsMarketId", - "type": "uint128" - } - ], - "name": "acceptMarketOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "marketName", - "type": "string" - }, - { - "internalType": "string", - "name": "marketSymbol", - "type": "string" - }, - { - "internalType": "address", - "name": "marketOwner", - "type": "address" - } - ], - "name": "createMarket", - "outputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "perpsMarketId", - "type": "uint128" - } - ], - "name": "getMarketOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "perpsMarketId", - "type": "uint128" - } - ], - "name": "minimumCredit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "perpsMarketId", - "type": "uint128" - } - ], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "perpsMarketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateMarketOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "perpsMarketId", - "type": "uint128" - } - ], - "name": "reportedDebt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ISpotMarketSystem", - "name": "spotMarket", - "type": "address" - } - ], - "name": "setSpotMarket", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ISynthetixSystem", - "name": "synthetix", - "type": "address" - } - ], - "name": "setSynthetix", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "perpsMarketId", - "type": "uint128" - } - ], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "perpsMarketId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "feedId", - "type": "bytes32" - } - ], - "name": "updatePriceData", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "AccountLiquidatable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "AccountNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawAmount", - "type": "uint256" - } - ], - "name": "InsufficientCollateral", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "available", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - } - ], - "name": "InsufficientCollateralAvailableForWithdraw", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "amountDelta", - "type": "int256" - } - ], - "name": "InvalidAmountDelta", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "InvalidMarket", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "depositAmount", - "type": "uint256" - } - ], - "name": "MaxCollateralExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint128ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "PriceFeedNotSet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "SynthNotEnabledForCollateral", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "int256", - "name": "amountDelta", - "type": "int256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "CollateralModified", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getAsyncOrderClaim", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "sizeDelta", - "type": "int128" - }, - { - "internalType": "uint128", - "name": "settlementStrategyId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "settlementTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "trackingCode", - "type": "bytes32" - } - ], - "internalType": "struct AsyncOrder.Data", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAvailableMargin", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getOpenPosition", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - }, - { - "internalType": "int256", - "name": "", - "type": "int256" - }, - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "int256", - "name": "amountDelta", - "type": "int256" - } - ], - "name": "modifyCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "totalAccountOpenInterest", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "totalCollateralValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "currentFundingRate", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "currentFundingVelocity", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "int256", - "name": "orderSize", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - } - ], - "name": "fillPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketSummary", - "outputs": [ - { - "components": [ - { - "internalType": "int256", - "name": "skew", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "size", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxOpenInterest", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "currentFundingRate", - "type": "int256" - }, - { - "internalType": "int256", - "name": "currentFundingVelocity", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "indexPrice", - "type": "uint256" - } - ], - "internalType": "struct IPerpsMarketModule.MarketSummary", - "name": "summary", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "indexPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "maxOpenInterest", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "size", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "skew", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "fillPrice", - "type": "uint256" - } - ], - "name": "AcceptablePriceExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "availableMargin", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "minMargin", - "type": "uint256" - } - ], - "name": "InsufficientMargin", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "leftover", - "type": "uint256" - } - ], - "name": "InsufficientMarginError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "settlementStrategyId", - "type": "uint128" - } - ], - "name": "InvalidSettlementStrategy", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "string[]", - "name": "urls", - "type": "string[]" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - }, - { - "internalType": "bytes4", - "name": "callbackFunction", - "type": "bytes4" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "OffchainLookup", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "OrderAlreadyCommitted", - "type": "error" - }, - { - "inputs": [], - "name": "OrderNotValid", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint64", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "deviation", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tolerance", - "type": "uint256" - } - ], - "name": "PriceDeviationToleranceExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum SettlementStrategy.Type", - "name": "strategyType", - "type": "uint8" - } - ], - "name": "SettlementStrategyNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementExpiration", - "type": "uint256" - } - ], - "name": "SettlementWindowExpired", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementExpiration", - "type": "uint256" - } - ], - "name": "SettlementWindowNotExpired", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroSizeOrder", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "settlementTime", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - } - ], - "name": "OrderCanceled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "enum SettlementStrategy.Type", - "name": "orderType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "int128", - "name": "sizeDelta", - "type": "int128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "settlementTime", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "expirationTime", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "trackingCode", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "OrderCommitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fillPrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "accountPnlRealized", - "type": "int256" - }, - { - "indexed": false, - "internalType": "int128", - "name": "newSize", - "type": "int128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collectedFees", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "settelementReward", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "trackingCode", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "settler", - "type": "address" - } - ], - "name": "OrderSettled", - "type": "event" - }, - { - "inputs": [], - "name": "PRECISION", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "cancelOrder", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "sizeDelta", - "type": "int128" - }, - { - "internalType": "uint128", - "name": "settlementStrategyId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "trackingCode", - "type": "bytes32" - } - ], - "internalType": "struct AsyncOrder.OrderCommitmentRequest", - "name": "commitment", - "type": "tuple" - } - ], - "name": "commitOrder", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "sizeDelta", - "type": "int128" - }, - { - "internalType": "uint128", - "name": "settlementStrategyId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "settlementTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "trackingCode", - "type": "bytes32" - } - ], - "internalType": "struct AsyncOrder.Data", - "name": "retOrder", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "fees", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getOrder", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "sizeDelta", - "type": "int128" - }, - { - "internalType": "uint128", - "name": "settlementStrategyId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "settlementTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "trackingCode", - "type": "bytes32" - } - ], - "internalType": "struct AsyncOrder.Data", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "settle", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "result", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "settlePythOrder", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "FeatureFlagAllowAllSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "FeatureFlagDeniersReset", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "FeatureFlagDenyAllSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "addToFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getDeniers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowlist", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagDenyAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isFeatureAllowed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "removeFromFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "setDeniers", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "setFeatureFlagAllowAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "setFeatureFlagDenyAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "NotEligibleForLiquidation", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "liquidate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "liquidateFlagged", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "marketOwner", - "type": "address" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "OnlyMarketOwner", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "skewScale", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "maxFundingVelocity", - "type": "uint256" - } - ], - "name": "FundingParametersSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "initialMarginFraction", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "maintenanceMarginFraction", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "liquidationRewardRatioD18", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "maxLiquidationLimitAccumulationMultiplier", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "maxSecondsInLiquidationWindow", - "type": "uint256" - } - ], - "name": "LiquidationParametersSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lockedOiPercent", - "type": "uint256" - } - ], - "name": "LockedOiPercentSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "maxMarketValue", - "type": "uint256" - } - ], - "name": "MaxMarketValueSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "makerFeeRatio", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "takerFeeRatio", - "type": "uint256" - } - ], - "name": "OrderFeesSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "enum SettlementStrategy.Type", - "name": "strategyType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "settlementDelay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementWindowDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "priceWindowDuration", - "type": "uint256" - }, - { - "internalType": "address", - "name": "priceVerificationContract", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "feedId", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "url", - "type": "string" - }, - { - "internalType": "uint256", - "name": "settlementReward", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "priceDeviationTolerance", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "disabled", - "type": "bool" - } - ], - "indexed": false, - "internalType": "struct SettlementStrategy.Data", - "name": "strategy", - "type": "tuple" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - } - ], - "name": "SettlementStrategyAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "SettlementStrategyEnabled", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "enum SettlementStrategy.Type", - "name": "strategyType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "settlementDelay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementWindowDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "priceWindowDuration", - "type": "uint256" - }, - { - "internalType": "address", - "name": "priceVerificationContract", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "feedId", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "url", - "type": "string" - }, - { - "internalType": "uint256", - "name": "settlementReward", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "priceDeviationTolerance", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "disabled", - "type": "bool" - } - ], - "internalType": "struct SettlementStrategy.Data", - "name": "strategy", - "type": "tuple" - } - ], - "name": "addSettlementStrategy", - "outputs": [ - { - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getFundingParameters", - "outputs": [ - { - "internalType": "uint256", - "name": "skewScale", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxFundingVelocity", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getLiquidationParameters", - "outputs": [ - { - "internalType": "uint256", - "name": "initialMarginFraction", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maintenanceMarginFraction", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLiquidationLimitAccumulationMultiplier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxSecondsInLiquidationWindow", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getLockedOiPercent", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMaxMarketValue", - "outputs": [ - { - "internalType": "uint256", - "name": "maxMarketValue", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getOrderFees", - "outputs": [ - { - "internalType": "uint256", - "name": "makerFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "takerFee", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - } - ], - "name": "getSettlementStrategy", - "outputs": [ - { - "components": [ - { - "internalType": "enum SettlementStrategy.Type", - "name": "strategyType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "settlementDelay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementWindowDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "priceWindowDuration", - "type": "uint256" - }, - { - "internalType": "address", - "name": "priceVerificationContract", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "feedId", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "url", - "type": "string" - }, - { - "internalType": "uint256", - "name": "settlementReward", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "priceDeviationTolerance", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "disabled", - "type": "bool" - } - ], - "internalType": "struct SettlementStrategy.Data", - "name": "settlementStrategy", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "skewScale", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxFundingVelocity", - "type": "uint256" - } - ], - "name": "setFundingParameters", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "initialMarginFraction", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maintenanceMarginFraction", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLiquidationLimitAccumulationMultiplier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxSecondsInLiquidationWindow", - "type": "uint256" - } - ], - "name": "setLiquidationParameters", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "lockedOiPercent", - "type": "uint256" - } - ], - "name": "setLockedOiPercent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxMarketValue", - "type": "uint256" - } - ], - "name": "setMaxMarketValue", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "makerFeeRatio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "takerFeeRatio", - "type": "uint256" - } - ], - "name": "setOrderFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "setSettlementStrategyEnabled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "minLiquidationRewardUsd", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "maxLiquidationRewardUsd", - "type": "uint256" - } - ], - "name": "LiquidationRewardGuardsSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - } - ], - "name": "MaxCollateralAmountSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint128[]", - "name": "newSynthDeductionPriority", - "type": "uint128[]" - } - ], - "name": "SynthDeductionPrioritySet", - "type": "event" - }, - { - "inputs": [], - "name": "getLiquidationRewardGuards", - "outputs": [ - { - "internalType": "uint256", - "name": "minLiquidationRewardUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLiquidationRewardUsd", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "getMaxCollateralAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getSynthDeductionPriority", - "outputs": [ - { - "internalType": "uint128[]", - "name": "", - "type": "uint128[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minLiquidationRewardUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxLiquidationRewardUsd", - "type": "uint256" - } - ], - "name": "setLiquidationRewardGuards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - } - ], - "name": "setMaxCollateralAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128[]", - "name": "newSynthDeductionPriority", - "type": "uint128[]" - } - ], - "name": "setSynthDeductionPriority", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgrade_proxy" -} diff --git a/utils/docgen/abis/420-SpotMarket.json b/utils/docgen/abis/420-SpotMarket.json deleted file mode 100644 index 3705104819..0000000000 --- a/utils/docgen/abis/420-SpotMarket.json +++ /dev/null @@ -1,3757 +0,0 @@ -{ - "address": "0x5FF4b3aacdeC86782d8c757FAa638d8790799E83", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "which", - "type": "bytes32" - } - ], - "name": "FeatureUnavailable", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidMarketOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "synthImplementation", - "type": "uint256" - } - ], - "name": "InvalidSynthImplementation", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "marketOwner", - "type": "address" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "OnlyMarketOwner", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rate", - "type": "uint256" - } - ], - "name": "DecayRateUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "nominee", - "type": "address" - } - ], - "name": "MarketNominationRenounced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "MarketOwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "MarketOwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "synthImplementation", - "type": "address" - } - ], - "name": "SynthImplementationSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "SynthImplementationUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "buyFeedId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "sellFeedId", - "type": "bytes32" - } - ], - "name": "SynthPriceDataUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - } - ], - "name": "SynthRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "synthetix", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "usdTokenAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "oracleManager", - "type": "address" - } - ], - "name": "SynthetixSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "acceptMarketOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "address", - "name": "synthOwner", - "type": "address" - } - ], - "name": "createSynth", - "outputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "getMarketOwner", - "outputs": [ - { - "internalType": "address", - "name": "marketOwner", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getSynth", - "outputs": [ - { - "internalType": "address", - "name": "synthAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getSynthImpl", - "outputs": [ - { - "internalType": "address", - "name": "implAddress", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "minimumCredit", - "outputs": [ - { - "internalType": "uint256", - "name": "lockedAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "marketName", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateMarketOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "renounceMarketNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "reportedDebt", - "outputs": [ - { - "internalType": "uint256", - "name": "reportedDebtAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "rate", - "type": "uint256" - } - ], - "name": "setDecayRate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "synthImplementation", - "type": "address" - } - ], - "name": "setSynthImplementation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ISynthetixSystem", - "name": "synthetix", - "type": "address" - } - ], - "name": "setSynthetix", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "isSupported", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "buyFeedId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "sellFeedId", - "type": "bytes32" - } - ], - "name": "updatePriceData", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "upgradeSynthImpl", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "maxSynthAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "synthAmountCharged", - "type": "uint256" - } - ], - "name": "ExceedsMaxSynthAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "maxUsdAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "usdAmountCharged", - "type": "uint256" - } - ], - "name": "ExceedsMaxUsdAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "current", - "type": "uint256" - } - ], - "name": "InsufficientAmountReceived", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "InvalidMarket", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidPrices", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "synthReturned", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "indexed": false, - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collectedFees", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "referrer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - } - ], - "name": "SynthBought", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountReturned", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "indexed": false, - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collectedFees", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "referrer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - } - ], - "name": "SynthSold", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "usdAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountReceived", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "buy", - "outputs": [ - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "usdAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountReceived", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "buyExactIn", - "outputs": [ - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxUsdAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "buyExactOut", - "outputs": [ - { - "internalType": "uint256", - "name": "usdAmountCharged", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "usdAmount", - "type": "uint256" - } - ], - "name": "quoteBuyExactIn", - "outputs": [ - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - } - ], - "name": "quoteBuyExactOut", - "outputs": [ - { - "internalType": "uint256", - "name": "usdAmountCharged", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - } - ], - "name": "quoteSellExactIn", - "outputs": [ - { - "internalType": "uint256", - "name": "returnAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "usdAmount", - "type": "uint256" - } - ], - "name": "quoteSellExactOut", - "outputs": [ - { - "internalType": "uint256", - "name": "synthToBurn", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minUsdAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "sell", - "outputs": [ - { - "internalType": "uint256", - "name": "usdAmountReceived", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "synthAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountReceived", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "sellExactIn", - "outputs": [ - { - "internalType": "uint256", - "name": "returnAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "usdAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxSynthAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "sellExactOut", - "outputs": [ - { - "internalType": "uint256", - "name": "synthToBurn", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expirationTime", - "type": "uint256" - } - ], - "name": "IneligibleForCancellation", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "actual", - "type": "uint256" - } - ], - "name": "InsufficientSharesAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum Transaction.Type", - "name": "transactionType", - "type": "uint8" - } - ], - "name": "InvalidAsyncTransactionType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "asyncOrderId", - "type": "uint256" - } - ], - "name": "InvalidClaim", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minimumAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "InvalidCommitmentAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "settlementStrategyId", - "type": "uint256" - } - ], - "name": "InvalidSettlementStrategy", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "asyncOrderId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settledAt", - "type": "uint256" - } - ], - "name": "OrderAlreadySettled", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "asyncOrderId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "id", - "type": "uint128" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "enum Transaction.Type", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "amountEscrowed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementStrategyId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minimumSettlementAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settledAt", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "indexed": false, - "internalType": "struct AsyncOrderClaim.Data", - "name": "asyncOrderClaim", - "type": "tuple" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "OrderCancelled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "enum Transaction.Type", - "name": "orderType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountProvided", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "asyncOrderId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "OrderCommitted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "asyncOrderId", - "type": "uint128" - } - ], - "name": "cancelOrder", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "enum Transaction.Type", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "amountProvided", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementStrategyId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minimumSettlementAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "commitOrder", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "id", - "type": "uint128" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "enum Transaction.Type", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "amountEscrowed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementStrategyId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minimumSettlementAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settledAt", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "internalType": "struct AsyncOrderClaim.Data", - "name": "asyncOrderClaim", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "asyncOrderId", - "type": "uint128" - } - ], - "name": "getAsyncOrderClaim", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "id", - "type": "uint128" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "enum Transaction.Type", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "amountEscrowed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementStrategyId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minimumSettlementAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settledAt", - "type": "uint256" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "internalType": "struct AsyncOrderClaim.Data", - "name": "asyncOrderClaim", - "type": "tuple" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum SettlementStrategy.Type", - "name": "strategyType", - "type": "uint8" - } - ], - "name": "InvalidSettlementStrategy", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidVerificationResponse", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minimum", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "actual", - "type": "uint256" - } - ], - "name": "MinimumSettlementAmountNotMet", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "string[]", - "name": "urls", - "type": "string[]" - }, - { - "internalType": "bytes", - "name": "callData", - "type": "bytes" - }, - { - "internalType": "bytes4", - "name": "callbackFunction", - "type": "bytes4" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "OffchainLookup", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "startTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expirationTime", - "type": "uint256" - } - ], - "name": "OutsideSettlementWindow", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint64", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "deviation", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tolerance", - "type": "uint256" - } - ], - "name": "PriceDeviationToleranceExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum SettlementStrategy.Type", - "name": "strategyType", - "type": "uint8" - } - ], - "name": "SettlementStrategyNotFound", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "asyncOrderId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "finalOrderAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "indexed": false, - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collectedFees", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "settler", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "price", - "type": "uint256" - } - ], - "name": "OrderSettled", - "type": "event" - }, - { - "inputs": [], - "name": "PRECISION", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "asyncOrderId", - "type": "uint128" - } - ], - "name": "settleOrder", - "outputs": [ - { - "internalType": "uint256", - "name": "finalOrderAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "result", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "settlePythOrder", - "outputs": [ - { - "internalType": "uint256", - "name": "finalOrderAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - } - ], - "name": "SettlementStrategyAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "SettlementStrategyUpdated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "enum SettlementStrategy.Type", - "name": "strategyType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "settlementDelay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementWindowDuration", - "type": "uint256" - }, - { - "internalType": "address", - "name": "priceVerificationContract", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "feedId", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "url", - "type": "string" - }, - { - "internalType": "uint256", - "name": "settlementReward", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "priceDeviationTolerance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minimumUsdExchangeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxRoundingLoss", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "disabled", - "type": "bool" - } - ], - "internalType": "struct SettlementStrategy.Data", - "name": "strategy", - "type": "tuple" - } - ], - "name": "addSettlementStrategy", - "outputs": [ - { - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - } - ], - "name": "getSettlementStrategy", - "outputs": [ - { - "components": [ - { - "internalType": "enum SettlementStrategy.Type", - "name": "strategyType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "settlementDelay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "settlementWindowDuration", - "type": "uint256" - }, - { - "internalType": "address", - "name": "priceVerificationContract", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "feedId", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "url", - "type": "string" - }, - { - "internalType": "uint256", - "name": "settlementReward", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "priceDeviationTolerance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minimumUsdExchangeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxRoundingLoss", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "disabled", - "type": "bool" - } - ], - "internalType": "struct SettlementStrategy.Data", - "name": "settlementStrategy", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "strategyId", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "setSettlementStrategyEnabled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "FailedTransfer", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "message", - "type": "bytes32" - } - ], - "name": "InvalidCollateralType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "maxWrappableAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "currentSupply", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountToWrap", - "type": "uint256" - } - ], - "name": "WrapperExceedsMaxAmount", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountUnwrapped", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "indexed": false, - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feesCollected", - "type": "uint256" - } - ], - "name": "SynthUnwrapped", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountWrapped", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "indexed": false, - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feesCollected", - "type": "uint256" - } - ], - "name": "SynthWrapped", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "wrapCollateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "maxWrappableAmount", - "type": "uint256" - } - ], - "name": "WrapperSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "wrapCollateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maxWrappableAmount", - "type": "uint256" - } - ], - "name": "setWrapper", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "unwrapAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountReceived", - "type": "uint256" - } - ], - "name": "unwrap", - "outputs": [ - { - "internalType": "uint256", - "name": "returnCollateralAmount", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "wrapAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minAmountReceived", - "type": "uint256" - } - ], - "name": "wrap", - "outputs": [ - { - "internalType": "uint256", - "name": "amountToMint", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "fixedFees", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "utilizationFees", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "skewFees", - "type": "int256" - }, - { - "internalType": "int256", - "name": "wrapperFees", - "type": "int256" - } - ], - "internalType": "struct OrderFees.Data", - "name": "fees", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "InvalidCollateralLeverage", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "invalidFeeCollector", - "type": "address" - } - ], - "name": "InvalidFeeCollectorInterface", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidWrapperFees", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "asyncFixedFee", - "type": "uint256" - } - ], - "name": "AsyncFixedFeeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "atomicFixedFee", - "type": "uint256" - } - ], - "name": "AtomicFixedFeeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "collateralLeverage", - "type": "uint256" - } - ], - "name": "CollateralLeverageSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "feeCollector", - "type": "address" - } - ], - "name": "FeeCollectorSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "skewScale", - "type": "uint256" - } - ], - "name": "MarketSkewScaleSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "utilizationFeeRate", - "type": "uint256" - } - ], - "name": "MarketUtilizationFeesSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "referrer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "sharePercentage", - "type": "uint256" - } - ], - "name": "ReferrerShareUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "transactor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fixedFeeAmount", - "type": "uint256" - } - ], - "name": "TransactorFixedFeeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "synthMarketId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "wrapFee", - "type": "int256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "unwrapFee", - "type": "int256" - } - ], - "name": "WrapperFeesSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "getCollateralLeverage", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralLeverage", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "transactor", - "type": "address" - } - ], - "name": "getCustomTransactorFees", - "outputs": [ - { - "internalType": "uint256", - "name": "fixedFeeAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "getFeeCollector", - "outputs": [ - { - "internalType": "address", - "name": "feeCollector", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "getMarketFees", - "outputs": [ - { - "internalType": "uint256", - "name": "atomicFixedFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "asyncFixedFee", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "wrapFee", - "type": "int256" - }, - { - "internalType": "int256", - "name": "unwrapFee", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "getMarketSkewScale", - "outputs": [ - { - "internalType": "uint256", - "name": "skewScale", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - } - ], - "name": "getMarketUtilizationFees", - "outputs": [ - { - "internalType": "uint256", - "name": "utilizationFeeRate", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - } - ], - "name": "getReferrerShare", - "outputs": [ - { - "internalType": "uint256", - "name": "sharePercentage", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "asyncFixedFee", - "type": "uint256" - } - ], - "name": "setAsyncFixedFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "atomicFixedFee", - "type": "uint256" - } - ], - "name": "setAtomicFixedFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "collateralLeverage", - "type": "uint256" - } - ], - "name": "setCollateralLeverage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "transactor", - "type": "address" - }, - { - "internalType": "uint256", - "name": "fixedFeeAmount", - "type": "uint256" - } - ], - "name": "setCustomTransactorFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "feeCollector", - "type": "address" - } - ], - "name": "setFeeCollector", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "skewScale", - "type": "uint256" - } - ], - "name": "setMarketSkewScale", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "utilizationFeeRate", - "type": "uint256" - } - ], - "name": "setMarketUtilizationFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "int256", - "name": "wrapFee", - "type": "int256" - }, - { - "internalType": "int256", - "name": "unwrapFee", - "type": "int256" - } - ], - "name": "setWrapperFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "synthMarketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "referrer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "sharePercentage", - "type": "uint256" - } - ], - "name": "updateReferrerShare", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "ValueAlreadyInSet", - "type": "error" - }, - { - "inputs": [], - "name": "ValueNotInSet", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "FeatureFlagAllowAllSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "FeatureFlagDeniersReset", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "FeatureFlagDenyAllSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "addToFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getDeniers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowlist", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagDenyAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isFeatureAllowed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "removeFromFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "setDeniers", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "setFeatureFlagAllowAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "setFeatureFlagDenyAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgradeSpotMarketProxy" -} diff --git a/utils/docgen/abis/420-SynthetixCore.json b/utils/docgen/abis/420-SynthetixCore.json deleted file mode 100644 index 7972b5de05..0000000000 --- a/utils/docgen/abis/420-SynthetixCore.json +++ /dev/null @@ -1,4649 +0,0 @@ -{ - "address": "0x76490713314fCEC173f44e99346F54c6e92a8E42", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "ValueAlreadyInSet", - "type": "error" - }, - { - "inputs": [], - "name": "ValueNotInSet", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "FeatureFlagAllowAllSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "FeatureFlagDeniersReset", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "FeatureFlagDenyAllSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "addToFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getDeniers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowlist", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagDenyAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isFeatureAllowed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "removeFromFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "setDeniers", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "setFeatureFlagAllowAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "setFeatureFlagDenyAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "which", - "type": "bytes32" - } - ], - "name": "FeatureUnavailable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "InvalidAccountId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "InvalidPermission", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "origin", - "type": "address" - } - ], - "name": "OnlyAccountTokenProxy", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "PermissionDenied", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "PermissionNotGranted", - "type": "error" - }, - { - "inputs": [], - "name": "PositionOutOfBounds", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "AccountCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "createAccount", - "outputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "requestedAccountId", - "type": "uint128" - } - ], - "name": "createAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountLastInteraction", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountPermissions", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "bytes32[]", - "name": "permissions", - "type": "bytes32[]" - } - ], - "internalType": "struct IAccountModule.AccountPermissions[]", - "name": "accountPerms", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAccountTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "grantPermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "hasPermission", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "notifyAccountTransfer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "renouncePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "revokePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "AccountNotFound", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyDistribution", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "debt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ratio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minRatio", - "type": "uint256" - } - ], - "name": "InsufficientCollateralRatio", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "MarketNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "NotFundedByPool", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint128ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "updatedDebt", - "type": "int256" - } - ], - "name": "DebtAssociated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "associateDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "currentTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requiredTime", - "type": "uint256" - } - ], - "name": "AccountActivityTimeoutPending", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "CollateralDepositDisabled", - "type": "error" - }, - { - "inputs": [], - "name": "CollateralNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "FailedTransfer", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "InsufficientAccountCollateral", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint64", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - } - ], - "name": "PrecisionLost", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "CollateralLockCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "CollateralLockExpired", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Withdrawn", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "offset", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "cleanExpiredLocks", - "outputs": [ - { - "internalType": "uint256", - "name": "cleared", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "createLock", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getAccountAvailableCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getAccountCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "totalDeposited", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalAssigned", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalLocked", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "offset", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "getLocks", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "amountD18", - "type": "uint128" - }, - { - "internalType": "uint64", - "name": "lockExpirationTime", - "type": "uint64" - } - ], - "internalType": "struct CollateralLock.Data[]", - "name": "locks", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct CollateralConfiguration.Data", - "name": "config", - "type": "tuple" - } - ], - "name": "CollateralConfigured", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data", - "name": "config", - "type": "tuple" - } - ], - "name": "configureCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getCollateralConfiguration", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "hideDisabled", - "type": "bool" - } - ], - "name": "getCollateralConfigurations", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getCollateralPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "currentDebt", - "type": "int256" - } - ], - "name": "InsufficientDebt", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "PoolNotFound", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "name": "IssuanceFeePaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "UsdBurned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "UsdMinted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnUsd", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mintUsd", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "CannotScaleEmptyMapping", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "debt", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "currentCRatio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "cratio", - "type": "uint256" - } - ], - "name": "IneligibleForLiquidation", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientMappedAmount", - "type": "error" - }, - { - "inputs": [], - "name": "MustBeVaultLiquidated", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt128ToUint128", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Liquidation", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "VaultLiquidation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "isPositionLiquidatable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "isVaultLiquidatable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - } - ], - "name": "liquidate", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxUsd", - "type": "uint256" - } - ], - "name": "liquidateVault", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmountToDeposit", - "type": "uint256" - } - ], - "name": "InsufficientMarketCollateralDepositable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmountToWithdraw", - "type": "uint256" - } - ], - "name": "InsufficientMarketCollateralWithdrawable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketCollateralDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketCollateralWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "systemAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "MaximumMarketCollateralConfigured", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "configureMaximumMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "depositMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getMarketCollateralAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmountD18", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketCollateralValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getMaximumMarketCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "withdrawMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "IncorrectMarketInterface", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "NotEnoughLiquidity", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "name": "MarketSystemFeePaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketUsdDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketUsdWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "SetMarketMinLiquidityRatio", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "minDelegateTime", - "type": "uint32" - } - ], - "name": "SetMinDelegateTime", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "depositMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxIter", - "type": "uint256" - } - ], - "name": "distributeDebtToPools", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketDebtPerShare", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "getMarketFees", - "outputs": [ - { - "internalType": "uint256", - "name": "depositFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawFeeAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketMinDelegateTime", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketNetIssuance", - "outputs": [ - { - "internalType": "int128", - "name": "", - "type": "int128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketReportedDebt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketTotalDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMinLiquidityRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getOracleManager", - "outputs": [ - { - "internalType": "contract IOracleManager", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUsdToken", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getWithdrawableMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "isMarketCapacityLocked", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "registerMarket", - "outputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "minDelegateTime", - "type": "uint32" - } - ], - "name": "setMarketMinDelegateTime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "setMinLiquidityRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdrawMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "RecursiveMulticall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PoolApprovedAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PoolApprovedRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PreferredPoolSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "addApprovedPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getApprovedPools", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPreferredPool", - "outputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "removeApprovedPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "setPreferredPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketId", - "type": "uint256" - } - ], - "name": "CapacityLocked", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "timeRemaining", - "type": "uint32" - } - ], - "name": "MinDelegationTimeoutPending", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "PoolAlreadyExists", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "indexed": false, - "internalType": "struct MarketConfiguration.Data[]", - "name": "markets", - "type": "tuple[]" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolConfigurationSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolNameUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolNominationRenounced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolNominationRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "nominatedOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolOwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolOwnershipAccepted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "SetMinLiquidityRatio", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "acceptPoolOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "requestedPoolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "createPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getMinLiquidityRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getNominatedPoolOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolConfiguration", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "internalType": "struct MarketConfiguration.Data[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolName", - "outputs": [ - { - "internalType": "string", - "name": "poolName", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nominatedOwner", - "type": "address" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "nominatePoolOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "rebalancePool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "renouncePoolNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "revokePoolNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "setMinLiquidityRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "internalType": "struct MarketConfiguration.Data[]", - "name": "newMarketConfigurations", - "type": "tuple[]" - } - ], - "name": "setPoolConfiguration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "setPoolName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint32", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint32ToInt32", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint64ToInt64", - "type": "error" - }, - { - "inputs": [], - "name": "RewardDistributorNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardUnavailable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "distributor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "RewardsClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "distributor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "RewardsDistributed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardsDistributorRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardsDistributorRemoved", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "claimRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "start", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "duration", - "type": "uint32" - } - ], - "name": "distributeRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "getRewardRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "registerRewardsDistributor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "removeRewardsDistributor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "updateRewards", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "oracleManagerAddress", - "type": "address" - } - ], - "name": "configureOracleManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfig", - "outputs": [ - { - "internalType": "bytes32", - "name": "v", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfigAddress", - "outputs": [ - { - "internalType": "address", - "name": "v", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfigUint", - "outputs": [ - { - "internalType": "uint256", - "name": "v", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ccipSend", - "type": "address" - }, - { - "internalType": "address", - "name": "ccipReceive", - "type": "address" - }, - { - "internalType": "address", - "name": "ccipTokenPool", - "type": "address" - } - ], - "name": "registerCcip", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "v", - "type": "bytes32" - } - ], - "name": "setConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minDelegation", - "type": "uint256" - } - ], - "name": "InsufficientDelegation", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidCollateralAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - } - ], - "name": "InvalidLeverage", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "DelegationUpdated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "newCollateralAmountD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - } - ], - "name": "delegateCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPosition", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "debt", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "collateralizationRatio", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionCollateralRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultCollateralRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgrade_core_proxy" -} diff --git a/utils/docgen/abis/420-snxAccountNFT.json b/utils/docgen/abis/420-snxAccountNFT.json deleted file mode 100644 index b1d3dc1756..0000000000 --- a/utils/docgen/abis/420-snxAccountNFT.json +++ /dev/null @@ -1,815 +0,0 @@ -{ - "address": "0x1b791d05E437C78039424749243F5A79E747525e", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "CannotSelfApprove", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requestedIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "IndexOverrun", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidTransferRecipient", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenAlreadyMinted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenDoesNotExist", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeMint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "setAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "setBaseTokenURI", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenOfOwnerByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "tokenURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.init_account" -} diff --git a/utils/docgen/abis/420-snxUSDToken.json b/utils/docgen/abis/420-snxUSDToken.json deleted file mode 100644 index 47fbdb58b5..0000000000 --- a/utils/docgen/abis/420-snxUSDToken.json +++ /dev/null @@ -1,847 +0,0 @@ -{ - "address": "0xe487Ad4291019b33e2230F8E2FB1fb6490325260", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnWithAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "tokenDecimals", - "type": "uint8" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "setAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "destChainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferCrossChain", - "outputs": [ - { - "internalType": "uint256", - "name": "feesPaid", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.init_usd" -} diff --git a/utils/docgen/abis/5-OracleManager.json b/utils/docgen/abis/5-OracleManager.json deleted file mode 100644 index 92a12c9cea..0000000000 --- a/utils/docgen/abis/5-OracleManager.json +++ /dev/null @@ -1,495 +0,0 @@ -{ - "address": "0x12aE0D5CD26f212bFE242DA78139d463019f7a73", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "deviation", - "type": "int256" - } - ], - "name": "DeviationToleranceExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInputPrice", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "internalType": "struct NodeDefinition.Data", - "name": "nodeType", - "type": "tuple" - } - ], - "name": "InvalidNodeDefinition", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "price", - "type": "int256" - } - ], - "name": "InvalidPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "NodeNotRegistered", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt56ToInt24", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint160", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint56ToInt56", - "type": "error" - }, - { - "inputs": [], - "name": "StalenessToleranceExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "UnprocessableNode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum ReducerNode.Operations", - "name": "operation", - "type": "uint8" - } - ], - "name": "UnsupportedOperation", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "NodeRegistered", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "getNode", - "outputs": [ - { - "components": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "internalType": "struct NodeDefinition.Data", - "name": "node", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "getNodeId", - "outputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "process", - "outputs": [ - { - "components": [ - { - "internalType": "int256", - "name": "price", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "__slotAvailableForFutureUse1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "__slotAvailableForFutureUse2", - "type": "uint256" - } - ], - "internalType": "struct NodeOutput.Data", - "name": "node", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "registerNode", - "outputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgrade_proxy" -} diff --git a/utils/docgen/abis/5-SynthetixCore.json b/utils/docgen/abis/5-SynthetixCore.json deleted file mode 100644 index 7972b5de05..0000000000 --- a/utils/docgen/abis/5-SynthetixCore.json +++ /dev/null @@ -1,4649 +0,0 @@ -{ - "address": "0x76490713314fCEC173f44e99346F54c6e92a8E42", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "ValueAlreadyInSet", - "type": "error" - }, - { - "inputs": [], - "name": "ValueNotInSet", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "FeatureFlagAllowAllSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "FeatureFlagDeniersReset", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "FeatureFlagDenyAllSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "addToFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getDeniers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowlist", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagDenyAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isFeatureAllowed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "removeFromFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "setDeniers", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "setFeatureFlagAllowAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "setFeatureFlagDenyAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "which", - "type": "bytes32" - } - ], - "name": "FeatureUnavailable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "InvalidAccountId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "InvalidPermission", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "origin", - "type": "address" - } - ], - "name": "OnlyAccountTokenProxy", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "PermissionDenied", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "PermissionNotGranted", - "type": "error" - }, - { - "inputs": [], - "name": "PositionOutOfBounds", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "AccountCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "createAccount", - "outputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "requestedAccountId", - "type": "uint128" - } - ], - "name": "createAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountLastInteraction", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountPermissions", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "bytes32[]", - "name": "permissions", - "type": "bytes32[]" - } - ], - "internalType": "struct IAccountModule.AccountPermissions[]", - "name": "accountPerms", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAccountTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "grantPermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "hasPermission", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "notifyAccountTransfer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "renouncePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "revokePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "AccountNotFound", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyDistribution", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "debt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ratio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minRatio", - "type": "uint256" - } - ], - "name": "InsufficientCollateralRatio", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "MarketNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "NotFundedByPool", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint128ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "updatedDebt", - "type": "int256" - } - ], - "name": "DebtAssociated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "associateDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "currentTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requiredTime", - "type": "uint256" - } - ], - "name": "AccountActivityTimeoutPending", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "CollateralDepositDisabled", - "type": "error" - }, - { - "inputs": [], - "name": "CollateralNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "FailedTransfer", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "InsufficientAccountCollateral", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint64", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - } - ], - "name": "PrecisionLost", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "CollateralLockCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "CollateralLockExpired", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Withdrawn", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "offset", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "cleanExpiredLocks", - "outputs": [ - { - "internalType": "uint256", - "name": "cleared", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "createLock", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getAccountAvailableCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getAccountCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "totalDeposited", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalAssigned", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalLocked", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "offset", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "getLocks", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "amountD18", - "type": "uint128" - }, - { - "internalType": "uint64", - "name": "lockExpirationTime", - "type": "uint64" - } - ], - "internalType": "struct CollateralLock.Data[]", - "name": "locks", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct CollateralConfiguration.Data", - "name": "config", - "type": "tuple" - } - ], - "name": "CollateralConfigured", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data", - "name": "config", - "type": "tuple" - } - ], - "name": "configureCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getCollateralConfiguration", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "hideDisabled", - "type": "bool" - } - ], - "name": "getCollateralConfigurations", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getCollateralPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "currentDebt", - "type": "int256" - } - ], - "name": "InsufficientDebt", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "PoolNotFound", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "name": "IssuanceFeePaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "UsdBurned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "UsdMinted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnUsd", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mintUsd", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "CannotScaleEmptyMapping", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "debt", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "currentCRatio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "cratio", - "type": "uint256" - } - ], - "name": "IneligibleForLiquidation", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientMappedAmount", - "type": "error" - }, - { - "inputs": [], - "name": "MustBeVaultLiquidated", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt128ToUint128", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Liquidation", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "VaultLiquidation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "isPositionLiquidatable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "isVaultLiquidatable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - } - ], - "name": "liquidate", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxUsd", - "type": "uint256" - } - ], - "name": "liquidateVault", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmountToDeposit", - "type": "uint256" - } - ], - "name": "InsufficientMarketCollateralDepositable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmountToWithdraw", - "type": "uint256" - } - ], - "name": "InsufficientMarketCollateralWithdrawable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketCollateralDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketCollateralWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "systemAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "MaximumMarketCollateralConfigured", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "configureMaximumMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "depositMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getMarketCollateralAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmountD18", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketCollateralValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getMaximumMarketCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "withdrawMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "IncorrectMarketInterface", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "NotEnoughLiquidity", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "name": "MarketSystemFeePaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketUsdDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketUsdWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "SetMarketMinLiquidityRatio", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "minDelegateTime", - "type": "uint32" - } - ], - "name": "SetMinDelegateTime", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "depositMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxIter", - "type": "uint256" - } - ], - "name": "distributeDebtToPools", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketDebtPerShare", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "getMarketFees", - "outputs": [ - { - "internalType": "uint256", - "name": "depositFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawFeeAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketMinDelegateTime", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketNetIssuance", - "outputs": [ - { - "internalType": "int128", - "name": "", - "type": "int128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketReportedDebt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketTotalDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMinLiquidityRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getOracleManager", - "outputs": [ - { - "internalType": "contract IOracleManager", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUsdToken", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getWithdrawableMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "isMarketCapacityLocked", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "registerMarket", - "outputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "minDelegateTime", - "type": "uint32" - } - ], - "name": "setMarketMinDelegateTime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "setMinLiquidityRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdrawMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "RecursiveMulticall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PoolApprovedAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PoolApprovedRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PreferredPoolSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "addApprovedPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getApprovedPools", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPreferredPool", - "outputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "removeApprovedPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "setPreferredPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketId", - "type": "uint256" - } - ], - "name": "CapacityLocked", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "timeRemaining", - "type": "uint32" - } - ], - "name": "MinDelegationTimeoutPending", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "PoolAlreadyExists", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "indexed": false, - "internalType": "struct MarketConfiguration.Data[]", - "name": "markets", - "type": "tuple[]" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolConfigurationSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolNameUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolNominationRenounced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolNominationRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "nominatedOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolOwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolOwnershipAccepted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "SetMinLiquidityRatio", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "acceptPoolOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "requestedPoolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "createPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getMinLiquidityRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getNominatedPoolOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolConfiguration", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "internalType": "struct MarketConfiguration.Data[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolName", - "outputs": [ - { - "internalType": "string", - "name": "poolName", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nominatedOwner", - "type": "address" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "nominatePoolOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "rebalancePool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "renouncePoolNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "revokePoolNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "setMinLiquidityRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "internalType": "struct MarketConfiguration.Data[]", - "name": "newMarketConfigurations", - "type": "tuple[]" - } - ], - "name": "setPoolConfiguration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "setPoolName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint32", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint32ToInt32", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint64ToInt64", - "type": "error" - }, - { - "inputs": [], - "name": "RewardDistributorNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardUnavailable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "distributor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "RewardsClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "distributor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "RewardsDistributed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardsDistributorRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardsDistributorRemoved", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "claimRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "start", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "duration", - "type": "uint32" - } - ], - "name": "distributeRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "getRewardRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "registerRewardsDistributor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "removeRewardsDistributor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "updateRewards", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "oracleManagerAddress", - "type": "address" - } - ], - "name": "configureOracleManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfig", - "outputs": [ - { - "internalType": "bytes32", - "name": "v", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfigAddress", - "outputs": [ - { - "internalType": "address", - "name": "v", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfigUint", - "outputs": [ - { - "internalType": "uint256", - "name": "v", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ccipSend", - "type": "address" - }, - { - "internalType": "address", - "name": "ccipReceive", - "type": "address" - }, - { - "internalType": "address", - "name": "ccipTokenPool", - "type": "address" - } - ], - "name": "registerCcip", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "v", - "type": "bytes32" - } - ], - "name": "setConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minDelegation", - "type": "uint256" - } - ], - "name": "InsufficientDelegation", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidCollateralAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - } - ], - "name": "InvalidLeverage", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "DelegationUpdated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "newCollateralAmountD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - } - ], - "name": "delegateCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPosition", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "debt", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "collateralizationRatio", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionCollateralRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultCollateralRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgrade_core_proxy" -} diff --git a/utils/docgen/abis/5-snxAccountNFT.json b/utils/docgen/abis/5-snxAccountNFT.json deleted file mode 100644 index b1d3dc1756..0000000000 --- a/utils/docgen/abis/5-snxAccountNFT.json +++ /dev/null @@ -1,815 +0,0 @@ -{ - "address": "0x1b791d05E437C78039424749243F5A79E747525e", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "CannotSelfApprove", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requestedIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "IndexOverrun", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidTransferRecipient", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenAlreadyMinted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenDoesNotExist", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeMint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "setAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "setBaseTokenURI", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenOfOwnerByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "tokenURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.init_account" -} diff --git a/utils/docgen/abis/5-snxUSDToken.json b/utils/docgen/abis/5-snxUSDToken.json deleted file mode 100644 index 47fbdb58b5..0000000000 --- a/utils/docgen/abis/5-snxUSDToken.json +++ /dev/null @@ -1,847 +0,0 @@ -{ - "address": "0xe487Ad4291019b33e2230F8E2FB1fb6490325260", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnWithAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "tokenDecimals", - "type": "uint8" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "setAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "destChainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferCrossChain", - "outputs": [ - { - "internalType": "uint256", - "name": "feesPaid", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.init_usd" -} diff --git a/utils/docgen/abis/84531-OracleManager.json b/utils/docgen/abis/84531-OracleManager.json deleted file mode 100644 index 92a12c9cea..0000000000 --- a/utils/docgen/abis/84531-OracleManager.json +++ /dev/null @@ -1,495 +0,0 @@ -{ - "address": "0x12aE0D5CD26f212bFE242DA78139d463019f7a73", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "deviation", - "type": "int256" - } - ], - "name": "DeviationToleranceExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInputPrice", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "internalType": "struct NodeDefinition.Data", - "name": "nodeType", - "type": "tuple" - } - ], - "name": "InvalidNodeDefinition", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "price", - "type": "int256" - } - ], - "name": "InvalidPrice", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "NodeNotRegistered", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt56ToInt24", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint160", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint56ToInt56", - "type": "error" - }, - { - "inputs": [], - "name": "StalenessToleranceExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "UnprocessableNode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum ReducerNode.Operations", - "name": "operation", - "type": "uint8" - } - ], - "name": "UnsupportedOperation", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "NodeRegistered", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "getNode", - "outputs": [ - { - "components": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "internalType": "struct NodeDefinition.Data", - "name": "node", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "getNodeId", - "outputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "name": "process", - "outputs": [ - { - "components": [ - { - "internalType": "int256", - "name": "price", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "__slotAvailableForFutureUse1", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "__slotAvailableForFutureUse2", - "type": "uint256" - } - ], - "internalType": "struct NodeOutput.Data", - "name": "node", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum NodeDefinition.NodeType", - "name": "nodeType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "parameters", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "parents", - "type": "bytes32[]" - } - ], - "name": "registerNode", - "outputs": [ - { - "internalType": "bytes32", - "name": "nodeId", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgrade_proxy" -} diff --git a/utils/docgen/abis/84531-SynthetixCore.json b/utils/docgen/abis/84531-SynthetixCore.json deleted file mode 100644 index 7972b5de05..0000000000 --- a/utils/docgen/abis/84531-SynthetixCore.json +++ /dev/null @@ -1,4649 +0,0 @@ -{ - "address": "0x76490713314fCEC173f44e99346F54c6e92a8E42", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "ValueAlreadyInSet", - "type": "error" - }, - { - "inputs": [], - "name": "ValueNotInSet", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "FeatureFlagAllowAllSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "FeatureFlagAllowlistRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "FeatureFlagDeniersReset", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "FeatureFlagDenyAllSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "addToFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getDeniers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagAllowlist", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - } - ], - "name": "getFeatureFlagDenyAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isFeatureAllowed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "removeFromFeatureFlagAllowlist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "address[]", - "name": "deniers", - "type": "address[]" - } - ], - "name": "setDeniers", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "allowAll", - "type": "bool" - } - ], - "name": "setFeatureFlagAllowAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "feature", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "denyAll", - "type": "bool" - } - ], - "name": "setFeatureFlagDenyAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "which", - "type": "bytes32" - } - ], - "name": "FeatureUnavailable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "InvalidAccountId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "InvalidPermission", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "origin", - "type": "address" - } - ], - "name": "OnlyAccountTokenProxy", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "PermissionDenied", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "PermissionNotGranted", - "type": "error" - }, - { - "inputs": [], - "name": "PositionOutOfBounds", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "AccountCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PermissionRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "createAccount", - "outputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "requestedAccountId", - "type": "uint128" - } - ], - "name": "createAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountLastInteraction", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "getAccountPermissions", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "bytes32[]", - "name": "permissions", - "type": "bytes32[]" - } - ], - "internalType": "struct IAccountModule.AccountPermissions[]", - "name": "accountPerms", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAccountTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "grantPermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "hasPermission", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "notifyAccountTransfer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - } - ], - "name": "renouncePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "bytes32", - "name": "permission", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "revokePermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "AccountNotFound", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyDistribution", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "debt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ratio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minRatio", - "type": "uint256" - } - ], - "name": "InsufficientCollateralRatio", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "MarketNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "NotFundedByPool", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt256ToUint256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint128ToInt128", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToInt256", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "updatedDebt", - "type": "int256" - } - ], - "name": "DebtAssociated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "associateDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "currentTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requiredTime", - "type": "uint256" - } - ], - "name": "AccountActivityTimeoutPending", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "CollateralDepositDisabled", - "type": "error" - }, - { - "inputs": [], - "name": "CollateralNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "FailedTransfer", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "InsufficientAccountCollateral", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint64", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - } - ], - "name": "PrecisionLost", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "CollateralLockCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "CollateralLockExpired", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Withdrawn", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "offset", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "cleanExpiredLocks", - "outputs": [ - { - "internalType": "uint256", - "name": "cleared", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "expireTimestamp", - "type": "uint64" - } - ], - "name": "createLock", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getAccountAvailableCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getAccountCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "totalDeposited", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalAssigned", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "totalLocked", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "offset", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "name": "getLocks", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "amountD18", - "type": "uint128" - }, - { - "internalType": "uint64", - "name": "lockExpirationTime", - "type": "uint64" - } - ], - "internalType": "struct CollateralLock.Data[]", - "name": "locks", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct CollateralConfiguration.Data", - "name": "config", - "type": "tuple" - } - ], - "name": "CollateralConfigured", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data", - "name": "config", - "type": "tuple" - } - ], - "name": "configureCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getCollateralConfiguration", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "hideDisabled", - "type": "bool" - } - ], - "name": "getCollateralConfigurations", - "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "depositingEnabled", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "issuanceRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRatioD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationRewardD18", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "oracleNodeId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minDelegationD18", - "type": "uint256" - } - ], - "internalType": "struct CollateralConfiguration.Data[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getCollateralPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "int256", - "name": "currentDebt", - "type": "int256" - } - ], - "name": "InsufficientDebt", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "PoolNotFound", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "name": "IssuanceFeePaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "UsdBurned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "UsdMinted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnUsd", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mintUsd", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "CannotScaleEmptyMapping", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "debt", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "currentCRatio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "cratio", - "type": "uint256" - } - ], - "name": "IneligibleForLiquidation", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientMappedAmount", - "type": "error" - }, - { - "inputs": [], - "name": "MustBeVaultLiquidated", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowInt128ToUint128", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Liquidation", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "VaultLiquidation", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "isPositionLiquidatable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "isVaultLiquidatable", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - } - ], - "name": "liquidate", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "liquidateAsAccountId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxUsd", - "type": "uint256" - } - ], - "name": "liquidateVault", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "debtLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralLiquidated", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountRewarded", - "type": "uint256" - } - ], - "internalType": "struct ILiquidationModule.LiquidationData", - "name": "liquidationData", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmountToDeposit", - "type": "uint256" - } - ], - "name": "InsufficientMarketCollateralDepositable", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmountToWithdraw", - "type": "uint256" - } - ], - "name": "InsufficientMarketCollateralWithdrawable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketCollateralDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketCollateralWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "systemAmount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "MaximumMarketCollateralConfigured", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "configureMaximumMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "depositMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getMarketCollateralAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmountD18", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketCollateralValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getMaximumMarketCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenAmount", - "type": "uint256" - } - ], - "name": "withdrawMarketCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "IncorrectMarketInterface", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "NotEnoughLiquidity", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "MarketRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "name": "MarketSystemFeePaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketUsdDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketUsdWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "SetMarketMinLiquidityRatio", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "minDelegateTime", - "type": "uint32" - } - ], - "name": "SetMinDelegateTime", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "depositMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "maxIter", - "type": "uint256" - } - ], - "name": "distributeDebtToPools", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketDebtPerShare", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "getMarketFees", - "outputs": [ - { - "internalType": "uint256", - "name": "depositFeeAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawFeeAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketMinDelegateTime", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketNetIssuance", - "outputs": [ - { - "internalType": "int128", - "name": "", - "type": "int128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketReportedDebt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMarketTotalDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getMinLiquidityRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getOracleManager", - "outputs": [ - { - "internalType": "contract IOracleManager", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUsdToken", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "getWithdrawableMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "name": "isMarketCapacityLocked", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "registerMarket", - "outputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "minDelegateTime", - "type": "uint32" - } - ], - "name": "setMarketMinDelegateTime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "setMinLiquidityRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdrawMarketUsd", - "outputs": [ - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "RecursiveMulticall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PoolApprovedAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PoolApprovedRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "poolId", - "type": "uint256" - } - ], - "name": "PreferredPoolSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "addApprovedPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getApprovedPools", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPreferredPool", - "outputs": [ - { - "internalType": "uint128", - "name": "", - "type": "uint128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "removeApprovedPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "setPreferredPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketId", - "type": "uint256" - } - ], - "name": "CapacityLocked", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "timeRemaining", - "type": "uint32" - } - ], - "name": "MinDelegationTimeoutPending", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "PoolAlreadyExists", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "indexed": false, - "internalType": "struct MarketConfiguration.Data[]", - "name": "markets", - "type": "tuple[]" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolConfigurationSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "PoolNameUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolNominationRenounced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolNominationRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "nominatedOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolOwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "PoolOwnershipAccepted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "SetMinLiquidityRatio", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "acceptPoolOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "requestedPoolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "createPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getMinLiquidityRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getNominatedPoolOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolConfiguration", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "internalType": "struct MarketConfiguration.Data[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolName", - "outputs": [ - { - "internalType": "string", - "name": "poolName", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "getPoolOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nominatedOwner", - "type": "address" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "nominatePoolOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "rebalancePool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "renouncePoolNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - } - ], - "name": "revokePoolNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minLiquidityRatio", - "type": "uint256" - } - ], - "name": "setMinLiquidityRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "components": [ - { - "internalType": "uint128", - "name": "marketId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "weightD18", - "type": "uint128" - }, - { - "internalType": "int128", - "name": "maxDebtShareValueD18", - "type": "int128" - } - ], - "internalType": "struct MarketConfiguration.Data[]", - "name": "newMarketConfigurations", - "type": "tuple[]" - } - ], - "name": "setPoolConfiguration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "setPoolName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint32", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint32ToInt32", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint64ToInt64", - "type": "error" - }, - { - "inputs": [], - "name": "RewardDistributorNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardUnavailable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "distributor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "RewardsClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "distributor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "RewardsDistributed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardsDistributorRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "RewardsDistributorRemoved", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "claimRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "start", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "duration", - "type": "uint32" - } - ], - "name": "distributeRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "getRewardRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "registerRewardsDistributor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "address", - "name": "distributor", - "type": "address" - } - ], - "name": "removeRewardsDistributor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - } - ], - "name": "updateRewards", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "oracleManagerAddress", - "type": "address" - } - ], - "name": "configureOracleManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfig", - "outputs": [ - { - "internalType": "bytes32", - "name": "v", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfigAddress", - "outputs": [ - { - "internalType": "address", - "name": "v", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - } - ], - "name": "getConfigUint", - "outputs": [ - { - "internalType": "uint256", - "name": "v", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ccipSend", - "type": "address" - }, - { - "internalType": "address", - "name": "ccipReceive", - "type": "address" - }, - { - "internalType": "address", - "name": "ccipTokenPool", - "type": "address" - } - ], - "name": "registerCcip", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "k", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "v", - "type": "bytes32" - } - ], - "name": "setConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minDelegation", - "type": "uint256" - } - ], - "name": "InsufficientDelegation", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidCollateralAmount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - } - ], - "name": "InvalidLeverage", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "indexed": true, - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "DelegationUpdated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - }, - { - "internalType": "uint256", - "name": "newCollateralAmountD18", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "leverage", - "type": "uint256" - } - ], - "name": "delegateCollateral", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPosition", - "outputs": [ - { - "internalType": "uint256", - "name": "collateralAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralValue", - "type": "uint256" - }, - { - "internalType": "int256", - "name": "debt", - "type": "int256" - }, - { - "internalType": "uint256", - "name": "collateralizationRatio", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionCollateralRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "accountId", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getPositionDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultCollateralRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint128", - "name": "poolId", - "type": "uint128" - }, - { - "internalType": "address", - "name": "collateralType", - "type": "address" - } - ], - "name": "getVaultDebt", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.upgrade_core_proxy" -} diff --git a/utils/docgen/abis/84531-snxAccountNFT.json b/utils/docgen/abis/84531-snxAccountNFT.json deleted file mode 100644 index b1d3dc1756..0000000000 --- a/utils/docgen/abis/84531-snxAccountNFT.json +++ /dev/null @@ -1,815 +0,0 @@ -{ - "address": "0x1b791d05E437C78039424749243F5A79E747525e", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "CannotSelfApprove", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requestedIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "IndexOverrun", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "InvalidTransferRecipient", - "type": "error" - }, - { - "inputs": [], - "name": "OverflowUint256ToUint128", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenAlreadyMinted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "TokenDoesNotExist", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "approved", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeMint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "setAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "setBaseTokenURI", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenOfOwnerByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "tokenURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.init_account" -} diff --git a/utils/docgen/abis/84531-snxUSDToken.json b/utils/docgen/abis/84531-snxUSDToken.json deleted file mode 100644 index 47fbdb58b5..0000000000 --- a/utils/docgen/abis/84531-snxUSDToken.json +++ /dev/null @@ -1,847 +0,0 @@ -{ - "address": "0xe487Ad4291019b33e2230F8E2FB1fb6490325260", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ImplementationIsSterile", - "type": "error" - }, - { - "inputs": [], - "name": "NoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contr", - "type": "address" - } - ], - "name": "NotAContract", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "NotNominated", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "UpgradeSimulationFailed", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "self", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newNominatedOwner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceNomination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "simulateUpgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "MismatchAssociatedSystemKind", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "MissingAssociatedSystem", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "proxy", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "AssociatedSystemSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "getAssociatedSystem", - "outputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeNft", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "address", - "name": "impl", - "type": "address" - } - ], - "name": "initOrUpgradeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "endpoint", - "type": "address" - } - ], - "name": "registerUnmanagedSystem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "AlreadyInitialized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "required", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "existing", - "type": "uint256" - } - ], - "name": "InsufficientBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "parameter", - "type": "string" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidParameter", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnWithAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "tokenName", - "type": "string" - }, - { - "internalType": "string", - "name": "tokenSymbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "tokenDecimals", - "type": "uint8" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "setAllowance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "destChainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferCrossChain", - "outputs": [ - { - "internalType": "uint256", - "name": "feesPaid", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "deployTxnHash": "", - "sourceName": "", - "contractName": "", - "deployedOn": "invoke.init_usd" -} diff --git a/utils/docgen/addresses-+-abis.md b/utils/docgen/addresses-+-abis.md new file mode 100644 index 0000000000..40bf1601ee --- /dev/null +++ b/utils/docgen/addresses-+-abis.md @@ -0,0 +1,9 @@ +# Addresses + ABIs + +See the [synthetix-deployments](https://github.com/synthetixio/synthetix-deployments) GitOps repository for more information. + +To download the Addresses + ABIs for Synthetix via the command line, you can run the following command: + +```bash +npx @usecannon/cli inspect synthetix-omnibus --write-deployments ./deployments --chain-id +``` diff --git a/utils/docgen/docgen-abis.sh b/utils/docgen/docgen-abis.sh new file mode 100755 index 0000000000..c26ebaaca2 --- /dev/null +++ b/utils/docgen/docgen-abis.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +set -e + +echo "Docgen ABIs..." + +ROOT=$(yarn workspace synthetix-v3 exec pwd) +OUT="$ROOT/docs/addresses-+-abis.md" +mkdir -p $ROOT/docs +rm -rf $ROOT/docs/abis +rm -rf $OUT +touch $OUT + +cat "./addresses-+-abis.md" > $OUT + +generate () { + _chainId=$1 + echo "" + echo "-----------------------------" + echo "Generating ABIs for $_chainId" + echo "-----------------------------" + echo "> cannon inspect synthetix-omnibus:latest --chain-id $_chainId --json > ./deployments/$_chainId.json" + mkdir -p ./deployments + yarn cannon inspect synthetix-omnibus:latest --chain-id $_chainId --json > ./deployments/$_chainId.json + node ./abis.js $_chainId ./deployments/$_chainId.json + cat ./docs/$_chainId.md >> $OUT + echo "" >> $OUT + echo "-----------------------------" + echo "OK Generating ABIs for $_chainId" + echo "-----------------------------" + echo "" + echo "" +} + +generate 1 +generate 5 +generate 11155111 +generate 10 +generate 420 +generate 80001 +generate 84531 + +cp -r ./abis $ROOT/docs/abis + +echo "OK Generating ABIs" diff --git a/utils/docgen/docgen:contracts.sh b/utils/docgen/docgen-contracts.sh similarity index 55% rename from utils/docgen/docgen:contracts.sh rename to utils/docgen/docgen-contracts.sh index f694cde638..f468551e22 100755 --- a/utils/docgen/docgen:contracts.sh +++ b/utils/docgen/docgen-contracts.sh @@ -1,45 +1,40 @@ #!/bin/bash +set -e + +echo "Docgen contracts..." + ROOT=$(yarn workspace synthetix-v3 exec pwd) -OUT="$ROOT/docs/Contracts.md" +OUT="$ROOT/docs/smart-contracts.md" mkdir -p $ROOT/docs +rm -rf $OUT touch $OUT echo "# Smart Contracts" > $OUT echo "" >> $OUT -echo "- [Synthetix Core](#synthetix-core)" >> $OUT -echo "- [Spot Market](#spot-market)" >> $OUT -echo "- [Perps Market](#perps-market)" >> $OUT -echo "- [Governance](#governance)" >> $OUT -echo "- [Oracle Manager](#oracle-manager)" >> $OUT -echo "" >> $OUT - - echo "## Synthetix Core" >> $OUT echo "" >> $OUT cat $ROOT/protocol/synthetix/docs/index.md >> $OUT echo "## Spot Market" >> $OUT echo "" >> $OUT -echo "- [Back to TOC](#smart-contracts)" >> $OUT -echo "" >> $OUT cat $ROOT/markets/spot-market/docs/index.md >> $OUT echo "## Perps Market" >> $OUT echo "" >> $OUT -echo "- [Back to TOC](#smart-contracts)" >> $OUT -echo "" >> $OUT cat $ROOT/markets/perps-market/docs/index.md >> $OUT -echo "## Governance" >> $OUT +echo "## Legacy Market" >> $OUT echo "" >> $OUT -echo "- [Back to TOC](#smart-contracts)" >> $OUT +cat $ROOT/markets/legacy-market/docs/index.md >> $OUT + +echo "## Governance" >> $OUT echo "" >> $OUT cat $ROOT/protocol/governance/docs/index.md >> $OUT echo "## Oracle Manager" >> $OUT echo "" >> $OUT -echo "- [Back to TOC](#smart-contracts)" >> $OUT -echo "" >> $OUT cat $ROOT/protocol/oracle-manager/docs/index.md >> $OUT + +echo "OK Docgen contracts" diff --git a/utils/docgen/package.json b/utils/docgen/package.json index a9d1066e79..8ca9f7e424 100644 --- a/utils/docgen/package.json +++ b/utils/docgen/package.json @@ -8,7 +8,8 @@ "types": "index.d.ts", "scripts": { "abis": "node ./abis.js", - "docgen:contracts": "./docgen:contracts.sh" + "docgen:abis": "./docgen-abis.sh", + "docgen:contracts": "./docgen-contracts.sh" }, "devDependencies": { "@usecannon/cli": "^2.4.21", @@ -16,5 +17,10 @@ "prettier": "^2.8.8", "solidity-ast": "0.4.46", "solidity-docgen": "0.6.0-beta.35" + }, + "depcheck": { + "ignoreMatches": [ + "@usecannon/cli" + ] } }