diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 5d1836a0a..000000000 --- a/.dockerignore +++ /dev/null @@ -1,56 +0,0 @@ -node_modules -.env -coverage -coverage.json -typechain - -#Hardhat files -cache -artifacts - -#Compound -allFiredEvents -.build-temp -build -build_ -node_modules -.env -.certora* -certora_* -coverage/ -coverage.json -coverageEnv/ -emv-*/ -formulas/ -networks/test.json -networks/test-abi.json -networks/coverage.json -networks/coverage-abi.json -networks/development.json -networks/development-abi.json -networks/coverage-contracts/* -networks/test-contracts/* -networks/*-contracts.json -networks/*-history -networks/*-settings.json -outputs/ -Reports/ -scTopics -*.DS_Store -test-results.xml -.tsbuilt -yarn-error.log -scenario/build/webpack.js -.scencache -.solcache -.solcachecov -scenario/.tscache -script/certora -tests/scenarios/ -tests/Scenarios/ -junit.xml -.build -.last_confs -.saddle_history -node_modules_tmp -.idea \ No newline at end of file diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 837e3b27c..0a199a9f8 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -18,6 +18,7 @@ jobs: - uses: actions/setup-node@v2 with: + node-version: 18 cache: "yarn" - name: Install dependencies diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34633ab0d..8a63b3df4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,29 +7,30 @@ name: Venus-Protocol on: push: - branches: [master, develop] + branches: [main, develop] pull_request: branches: [main, develop] jobs: test: name: Test - runs-on: self-hosted - + runs-on: ubuntu-22.04 + env: + NODE_OPTIONS: --max-old-space-size=4096 steps: - uses: actions/checkout@v2 - - name: Clear - run: docker system prune -f -a --volumes - - - name: Build docker - run: docker build -t venus:${GITHUB_SHA::7} . + - uses: actions/setup-node@v2 + with: + node-version: 18 + cache: "yarn" - - name: Run tests - run: docker run --name ${GITHUB_SHA::7} venus:${GITHUB_SHA::7} yarn test + - name: Install deps + run: yarn - - name: Clear - run: docker rm ${GITHUB_SHA::7} + - name: Run hardhat compile and tests coverage + run: | + yarn test lint: name: Lint diff --git a/.gitignore b/.gitignore index 74d8cd441..027c3b37b 100644 --- a/.gitignore +++ b/.gitignore @@ -63,4 +63,12 @@ dist docgen-docs #openzepplin files -.openzeppelin/* \ No newline at end of file +.openzeppelin/* + +# yarn +.yarn/* +!.yarn/patches +!.yarn/releases +!.yarn/plugins +!.yarn/sdks +!.yarn/versions diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz new file mode 100644 index 000000000..511be22f6 Binary files /dev/null and b/.yarn/install-state.gz differ diff --git a/CHANGELOG.md b/CHANGELOG.md index e5f775737..34db2f9f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,37 @@ +## [3.0.0-dev.19](https://github.com/VenusProtocol/venus-protocol/compare/v3.0.0-dev.18...v3.0.0-dev.19) (2023-09-04) + + +### Features + +* add semantic release to main ([7f28dc0](https://github.com/VenusProtocol/venus-protocol/commit/7f28dc0d705e9339ad27472c6e9ebd3e88a3e4a5)) + + +### Bug Fixes + +* remove duplicate import ([e220aec](https://github.com/VenusProtocol/venus-protocol/commit/e220aec2090af60aaeee778f58b70f13fe9b5ba7)) +* remove exports from package.json ([1192698](https://github.com/VenusProtocol/venus-protocol/commit/11926980735f0bb613f4dff0df4424dcdda5a6b3)) +* set path for hardhat-ethers ([28795b1](https://github.com/VenusProtocol/venus-protocol/commit/28795b1001119a85ac9a0f5ae303945c8c3ba66f)) +* update dependencies ([36b6e76](https://github.com/VenusProtocol/venus-protocol/commit/36b6e76ee022360f7421156ca9d0e4423215f4c5)) +* update the network files with the currently used addresses ([4eaa8ae](https://github.com/VenusProtocol/venus-protocol/commit/4eaa8aef5e6a3ece21e2116073efb4c6bf1c26d5)) + +## [3.0.0-dev.18](https://github.com/VenusProtocol/venus-protocol/compare/v3.0.0-dev.17...v3.0.0-dev.18) (2023-08-23) + + +### Bug Fixes + +* add a missing param to SwapRouter deployment script ([e5a47e8](https://github.com/VenusProtocol/venus-protocol/commit/e5a47e80d788264b6a5c5e60c3e9b7cfb40c14c4)) + +## [3.0.0-dev.17](https://github.com/VenusProtocol/venus-protocol/compare/v3.0.0-dev.16...v3.0.0-dev.17) (2023-08-22) + + +### Bug Fixes + +* correct testnet VenusLens address ([ba24b14](https://github.com/VenusProtocol/venus-protocol/commit/ba24b143015c2b93abe706f2ca3395f42e673985)) + +## [3.0.0-dev.16](https://github.com/VenusProtocol/venus-protocol/compare/v3.0.0-dev.15...v3.0.0-dev.16) (2023-08-09) + +## [3.0.0-dev.15](https://github.com/VenusProtocol/venus-protocol/compare/v3.0.0-dev.14...v3.0.0-dev.15) (2023-08-08) + ## [3.0.0-dev.14](https://github.com/VenusProtocol/venus-protocol/compare/v3.0.0-dev.13...v3.0.0-dev.14) (2023-08-01) diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index f76cf4cee..000000000 --- a/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM node:16 - -RUN apt-get update && apt-get install -y build-essential python3 git g++ make -RUN wget https://github.com/ethereum/solidity/releases/download/v0.5.16/solc-static-linux -O /bin/solc && chmod +x /bin/solc - -RUN mkdir -p /venus-protocol -WORKDIR /venus-protocol - -# First add deps -ADD ./package.json /venus-protocol -ADD ./yarn.lock /venus-protocol -ADD ./.yarn /venus-protocol/.yarn -ADD ./.yarnrc.yml /venus-protocol -RUN yarn install - -# Then rest of code and build -ADD . /venus-protocol - -RUN yarn hardhat compile - -RUN yarn cache clean diff --git a/audits/021_psm_certik_20230524.pdf b/audits/021_psm_certik_20230524.pdf new file mode 100644 index 000000000..f10e6eb32 Binary files /dev/null and b/audits/021_psm_certik_20230524.pdf differ diff --git a/audits/022_psm_peckshield_20230426.pdf b/audits/022_psm_peckshield_20230426.pdf new file mode 100644 index 000000000..c90503122 Binary files /dev/null and b/audits/022_psm_peckshield_20230426.pdf differ diff --git a/audits/028_psm_hacken_20230626.pdf b/audits/028_psm_hacken_20230626.pdf new file mode 100644 index 000000000..e734169fe Binary files /dev/null and b/audits/028_psm_hacken_20230626.pdf differ diff --git a/audits/057_psm_quantstamp_20230807.pdf b/audits/057_psm_quantstamp_20230807.pdf new file mode 100644 index 000000000..e1dd0acd6 Binary files /dev/null and b/audits/057_psm_quantstamp_20230807.pdf differ diff --git a/deploy/006-deploy-psm.ts b/deploy/006-deploy-psm.ts index cb3869a89..79797a890 100644 --- a/deploy/006-deploy-psm.ts +++ b/deploy/006-deploy-psm.ts @@ -26,7 +26,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const USDTAddress = ADDRESSES[networkName].USDT; const VAIAddress = ADDRESSES[networkName].VAI; const FEE_IN = 0; - const FEE_OUT = 10; // 10bps + const FEE_OUT = 0; const VAI_MINT_CAP = parseUnits("5000000", 18); // 5M const treasuryAddresses: { [network: string]: string } = { diff --git a/deploy/006-deploy-swaprouter.ts b/deploy/006-deploy-swaprouter.ts index 6fc9a5384..6425678e3 100644 --- a/deploy/006-deploy-swaprouter.ts +++ b/deploy/006-deploy-swaprouter.ts @@ -27,7 +27,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { await deploy("SwapRouter", { contract: "SwapRouter", from: deployer, - args: [WBNBAddress, pancakeFactoryAddress, ADDRESSES[networkName].Unitroller], + args: [WBNBAddress, pancakeFactoryAddress, ADDRESSES[networkName].Unitroller, ADDRESSES[networkName].vBNB], log: true, autoMine: true, }); diff --git a/deployments/bscmainnet/.migrations.json b/deployments/bscmainnet/.migrations.json new file mode 100644 index 000000000..fcea15437 --- /dev/null +++ b/deployments/bscmainnet/.migrations.json @@ -0,0 +1,3 @@ +{ + "psm_initial_deploy": 1690981284 +} diff --git a/deployments/bscmainnet/PegStability_USDT.json b/deployments/bscmainnet/PegStability_USDT.json index 97b6399d4..09635a03e 100644 --- a/deployments/bscmainnet/PegStability_USDT.json +++ b/deployments/bscmainnet/PegStability_USDT.json @@ -1,5 +1,5 @@ { - "address": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", + "address": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", "abi": [ { "anonymous": false, @@ -124,6 +124,41 @@ "stateMutability": "payable", "type": "receive" }, + { + "inputs": [], + "name": "AlreadyPaused", + "type": "error" + }, + { + "inputs": [], + "name": "AmountTooSmall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidFee", + "type": "error" + }, + { + "inputs": [], + "name": "NotEnoughVAI", + "type": "error" + }, + { + "inputs": [], + "name": "NotPaused", + "type": "error" + }, + { + "inputs": [], + "name": "Paused", + "type": "error" + }, + { + "inputs": [], + "name": "TooManyDecimals", + "type": "error" + }, { "inputs": [ { @@ -146,23 +181,29 @@ "type": "error" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "oldComptroller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newComptroller", - "type": "address" - } - ], - "name": "ComptrollerChanged", - "type": "event" + "inputs": [], + "name": "VAIMintCapReached", + "type": "error" + }, + { + "inputs": [], + "name": "VAIMintedUnderflow", + "type": "error" + }, + { + "inputs": [], + "name": "VAITransferFail", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAmount", + "type": "error" }, { "anonymous": false, @@ -234,6 +275,25 @@ "name": "NewAccessControlManager", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -335,17 +395,17 @@ { "indexed": false, "internalType": "uint256", - "name": "vaiFee", + "name": "stableOut", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "stableOut", + "name": "vaiFee", "type": "uint256" } ], - "name": "VaiForStableSwapped", + "name": "VAIForStableSwapped", "type": "event" }, { @@ -364,7 +424,7 @@ "type": "uint256" } ], - "name": "VaiMintCapChanged", + "name": "VAIMintCapChanged", "type": "event" }, { @@ -440,23 +500,10 @@ }, { "inputs": [], - "name": "VAI_ADDRESS", + "name": "VAI", "outputs": [ { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "VTOKEN_ADDRESS", - "outputs": [ - { - "internalType": "address", + "internalType": "contract IVAI", "name": "", "type": "address" } @@ -484,19 +531,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "comptroller", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "feeIn", @@ -537,7 +571,7 @@ }, { "internalType": "address", - "name": "comptroller_", + "name": "oracleAddress_", "type": "address" }, { @@ -574,6 +608,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "owner", @@ -607,6 +654,44 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stableTknAmount", + "type": "uint256" + } + ], + "name": "previewSwapStableForVAI", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stableTknAmount", + "type": "uint256" + } + ], + "name": "previewSwapVAIForStable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "renounceOwnership", @@ -637,12 +722,12 @@ { "inputs": [ { - "internalType": "address", - "name": "comptroller_", - "type": "address" + "internalType": "uint256", + "name": "feeIn_", + "type": "uint256" } ], - "name": "setComptroller", + "name": "setFeeIn", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -651,11 +736,11 @@ "inputs": [ { "internalType": "uint256", - "name": "feeIn_", + "name": "feeOut_", "type": "uint256" } ], - "name": "setFeeIn", + "name": "setFeeOut", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -663,12 +748,12 @@ { "inputs": [ { - "internalType": "uint256", - "name": "feeOut_", - "type": "uint256" + "internalType": "address", + "name": "oracleAddress_", + "type": "address" } ], - "name": "setFeeOut", + "name": "setOracle", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -681,7 +766,7 @@ "type": "uint256" } ], - "name": "setVaiMintCap", + "name": "setVAIMintCap", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -713,7 +798,13 @@ } ], "name": "swapStableForVAI", - "outputs": [], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, @@ -731,7 +822,13 @@ } ], "name": "swapVAIForStable", - "outputs": [], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, @@ -809,84 +906,84 @@ "type": "constructor" } ], - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", "receipt": { "to": null, "from": "0xa05f990d647287e4E84715b813BC000aEA970467", - "contractAddress": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", - "transactionIndex": 57, - "gasUsed": "907185", - "logsBloom": "0x00000000000000000000000000000000400000010000000000800000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000008000000002000001001000000100000000000000000000000000020000000000000000000800000000800000000000000000000001400000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000400000008000000808000000000000000000000000020000000000000000000040000000000800400000000000000000020000000000000000000000000000000010000000800000000000000000000000000", - "blockHash": "0x97040c02f1f8062705adabe1fac98ebb64e49635974049eae028dc8f2b1c91f1", - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", + "contractAddress": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", + "transactionIndex": 123, + "gasUsed": "883976", + "logsBloom": "0x00000000000000000000004000000000400000000000000000800000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000008000000002000001000000000100000000000000000000000000020000000000000000000800000000800000000010000000000000400000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000400000000000000808000000000000000000008000020000000000000000000040004000000000400000000000000000020000008000000000000000000000000000000000808000000000000000000000000", + "blockHash": "0x1de8d3a609d4d95b8d9d8b69c5e20ac35068599ad34b989266d6e9e0d1a50174", + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", "logs": [ { - "transactionIndex": 57, - "blockNumber": 29298117, - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", - "address": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", + "transactionIndex": 123, + "blockNumber": 30501830, + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", + "address": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", "topics": [ "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x00000000000000000000000053e47c779900962b10fd81ff0ca884ad75c80702" + "0x0000000000000000000000009664568e5131e85f67d87fcd55b249f5d25fa43e" ], "data": "0x", - "logIndex": 132, - "blockHash": "0x97040c02f1f8062705adabe1fac98ebb64e49635974049eae028dc8f2b1c91f1" + "logIndex": 191, + "blockHash": "0x1de8d3a609d4d95b8d9d8b69c5e20ac35068599ad34b989266d6e9e0d1a50174" }, { - "transactionIndex": 57, - "blockNumber": 29298117, - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", - "address": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", + "transactionIndex": 123, + "blockNumber": 30501830, + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", + "address": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000a05f990d647287e4e84715b813bc000aea970467" ], "data": "0x", - "logIndex": 133, - "blockHash": "0x97040c02f1f8062705adabe1fac98ebb64e49635974049eae028dc8f2b1c91f1" + "logIndex": 192, + "blockHash": "0x1de8d3a609d4d95b8d9d8b69c5e20ac35068599ad34b989266d6e9e0d1a50174" }, { - "transactionIndex": 57, - "blockNumber": 29298117, - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", - "address": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", + "transactionIndex": 123, + "blockNumber": 30501830, + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", + "address": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000004788629abc6cfca10f9f969efdeaa1cf70c23555", - "logIndex": 134, - "blockHash": "0x97040c02f1f8062705adabe1fac98ebb64e49635974049eae028dc8f2b1c91f1" + "logIndex": 193, + "blockHash": "0x1de8d3a609d4d95b8d9d8b69c5e20ac35068599ad34b989266d6e9e0d1a50174" }, { - "transactionIndex": 57, - "blockNumber": 29298117, - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", - "address": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", + "transactionIndex": 123, + "blockNumber": 30501830, + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", + "address": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 135, - "blockHash": "0x97040c02f1f8062705adabe1fac98ebb64e49635974049eae028dc8f2b1c91f1" + "logIndex": 194, + "blockHash": "0x1de8d3a609d4d95b8d9d8b69c5e20ac35068599ad34b989266d6e9e0d1a50174" }, { - "transactionIndex": 57, - "blockNumber": 29298117, - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", - "address": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", + "transactionIndex": 123, + "blockNumber": 30501830, + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", + "address": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f918ba9446552ab184c6ffd2e2fcb1fa5ee1e59", - "logIndex": 136, - "blockHash": "0x97040c02f1f8062705adabe1fac98ebb64e49635974049eae028dc8f2b1c91f1" + "logIndex": 195, + "blockHash": "0x1de8d3a609d4d95b8d9d8b69c5e20ac35068599ad34b989266d6e9e0d1a50174" } ], - "blockNumber": 29298117, - "cumulativeGasUsed": "6522198", + "blockNumber": 30501830, + "cumulativeGasUsed": "11339018", "status": 1, "byzantium": true }, "args": [ - "0x53E47c779900962B10fd81fF0ca884ad75c80702", + "0x9664568e5131e85f67d87fCD55B249F5D25fa43e", "0x3f918bA9446552AB184C6Ffd2e2fcB1FA5ee1e59", - "0x728cdbca0000000000000000000000004788629abc6cfca10f9f969efdeaa1cf70c23555000000000000000000000000f322942f644a996a617bd29c16bd7d231d9f35e9000000000000000000000000fd36e2c2a6789db23113685031d7f163291583840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000422ca8b0a00a425000000" + "0x728cdbca0000000000000000000000004788629abc6cfca10f9f969efdeaa1cf70c23555000000000000000000000000f322942f644a996a617bd29c16bd7d231d9f35e90000000000000000000000006592b5de802159f3e74b2486b091d11a8256ab8a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000422ca8b0a00a425000000" ], "numDeployments": 1, "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", @@ -898,16 +995,16 @@ "args": [ "0x4788629ABc6cFCA10F9f969efdEAa1cF70c23555", "0xF322942f644A996A617BD29c16bd7d231d9F35E9", - "0xfD36E2c2a6789Db23113685031d7F16329158384", + "0x6592b5DE802159F3E74B2486b091D11a8256ab8A", + 0, 0, - 10, { "type": "BigNumber", "hex": "0x0422ca8b0a00a425000000" } ] }, - "implementation": "0x53E47c779900962B10fd81fF0ca884ad75c80702", + "implementation": "0x9664568e5131e85f67d87fCD55B249F5D25fa43e", "devdoc": { "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", "kind": "dev", diff --git a/deployments/bscmainnet/PegStability_USDT_Implementation.json b/deployments/bscmainnet/PegStability_USDT_Implementation.json index e9966bdcf..1385b45e5 100644 --- a/deployments/bscmainnet/PegStability_USDT_Implementation.json +++ b/deployments/bscmainnet/PegStability_USDT_Implementation.json @@ -1,11 +1,11 @@ { - "address": "0x53E47c779900962B10fd81fF0ca884ad75c80702", + "address": "0x9664568e5131e85f67d87fCD55B249F5D25fa43e", "abi": [ { "inputs": [ { "internalType": "address", - "name": "vTokenAddress_", + "name": "stableTokenAddress_", "type": "address" }, { @@ -17,6 +17,41 @@ "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [], + "name": "AlreadyPaused", + "type": "error" + }, + { + "inputs": [], + "name": "AmountTooSmall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidFee", + "type": "error" + }, + { + "inputs": [], + "name": "NotEnoughVAI", + "type": "error" + }, + { + "inputs": [], + "name": "NotPaused", + "type": "error" + }, + { + "inputs": [], + "name": "Paused", + "type": "error" + }, + { + "inputs": [], + "name": "TooManyDecimals", + "type": "error" + }, { "inputs": [ { @@ -39,23 +74,29 @@ "type": "error" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "oldComptroller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newComptroller", - "type": "address" - } - ], - "name": "ComptrollerChanged", - "type": "event" + "inputs": [], + "name": "VAIMintCapReached", + "type": "error" + }, + { + "inputs": [], + "name": "VAIMintedUnderflow", + "type": "error" + }, + { + "inputs": [], + "name": "VAITransferFail", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAmount", + "type": "error" }, { "anonymous": false, @@ -127,6 +168,25 @@ "name": "NewAccessControlManager", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -228,17 +288,17 @@ { "indexed": false, "internalType": "uint256", - "name": "vaiFee", + "name": "stableOut", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "stableOut", + "name": "vaiFee", "type": "uint256" } ], - "name": "VaiForStableSwapped", + "name": "VAIForStableSwapped", "type": "event" }, { @@ -257,7 +317,7 @@ "type": "uint256" } ], - "name": "VaiMintCapChanged", + "name": "VAIMintCapChanged", "type": "event" }, { @@ -333,23 +393,10 @@ }, { "inputs": [], - "name": "VAI_ADDRESS", + "name": "VAI", "outputs": [ { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "VTOKEN_ADDRESS", - "outputs": [ - { - "internalType": "address", + "internalType": "contract IVAI", "name": "", "type": "address" } @@ -377,19 +424,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "comptroller", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "feeIn", @@ -430,7 +464,7 @@ }, { "internalType": "address", - "name": "comptroller_", + "name": "oracleAddress_", "type": "address" }, { @@ -467,6 +501,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "owner", @@ -500,6 +547,44 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stableTknAmount", + "type": "uint256" + } + ], + "name": "previewSwapStableForVAI", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stableTknAmount", + "type": "uint256" + } + ], + "name": "previewSwapVAIForStable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "renounceOwnership", @@ -530,12 +615,12 @@ { "inputs": [ { - "internalType": "address", - "name": "comptroller_", - "type": "address" + "internalType": "uint256", + "name": "feeIn_", + "type": "uint256" } ], - "name": "setComptroller", + "name": "setFeeIn", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -544,11 +629,11 @@ "inputs": [ { "internalType": "uint256", - "name": "feeIn_", + "name": "feeOut_", "type": "uint256" } ], - "name": "setFeeIn", + "name": "setFeeOut", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -556,12 +641,12 @@ { "inputs": [ { - "internalType": "uint256", - "name": "feeOut_", - "type": "uint256" + "internalType": "address", + "name": "oracleAddress_", + "type": "address" } ], - "name": "setFeeOut", + "name": "setOracle", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -574,7 +659,7 @@ "type": "uint256" } ], - "name": "setVaiMintCap", + "name": "setVAIMintCap", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -606,7 +691,13 @@ } ], "name": "swapStableForVAI", - "outputs": [], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, @@ -624,7 +715,13 @@ } ], "name": "swapVAIForStable", - "outputs": [], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, @@ -681,39 +778,39 @@ "type": "function" } ], - "transactionHash": "0x9dfe355d96e2c2fa1809e90c236e678ea425b0e600dec5c95a5992f7c3a24cef", + "transactionHash": "0xd8ace5823a2cd8d0322b5c49f87a3d4353e5b19f95c8a2fd6782fa88bad5c63e", "receipt": { "to": null, "from": "0xa05f990d647287e4E84715b813BC000aEA970467", - "contractAddress": "0x53E47c779900962B10fd81fF0ca884ad75c80702", - "transactionIndex": 36, - "gasUsed": "2382631", - "logsBloom": "0x00000000000000000000200000000000000000000000000004000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8d5ff33c7c8fe8a74730e02885c5cafe64e8a9ba000295dcd00b0d6e0f6ec839", - "transactionHash": "0x9dfe355d96e2c2fa1809e90c236e678ea425b0e600dec5c95a5992f7c3a24cef", + "contractAddress": "0x9664568e5131e85f67d87fCD55B249F5D25fa43e", + "transactionIndex": 94, + "gasUsed": "1800406", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000100400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x35cb96306d40ec77835d35faf5d08e4f17f78370a68c7f263f31b585049e77ce", + "transactionHash": "0xd8ace5823a2cd8d0322b5c49f87a3d4353e5b19f95c8a2fd6782fa88bad5c63e", "logs": [ { - "transactionIndex": 36, - "blockNumber": 29298112, - "transactionHash": "0x9dfe355d96e2c2fa1809e90c236e678ea425b0e600dec5c95a5992f7c3a24cef", - "address": "0x53E47c779900962B10fd81fF0ca884ad75c80702", + "transactionIndex": 94, + "blockNumber": 30501826, + "transactionHash": "0xd8ace5823a2cd8d0322b5c49f87a3d4353e5b19f95c8a2fd6782fa88bad5c63e", + "address": "0x9664568e5131e85f67d87fCD55B249F5D25fa43e", "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", - "logIndex": 79, - "blockHash": "0x8d5ff33c7c8fe8a74730e02885c5cafe64e8a9ba000295dcd00b0d6e0f6ec839" + "logIndex": 172, + "blockHash": "0x35cb96306d40ec77835d35faf5d08e4f17f78370a68c7f263f31b585049e77ce" } ], - "blockNumber": 29298112, - "cumulativeGasUsed": "5706801", + "blockNumber": 30501826, + "cumulativeGasUsed": "9866152", "status": 1, "byzantium": true }, - "args": ["0xfD5840Cd36d94D7229439859C0112a4185BC0255", "0x4BD17003473389A42DAF6a0a729f6Fdb328BbBd7"], + "args": ["0x55d398326f99059fF775485246999027B3197955", "0x4BD17003473389A42DAF6a0a729f6Fdb328BbBd7"], "numDeployments": 1, - "solcInputHash": "822f68e7114df9df2dc3cc4555bcf616", - "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vTokenAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaiAddress_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldComptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newComptroller\",\"type\":\"address\"}],\"name\":\"ComptrollerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeIn\",\"type\":\"uint256\"}],\"name\":\"FeeInChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeOut\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeOut\",\"type\":\"uint256\"}],\"name\":\"FeeOutChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"PSMPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"PSMResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stableIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vaiOut\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"StableForVAISwapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vaiBurnt\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vaiFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stableOut\",\"type\":\"uint256\"}],\"name\":\"VaiForStableSwapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldCap\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newCap\",\"type\":\"uint256\"}],\"name\":\"VaiMintCapChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldTreasury\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"VenusTreasuryChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BASIS_POINTS_DIVISOR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MANTISSA_ONE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ONE_DOLLAR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STABLE_TOKEN_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VAI_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VTOKEN_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"comptroller\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"venusTreasury_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"comptroller_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeIn_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeOut_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"vaiMintCap_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resume\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller_\",\"type\":\"address\"}],\"name\":\"setComptroller\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeIn_\",\"type\":\"uint256\"}],\"name\":\"setFeeIn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeOut_\",\"type\":\"uint256\"}],\"name\":\"setFeeOut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"vaiMintCap_\",\"type\":\"uint256\"}],\"name\":\"setVaiMintCap\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"venusTreasury_\",\"type\":\"address\"}],\"name\":\"setVenusTreasury\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"stableTknAmount\",\"type\":\"uint256\"}],\"name\":\"swapStableForVAI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"stableTknAmount\",\"type\":\"uint256\"}],\"name\":\"swapVAIForStable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vaiMintCap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vaiMinted\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"venusTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus Protocol\",\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\"},\"initialize(address,address,address,uint256,uint256,uint256)\":{\"params\":{\"accessControlManager_\":\"The address of the AccessControlManager contract\",\"comptroller_\":\"The address of the Comptroller contract\",\"feeIn_\":\"The percentage of fees to be applied to a stablecoin -> VAI swap\",\"feeOut_\":\"The percentage of fees to be applied to a VAI -> stablecoin swap\",\"vaiMintCap_\":\"The cap for the total amount of VAI that can be minted\",\"venusTreasury_\":\"The address where fees will be sent\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pause()\":{\"details\":\"Reverts if the contract is already paused\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"resume()\":{\"details\":\"Reverts if the contract is not paused\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setComptroller(address)\":{\"details\":\"Reverts if the new address is zero or the oracle address returned from Comptroller is zero\",\"params\":{\"comptroller_\":\"The new address of the Comptroller contract\"}},\"setFeeIn(uint256)\":{\"details\":\"Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR)\",\"params\":{\"feeIn_\":\"The new fee percentage for incoming swaps\"}},\"setFeeOut(uint256)\":{\"details\":\"Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR)\",\"params\":{\"feeOut_\":\"The new fee percentage for outgoing swaps\"}},\"setVaiMintCap(uint256)\":{\"details\":\"Set the maximum amount of VAI that can be minted through this contract\",\"params\":{\"vaiMintCap_\":\"The new maximum amount of VAI that can be minted\"}},\"setVenusTreasury(address)\":{\"details\":\"Reverts if the new address is zero\",\"params\":{\"venusTreasury_\":\"The new address of the Venus Treasury contract\"}},\"swapStableForVAI(address,uint256)\":{\"details\":\"This function adds support to fee-on-transfer tokens. The actualTransferAmt is calculated, by recording token balance state before and after the transfer.\",\"params\":{\"receiver\":\"The address that will receive the VAI tokens.\",\"stableTknAmount\":\"The amount of stable tokens to be swapped.\"}},\"swapVAIForStable(address,uint256)\":{\"params\":{\"receiver\":\"The address where the stablecoin will be sent\",\"stableTknAmount\":\"The amount of stable tokens to receive\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"}},\"title\":\"Peg Stability Contract\",\"version\":1},\"userdoc\":{\"errors\":{\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}]},\"events\":{\"ComptrollerChanged(address,address)\":{\"notice\":\"Event emitted when comptroller state var is modified\"},\"FeeInChanged(uint256,uint256)\":{\"notice\":\"Event emitted when feeIn state var is modified\"},\"FeeOutChanged(uint256,uint256)\":{\"notice\":\"Event emitted when feeOut state var is modified\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"PSMPaused(address)\":{\"notice\":\"Event emitted when contract is paused\"},\"PSMResumed(address)\":{\"notice\":\"Event emitted when the contract is resumed after pause\"},\"StableForVAISwapped(uint256,uint256,uint256)\":{\"notice\":\"Event emitted when stable token is swapped for VAI\"},\"VaiForStableSwapped(uint256,uint256,uint256)\":{\"notice\":\"Event emitted when stable token is swapped for VAI\"},\"VaiMintCapChanged(uint256,uint256)\":{\"notice\":\"Event emitted when vaiMintCap state var is modified\"},\"VenusTreasuryChanged(address,address)\":{\"notice\":\"Event emitted when venusTreasury state var is modified\"}},\"kind\":\"user\",\"methods\":{\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"initialize(address,address,address,uint256,uint256,uint256)\":{\"notice\":\"Initializes the contract via Proxy Contract with the required parameters\"},\"pause()\":{\"notice\":\"Pause the PSM contract\"},\"resume()\":{\"notice\":\"Resume the PSM contract\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setComptroller(address)\":{\"notice\":\"Set the address of the Comptroller contract from which we obtain the oracle address\"},\"setFeeIn(uint256)\":{\"notice\":\"Set the fee percentage for incoming swaps\"},\"setFeeOut(uint256)\":{\"notice\":\"Set the fee percentage for outgoing swaps\"},\"setVenusTreasury(address)\":{\"notice\":\"Set the address of the Venus Treasury contract\"},\"swapStableForVAI(address,uint256)\":{\"notice\":\"Swaps stable tokens for VAI with fees.\"},\"swapVAIForStable(address,uint256)\":{\"notice\":\"Swaps VAI for a stable token\"}},\"notice\":\"Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/PegStability/PegStability.sol\":\"PegStability\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() external {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xd712fb45b3ea0ab49679164e3895037adc26ce12879d5184feb040e01c1c07a9\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x2b3005a0064cfc558bdf64b2bae94b565f4574a536aadd61c13838d4f2157790\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x4e733d3164f73f461eaf9d8087a7ad1ea180bdc8ba0d3d61b0e1ae16d8e63dff\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xcc70d8e2281fb3ff69e8ab242500f10142cd0a7fa8dd9e45882be270d4d09024\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/draft-IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n function safeTransfer(\\n IERC20Upgradeable token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20Upgradeable token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20Upgradeable token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20Upgradeable token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20Upgradeable token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n function safePermit(\\n IERC20PermitUpgradeable token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x220c4a5af915e656be2aaa85ca57505d102418e476b1e2ef6c62e0c6ac143871\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title Venus Access Control Contract.\\n * @dev The AccessControlledV8 contract is a wrapper around the OpenZeppelin AccessControl contract\\n * It provides a standardized way to control access to methods within the Venus Smart Contract Ecosystem.\\n * The contract allows the owner to set an AccessControlManager contract address.\\n * It can restrict method calls based on the sender's role and the method's signature.\\n */\\n\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x618d942756b93e02340a42f3c80aa99fc56be1a96861f5464dc23a76bf30b3a5\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x41deef84d1839590b243b66506691fde2fb938da01eabde53e82d3b8316fdaf9\",\"license\":\"BSD-3-Clause\"},\"contracts/PegStability/PegStability.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\n\\ninterface VAI {\\n function balanceOf(address usr) external returns (uint256);\\n\\n function transferFrom(address src, address dst, uint amount) external returns (bool);\\n\\n function mint(address usr, uint wad) external;\\n\\n function burn(address usr, uint wad) external;\\n}\\n\\ninterface IPriceOracle {\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface IVTokenUnderlying {\\n function underlying() external view returns (address);\\n}\\n\\ninterface OracleProviderInterface {\\n function oracle() external view returns (address);\\n}\\n\\ninterface DecimalProvider {\\n function decimals() external view returns (uint8);\\n}\\n\\n/**\\n * @title Peg Stability Contract\\n * @notice Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.\\n * @author Venus Protocol\\n */\\ncontract PegStability is AccessControlledV8, ReentrancyGuardUpgradeable {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n // Helper enum for calculation of the fee\\n enum FeeDirection {\\n IN,\\n OUT\\n }\\n uint256 public constant BASIS_POINTS_DIVISOR = 10000; // fee is in basis points\\n uint256 public constant MANTISSA_ONE = 1e18;\\n uint256 public immutable ONE_DOLLAR; // Our oracle is returning amount depending on the number of decimals of the stable token. (36 - asset_decimals). E.g. 8 decimal asset = 1e28\\n address public immutable VAI_ADDRESS;\\n address public immutable STABLE_TOKEN_ADDRESS;\\n address public immutable VTOKEN_ADDRESS; // vToken having as underlying the stableToken\\n address public comptroller; // used as a single point of truth for oracle address\\n address public venusTreasury;\\n uint256 public feeIn; // incoming VAI fee\\n uint256 public feeOut; // outgoing VAI fee\\n uint256 public vaiMintCap; // max amount of VAI that can be minted through this contract\\n uint256 public vaiMinted;\\n bool public isPaused;\\n\\n /// @notice Event emitted when contract is paused\\n event PSMPaused(address indexed admin);\\n\\n /// @notice Event emitted when the contract is resumed after pause\\n event PSMResumed(address indexed admin);\\n\\n /// @notice Event emitted when feeIn state var is modified\\n event FeeInChanged(uint256 oldFeeIn, uint256 newFeeIn);\\n\\n /// @notice Event emitted when feeOut state var is modified\\n event FeeOutChanged(uint256 oldFeeOut, uint256 newFeeOut);\\n\\n /// @notice Event emitted when vaiMintCap state var is modified\\n event VaiMintCapChanged(uint256 oldCap, uint256 newCap);\\n\\n /// @notice Event emitted when venusTreasury state var is modified\\n event VenusTreasuryChanged(address indexed oldTreasury, address indexed newTreasury);\\n\\n /// @notice Event emitted when comptroller state var is modified\\n event ComptrollerChanged(address indexed oldComptroller, address indexed newComptroller);\\n\\n /// @notice Event emitted when stable token is swapped for VAI\\n event StableForVAISwapped(uint256 stableIn, uint256 vaiOut, uint256 fee);\\n\\n /// @notice Event emitted when stable token is swapped for VAI\\n event VaiForStableSwapped(uint256 vaiBurnt, uint256 vaiFee, uint256 stableOut);\\n\\n /**\\n * @dev Prevents functions to execute when contract is paused.\\n */\\n modifier isActive() {\\n require(!isPaused, \\\"Contract is paused.\\\");\\n _;\\n }\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address vTokenAddress_, address vaiAddress_) {\\n ensureNonzeroAddress(vTokenAddress_);\\n ensureNonzeroAddress(vaiAddress_);\\n\\n address stableTokenAddress_ = IVTokenUnderlying(vTokenAddress_).underlying();\\n uint256 decimals_ = DecimalProvider(stableTokenAddress_).decimals();\\n require(decimals_ <= 18, \\\"too much decimals\\\");\\n ONE_DOLLAR = 10 ** (36 - decimals_); // 1$ scaled to the decimals returned by our Oracle\\n\\n VTOKEN_ADDRESS = vTokenAddress_;\\n STABLE_TOKEN_ADDRESS = stableTokenAddress_;\\n VAI_ADDRESS = vaiAddress_;\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Initializes the contract via Proxy Contract with the required parameters\\n * @param accessControlManager_ The address of the AccessControlManager contract\\n * @param venusTreasury_ The address where fees will be sent\\n * @param comptroller_ The address of the Comptroller contract\\n * @param feeIn_ The percentage of fees to be applied to a stablecoin -> VAI swap\\n * @param feeOut_ The percentage of fees to be applied to a VAI -> stablecoin swap\\n * @param vaiMintCap_ The cap for the total amount of VAI that can be minted\\n */\\n function initialize(\\n address accessControlManager_,\\n address venusTreasury_,\\n address comptroller_,\\n uint256 feeIn_,\\n uint256 feeOut_,\\n uint256 vaiMintCap_\\n ) external initializer {\\n ensureNonzeroAddress(accessControlManager_);\\n ensureNonzeroAddress(venusTreasury_);\\n ensureNonzeroAddress(comptroller_);\\n ensureNonzeroAddress(OracleProviderInterface(comptroller_).oracle());\\n __AccessControlled_init(accessControlManager_);\\n __ReentrancyGuard_init();\\n\\n require(feeIn_ < BASIS_POINTS_DIVISOR, \\\"Invalid fee in.\\\");\\n require(feeOut_ < BASIS_POINTS_DIVISOR, \\\"Invalid fee out.\\\");\\n\\n feeIn = feeIn_;\\n feeOut = feeOut_;\\n vaiMintCap = vaiMintCap_;\\n venusTreasury = venusTreasury_;\\n comptroller = comptroller_;\\n }\\n\\n /*** Swap Functions ***/\\n\\n /**\\n * @notice Swaps VAI for a stable token\\n * @param receiver The address where the stablecoin will be sent\\n * @param stableTknAmount The amount of stable tokens to receive\\n */\\n // @custom:event Emits VaiForStableSwapped event\\n function swapVAIForStable(address receiver, uint256 stableTknAmount) external isActive nonReentrant {\\n ensureNonzeroAddress(receiver);\\n require(stableTknAmount > 0, \\\"Amount must be greater than zero.\\\");\\n\\n // calculate USD value of the stable token amount scaled in 18 decimals\\n uint256 stableTknAmountUSD = previewTokenUSDAmount(stableTknAmount, FeeDirection.OUT);\\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.OUT);\\n\\n require(VAI(VAI_ADDRESS).balanceOf(msg.sender) >= stableTknAmountUSD + fee, \\\"Not enough VAI.\\\");\\n require(vaiMinted >= stableTknAmountUSD, \\\"Can't burn more VAI than minted.\\\");\\n\\n unchecked {\\n vaiMinted -= stableTknAmountUSD;\\n }\\n\\n if (fee != 0) {\\n bool success = VAI(VAI_ADDRESS).transferFrom(msg.sender, venusTreasury, fee);\\n require(success, \\\"VAI fee transfer failed.\\\");\\n }\\n\\n VAI(VAI_ADDRESS).burn(msg.sender, stableTknAmountUSD);\\n IERC20Upgradeable(STABLE_TOKEN_ADDRESS).safeTransfer(receiver, stableTknAmount);\\n emit VaiForStableSwapped(stableTknAmountUSD, fee, stableTknAmount);\\n }\\n\\n /**\\n * @notice Swaps stable tokens for VAI with fees.\\n * @dev This function adds support to fee-on-transfer tokens. The actualTransferAmt is calculated, by recording token balance state before and after the transfer.\\n * @param receiver The address that will receive the VAI tokens.\\n * @param stableTknAmount The amount of stable tokens to be swapped.\\n */\\n // @custom:event Emits StableForVAISwapped event\\n function swapStableForVAI(address receiver, uint256 stableTknAmount) external isActive nonReentrant {\\n ensureNonzeroAddress(receiver);\\n require(stableTknAmount > 0, \\\"Amount must be greater than zero.\\\");\\n\\n // transfer IN, supporting fee-on-transfer tokens\\n uint256 balanceBefore = IERC20Upgradeable(STABLE_TOKEN_ADDRESS).balanceOf(address(this));\\n IERC20Upgradeable(STABLE_TOKEN_ADDRESS).safeTransferFrom(msg.sender, address(this), stableTknAmount);\\n uint256 balanceAfter = IERC20Upgradeable(STABLE_TOKEN_ADDRESS).balanceOf(address(this));\\n\\n //calculate actual transfered amount (in case of fee-on-transfer tokens)\\n uint256 actualTransferAmt = balanceAfter - balanceBefore;\\n\\n // calculate USD value of the stable token amount scaled in 18 decimals\\n uint256 actualTransferAmtInUSD = previewTokenUSDAmount(actualTransferAmt, FeeDirection.IN);\\n\\n //calculate feeIn\\n uint256 fee = _calculateFee(actualTransferAmtInUSD, FeeDirection.IN);\\n uint256 vaiToMint = actualTransferAmtInUSD - fee;\\n\\n require(vaiMinted + actualTransferAmtInUSD <= vaiMintCap, \\\"VAI mint cap reached.\\\");\\n unchecked {\\n vaiMinted += actualTransferAmtInUSD;\\n }\\n\\n // mint VAI to receiver\\n VAI(VAI_ADDRESS).mint(receiver, vaiToMint);\\n\\n // mint VAI fee to venus treasury\\n if (fee != 0) {\\n VAI(VAI_ADDRESS).mint(venusTreasury, fee);\\n }\\n\\n emit StableForVAISwapped(actualTransferAmt, vaiToMint, fee);\\n }\\n\\n /*** Admin Functions ***/\\n\\n /**\\n * @notice Pause the PSM contract\\n * @dev Reverts if the contract is already paused\\n */\\n // @custom:event Emits PSMPaused event\\n function pause() external {\\n _checkAccessAllowed(\\\"pause()\\\");\\n require(!isPaused, \\\"PSM is already paused.\\\");\\n isPaused = true;\\n emit PSMPaused(msg.sender);\\n }\\n\\n /**\\n * @notice Resume the PSM contract\\n * @dev Reverts if the contract is not paused\\n */\\n // @custom:event Emits PSMResumed event\\n function resume() external {\\n _checkAccessAllowed(\\\"resume()\\\");\\n require(isPaused, \\\"PSM is not paused.\\\");\\n isPaused = false;\\n emit PSMResumed(msg.sender);\\n }\\n\\n /**\\n * @notice Set the fee percentage for incoming swaps\\n * @dev Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR)\\n * @param feeIn_ The new fee percentage for incoming swaps\\n */\\n // @custom:event Emits FeeInChanged event\\n function setFeeIn(uint256 feeIn_) external {\\n _checkAccessAllowed(\\\"setFeeIn(uint256)\\\");\\n // feeIn = 10000 = 100%\\n require(feeIn_ < BASIS_POINTS_DIVISOR, \\\"Invalid fee.\\\");\\n uint256 oldFeeIn = feeIn;\\n feeIn = feeIn_;\\n emit FeeInChanged(oldFeeIn, feeIn_);\\n }\\n\\n /**\\n * @notice Set the fee percentage for outgoing swaps\\n * @dev Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR)\\n * @param feeOut_ The new fee percentage for outgoing swaps\\n */\\n // @custom:event Emits FeeOutChanged event\\n function setFeeOut(uint256 feeOut_) external {\\n _checkAccessAllowed(\\\"setFeeOut(uint256)\\\");\\n // feeOut = 10000 = 100%\\n require(feeOut_ < BASIS_POINTS_DIVISOR, \\\"Invalid fee.\\\");\\n uint256 oldFeeOut = feeOut;\\n feeOut = feeOut_;\\n emit FeeOutChanged(oldFeeOut, feeOut_);\\n }\\n\\n /**\\n * @dev Set the maximum amount of VAI that can be minted through this contract\\n * @param vaiMintCap_ The new maximum amount of VAI that can be minted\\n */\\n // @custom:event Emits VaiMintCapChanged event\\n function setVaiMintCap(uint256 vaiMintCap_) external {\\n _checkAccessAllowed(\\\"setVaiMintCap(uint256)\\\");\\n uint256 oldVaiMintCap = vaiMintCap;\\n vaiMintCap = vaiMintCap_;\\n emit VaiMintCapChanged(oldVaiMintCap, vaiMintCap_);\\n }\\n\\n /**\\n * @notice Set the address of the Venus Treasury contract\\n * @dev Reverts if the new address is zero\\n * @param venusTreasury_ The new address of the Venus Treasury contract\\n */\\n // @custom:event Emits VenusTreasuryChanged event\\n function setVenusTreasury(address venusTreasury_) external {\\n _checkAccessAllowed(\\\"setVenusTreasury(address)\\\");\\n ensureNonzeroAddress(venusTreasury_);\\n address oldTreasuryAddress = venusTreasury;\\n venusTreasury = venusTreasury_;\\n emit VenusTreasuryChanged(oldTreasuryAddress, venusTreasury_);\\n }\\n\\n /**\\n * @notice Set the address of the Comptroller contract from which we obtain the oracle address\\n * @dev Reverts if the new address is zero or the oracle address returned from Comptroller is zero\\n * @param comptroller_ The new address of the Comptroller contract\\n */\\n // @custom:event Emits ComptrollerChanged event\\n function setComptroller(address comptroller_) external {\\n _checkAccessAllowed(\\\"setComptroller(address)\\\");\\n ensureNonzeroAddress(comptroller_);\\n ensureNonzeroAddress(OracleProviderInterface(comptroller_).oracle());\\n address oldComptrollerAddress = comptroller;\\n comptroller = comptroller_;\\n emit ComptrollerChanged(oldComptrollerAddress, comptroller_);\\n }\\n\\n /*** Helper Functions ***/\\n\\n /**\\n * @dev Calculates the USD value of the given amount of stable tokens depending on the swap direction.\\n * @param amount The amount of stable tokens.\\n * @param direction The direction of the swap.\\n * @return The USD value of the given amount of stable tokens scaled by 1e18 taking into account the direction of the swap\\n */\\n function previewTokenUSDAmount(uint256 amount, FeeDirection direction) internal view returns (uint256) {\\n return (amount * getPriceInUSD(direction)) / MANTISSA_ONE;\\n }\\n\\n /**\\n * @notice Get the price of stable token in USD\\n * @dev This function returns either min(1$,oraclePrice) or max(1$,oraclePrice) with a decimal scale (36 - asset_decimals). E.g. for 8 decimal token 1$ will be 1e28\\n * @param direction The direction of the swap: FeeDirection.IN or FeeDirection.OUT\\n * @return The price in USD, adjusted based on the selected direction\\n */\\n function getPriceInUSD(FeeDirection direction) internal view returns (uint256) {\\n address priceOracleAddress = OracleProviderInterface(comptroller).oracle();\\n // get price with a scale = (36 - asset_decimals)\\n uint256 price = IPriceOracle(priceOracleAddress).getUnderlyingPrice(VTOKEN_ADDRESS);\\n\\n if (direction == FeeDirection.IN) {\\n // MIN(1, price)\\n return price < ONE_DOLLAR ? price : ONE_DOLLAR;\\n } else {\\n // MAX(1, price)\\n return price > ONE_DOLLAR ? price : ONE_DOLLAR;\\n }\\n }\\n\\n /**\\n * @notice Calculate the fee amount based on the input amount and fee percentage\\n * @dev Reverts if the fee percentage calculation results in rounding down to 0\\n * @param amount The input amount to calculate the fee from\\n * @param direction The direction of the fee: FeeDirection.IN or FeeDirection.OUT\\n * @return The fee amount\\n */\\n function _calculateFee(uint256 amount, FeeDirection direction) internal view returns (uint256) {\\n uint256 feePercent;\\n if (direction == FeeDirection.IN) {\\n feePercent = feeIn;\\n } else {\\n feePercent = feeOut;\\n }\\n if (feePercent == 0) {\\n return 0;\\n } else {\\n // checking if the percent calculation will result in rounding down to 0\\n require(amount * feePercent >= BASIS_POINTS_DIVISOR, \\\"Amount too small.\\\");\\n return (amount * feePercent) / BASIS_POINTS_DIVISOR;\\n }\\n }\\n\\n /**\\n * @notice Checks that the address is not the zero address\\n * @param someone The address to check\\n */\\n function ensureNonzeroAddress(address someone) private pure {\\n require(someone != address(0), \\\"Can't be zero address.\\\");\\n }\\n}\\n\",\"keccak256\":\"0x1ca013d295c0ea306a417bb9a4fae6f9f3c43bf40f31ba394b9c6091d341acdc\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", - "bytecode": "0x6101006040523480156200001257600080fd5b5060405162002ee138038062002ee18339810160408190526200003591620002ec565b6200004082620001b5565b6200004b81620001b5565b6000826001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200008c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000b2919062000324565b90506000816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200011b919062000349565b60ff16905060128111156200016b5760405162461bcd60e51b8152602060048201526011602482015270746f6f206d75636820646563696d616c7360781b60448201526064015b60405180910390fd5b6200017881602462000384565b6200018590600a6200049d565b6080526001600160a01b0380851660e05282811660c052831660a052620001ab62000210565b50505050620004ab565b6001600160a01b0381166200020d5760405162461bcd60e51b815260206004820152601660248201527f43616e2774206265207a65726f20616464726573732e00000000000000000000604482015260640162000162565b50565b600054610100900460ff16156200027a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840162000162565b60005460ff9081161015620002cd576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b80516001600160a01b0381168114620002e757600080fd5b919050565b600080604083850312156200030057600080fd5b6200030b83620002cf565b91506200031b60208401620002cf565b90509250929050565b6000602082840312156200033757600080fd5b6200034282620002cf565b9392505050565b6000602082840312156200035c57600080fd5b815160ff811681146200034257600080fd5b634e487b7160e01b600052601160045260246000fd5b6000828210156200039957620003996200036e565b500390565b600181815b80851115620003df578160001904821115620003c357620003c36200036e565b80851615620003d157918102915b93841c9390800290620003a3565b509250929050565b600082620003f85750600162000497565b81620004075750600062000497565b81600181146200042057600281146200042b576200044b565b600191505062000497565b60ff8411156200043f576200043f6200036e565b50506001821b62000497565b5060208310610133831016604e8410600b841016171562000470575081810a62000497565b6200047c83836200039e565b80600019048211156200049357620004936200036e565b0290505b92915050565b6000620003428383620003e7565b60805160a05160c05160e05161299a62000547600039600081816104660152611fa201526000818161036d015281816109ae015281816113e60152818161148201526114db0152600081816103e3015281816106a501528181610830015281816109230152818161164c01526116ff015260008181610269015281816120380152818161205f0152818161208f01526120b6015261299a6000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806379ba509711610104578063b4a0bdf3116100a2578063e30c397811610071578063e30c397814610421578063f23c0f401461043f578063f2fde38b1461044e578063f34d11191461046157600080fd5b8063b4a0bdf3146103c0578063bb644b03146103de578063d97c057d14610405578063dd0812681461040e57600080fd5b80638da5cb5b116100de5780638da5cb5b1461034a5780638ec2b23914610368578063a52f540c1461038f578063b187bd26146103a257600080fd5b806379ba5097146103275780638456cb591461032f5780638bad38dd1461033757600080fd5b806355725d411161017c5780636ebcd7ac1161014b5780636ebcd7ac146102f0578063715018a614610303578063728cdbca1461030b578063769a48d91461031e57600080fd5b806355725d4114610251578063572ca9e714610264578063586f99331461028b5780635fe3b567146102d057600080fd5b80630e32cb86116101b85780630e32cb8614610218578063126082cf1461022b57806340a1dd461461023457806342e8a9721461023e57600080fd5b8063046f7da2146101df5780630696819f146101e95780630d35d2ed14610205575b600080fd5b6101e7610488565b005b6101f260fe5481565b6040519081526020015b60405180910390f35b6101e7610213366004612623565b610574565b6101e761022636600461264f565b610a28565b6101f261271081565b6101f26101005481565b6101e761024c366004612673565b610a3c565b6101e761025f366004612673565b610b11565b6101f27f000000000000000000000000000000000000000000000000000000000000000081565b60fc546102ab9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fc565b60fb546102ab9073ffffffffffffffffffffffffffffffffffffffff1681565b6101e76102fe366004612673565b610bde565b6101e7610c5a565b6101e761031936600461268c565b610c6e565b6101f260fd5481565b6101e7610f8d565b6101e7611025565b6101e761034536600461264f565b611110565b60335473ffffffffffffffffffffffffffffffffffffffff166102ab565b6102ab7f000000000000000000000000000000000000000000000000000000000000000081565b6101e761039d36600461264f565b61121c565b610101546103b09060ff1681565b60405190151581526020016101fc565b60975473ffffffffffffffffffffffffffffffffffffffff166102ab565b6102ab7f000000000000000000000000000000000000000000000000000000000000000081565b6101f260ff5481565b6101e761041c366004612623565b6112da565b60655473ffffffffffffffffffffffffffffffffffffffff166102ab565b6101f2670de0b6b3a764000081565b6101e761045c36600461264f565b6117af565b6102ab7f000000000000000000000000000000000000000000000000000000000000000081565b6104c66040518060400160405280600881526020017f726573756d65282900000000000000000000000000000000000000000000000081525061185f565b6101015460ff1661051e5760405162461bcd60e51b815260206004820152601260248201527f50534d206973206e6f74207061757365642e000000000000000000000000000060448201526064015b60405180910390fd5b61010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560405133907f108589e68122bb4da8e5020c44387cab025243d0894392e275459641a90181a290600090a2565b6101015460ff16156105c85760405162461bcd60e51b815260206004820152601360248201527f436f6e7472616374206973207061757365642e000000000000000000000000006044820152606401610515565b6105d0611938565b6105d982611991565b6000811161064f5760405162461bcd60e51b815260206004820152602160248201527f416d6f756e74206d7573742062652067726561746572207468616e207a65726f60448201527f2e000000000000000000000000000000000000000000000000000000000000006064820152608401610515565b600061065c8260016119f4565b9050600061066b826001611a25565b90506106778183612720565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a08231906024016020604051808303816000875af1158015610703573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107279190612738565b10156107755760405162461bcd60e51b815260206004820152600f60248201527f4e6f7420656e6f756768205641492e00000000000000000000000000000000006044820152606401610515565b816101005410156107c85760405162461bcd60e51b815260206004820181905260248201527f43616e2774206275726e206d6f726520564149207468616e206d696e7465642e6044820152606401610515565b6101008054839003905580156108ee5760fc546040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9182166024820152604481018390526000917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610879573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089d9190612751565b9050806108ec5760405162461bcd60e51b815260206004820152601860248201527f56414920666565207472616e73666572206661696c65642e00000000000000006044820152606401610515565b505b6040517f9dc29fac000000000000000000000000000000000000000000000000000000008152336004820152602481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690639dc29fac90604401600060405180830381600087803b15801561097c57600080fd5b505af1158015610990573d6000803e3d6000fd5b506109d792505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690508585611ada565b60408051838152602081018390529081018490527f193aebac4ee542588a7c4a31d025211f727993d5dcec18b4d6cd64518677c8d99060600160405180910390a15050610a24600160c955565b5050565b610a30611bba565b610a3981611c21565b50565b610a7a6040518060400160405280601281526020017f7365744665654f75742875696e7432353629000000000000000000000000000081525061185f565b6127108110610acb5760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206665652e00000000000000000000000000000000000000006044820152606401610515565b60fe80549082905560408051828152602081018490527fdc61767cf6b8f2d5ec16cd975db6d3a79fc69dc428b04c93e8db271de5e43b9f91015b60405180910390a15050565b610b4f6040518060400160405280601181526020017f736574466565496e2875696e743235362900000000000000000000000000000081525061185f565b6127108110610ba05760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206665652e00000000000000000000000000000000000000006044820152606401610515565b60fd80549082905560408051828152602081018490527fb76804f9786a4411a614b09a8211b2fd86f1f5b7a5e4410f35aa1578aac64e049101610b05565b610c1c6040518060400160405280601681526020017f7365745661694d696e744361702875696e74323536290000000000000000000081525061185f565b60ff80549082905560408051828152602081018490527f7c907ad6b82d09686cae9d7a7aeaca89d479b6f4bea645228455dc222d4ce4849101610b05565b610c62611bba565b610c6c6000611d29565b565b600054610100900460ff1615808015610c8e5750600054600160ff909116105b80610ca85750303b158015610ca8575060005460ff166001145b610d1a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610515565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610d7857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610d8187611991565b610d8a86611991565b610d9385611991565b610e0a8573ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610de1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e059190612773565b611991565b610e1387611d5a565b610e1b611de8565b6127108410610e6c5760405162461bcd60e51b815260206004820152600f60248201527f496e76616c69642066656520696e2e00000000000000000000000000000000006044820152606401610515565b6127108310610ebd5760405162461bcd60e51b815260206004820152601060248201527f496e76616c696420666565206f75742e000000000000000000000000000000006044820152606401610515565b60fd84905560fe83905560ff82905560fc805473ffffffffffffffffffffffffffffffffffffffff8089167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161790925560fb8054928816929091169190911790558015610f8457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b606554339073ffffffffffffffffffffffffffffffffffffffff16811461101c5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e657200000000000000000000000000000000000000000000006064820152608401610515565b610a3981611d29565b6110636040518060400160405280600781526020017f706175736528290000000000000000000000000000000000000000000000000081525061185f565b6101015460ff16156110b75760405162461bcd60e51b815260206004820152601660248201527f50534d20697320616c7265616479207061757365642e000000000000000000006044820152606401610515565b61010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905560405133907fb7aabc84a8f1fe9971d4bfffb4bb336af2c63e547360dd116940dc70da8159e190600090a2565b61114e6040518060400160405280601781526020017f736574436f6d7074726f6c6c657228616464726573732900000000000000000081525061185f565b61115781611991565b6111a58173ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610de1573d6000803e3d6000fd5b60fb805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f14d85f53464bf93dea3f478c71487155c412ff19f1384aa9fc205fa7638a150d90600090a35050565b61125a6040518060400160405280601981526020017f73657456656e757354726561737572792861646472657373290000000000000081525061185f565b61126381611991565b60fc805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f35655f8f1a1f8b7ff254ff70c675c0a26ddcb3da6cb6decd491ecdee167e220b90600090a35050565b6101015460ff161561132e5760405162461bcd60e51b815260206004820152601360248201527f436f6e7472616374206973207061757365642e000000000000000000000000006044820152606401610515565b611336611938565b61133f82611991565b600081116113b55760405162461bcd60e51b815260206004820152602160248201527f416d6f756e74206d7573742062652067726561746572207468616e207a65726f60448201527f2e000000000000000000000000000000000000000000000000000000000000006064820152608401610515565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611442573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114669190612738565b90506114aa73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016333085611e6d565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611537573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155b9190612738565b905060006115698383612790565b905060006115788260006119f4565b90506000611587826000611a25565b905060006115958284612790565b905060ff5483610100546115a99190612720565b11156115f75760405162461bcd60e51b815260206004820152601560248201527f564149206d696e742063617020726561636865642e00000000000000000000006044820152606401610515565b6101008054840190556040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8981166004830152602482018390527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b15801561169057600080fd5b505af11580156116a4573d6000803e3d6000fd5b505050508160001461175e5760fc546040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018490527f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b15801561174557600080fd5b505af1158015611759573d6000803e3d6000fd5b505050505b60408051858152602081018390529081018390527f018e5c6d7bd9e0cafe3512ff02488f4c0ce3524a684e1097aab74666bf4fd00f9060600160405180910390a1505050505050610a24600160c955565b6117b7611bba565b6065805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915561181a60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6097546040517f18c5e8ab00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906318c5e8ab906118b8903390869060040161281d565b602060405180830381865afa1580156118d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f99190612751565b905080610a24573330836040517f4a3fa2930000000000000000000000000000000000000000000000000000000081526004016105159392919061284c565b600260c9540361198a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610515565b600260c955565b73ffffffffffffffffffffffffffffffffffffffff8116610a395760405162461bcd60e51b815260206004820152601660248201527f43616e2774206265207a65726f20616464726573732e000000000000000000006044820152606401610515565b6000670de0b6b3a7640000611a0883611ed1565b611a12908561288e565b611a1c91906128cb565b90505b92915050565b60008080836001811115611a3b57611a3b612906565b03611a49575060fd54611a4e565b5060fe545b80600003611a60576000915050611a1f565b612710611a6d828661288e565b1015611abb5760405162461bcd60e51b815260206004820152601160248201527f416d6f756e7420746f6f20736d616c6c2e0000000000000000000000000000006044820152606401610515565b612710611ac8828661288e565b611ad291906128cb565b915050611a1f565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052611bae9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526120da565b505050565b600160c955565b60335473ffffffffffffffffffffffffffffffffffffffff163314610c6c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610515565b73ffffffffffffffffffffffffffffffffffffffff8116611caa5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610515565b6097805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa09101610b05565b606580547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055610a39816121cc565b600054610100900460ff16611dd75760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b611ddf612243565b610a39816122c8565b600054610100900460ff16611e655760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b610c6c612345565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611ecb9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611b2c565b50505050565b60008060fb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f659190612773565b6040517ffc57d4df00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116600483015291925060009183169063fc57d4df90602401602060405180830381865afa158015611ff7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201b9190612738565b9050600084600181111561203157612031612906565b0361208d577f00000000000000000000000000000000000000000000000000000000000000008110612083577f0000000000000000000000000000000000000000000000000000000000000000612085565b805b949350505050565b7f00000000000000000000000000000000000000000000000000000000000000008111612083577f0000000000000000000000000000000000000000000000000000000000000000612085565b600061213c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166123c29092919063ffffffff16565b805190915015611bae578080602001905181019061215a9190612751565b611bae5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610515565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166122c05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b610c6c6123d1565b600054610100900460ff16610a305760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b600054610100900460ff16611bb35760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b60606120858484600085612457565b600054610100900460ff1661244e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b610c6c33611d29565b6060824710156124cf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610515565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516124f89190612935565b60006040518083038185875af1925050503d8060008114612535576040519150601f19603f3d011682016040523d82523d6000602084013e61253a565b606091505b509150915061254b87838387612556565b979650505050505050565b606083156125d25782516000036125cb5773ffffffffffffffffffffffffffffffffffffffff85163b6125cb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610515565b5081612085565b61208583838151156125e75781518083602001fd5b8060405162461bcd60e51b81526004016105159190612951565b73ffffffffffffffffffffffffffffffffffffffff81168114610a3957600080fd5b6000806040838503121561263657600080fd5b823561264181612601565b946020939093013593505050565b60006020828403121561266157600080fd5b813561266c81612601565b9392505050565b60006020828403121561268557600080fd5b5035919050565b60008060008060008060c087890312156126a557600080fd5b86356126b081612601565b955060208701356126c081612601565b945060408701356126d081612601565b959894975094956060810135955060808101359460a0909101359350915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115612733576127336126f1565b500190565b60006020828403121561274a57600080fd5b5051919050565b60006020828403121561276357600080fd5b8151801515811461266c57600080fd5b60006020828403121561278557600080fd5b815161266c81612601565b6000828210156127a2576127a26126f1565b500390565b60005b838110156127c25781810151838201526020016127aa565b83811115611ecb5750506000910152565b600081518084526127eb8160208601602086016127a7565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600061208560408301846127d3565b600073ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152506060604083015261288560608301846127d3565b95945050505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156128c6576128c66126f1565b500290565b600082612901577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600082516129478184602087016127a7565b9190910192915050565b602081526000611a1c60208301846127d356fea2646970667358221220d5f0902ed9871f12679ff96b47767ac91cf55f1d2c1a746c5fdcc05b4856f88664736f6c634300080d0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806379ba509711610104578063b4a0bdf3116100a2578063e30c397811610071578063e30c397814610421578063f23c0f401461043f578063f2fde38b1461044e578063f34d11191461046157600080fd5b8063b4a0bdf3146103c0578063bb644b03146103de578063d97c057d14610405578063dd0812681461040e57600080fd5b80638da5cb5b116100de5780638da5cb5b1461034a5780638ec2b23914610368578063a52f540c1461038f578063b187bd26146103a257600080fd5b806379ba5097146103275780638456cb591461032f5780638bad38dd1461033757600080fd5b806355725d411161017c5780636ebcd7ac1161014b5780636ebcd7ac146102f0578063715018a614610303578063728cdbca1461030b578063769a48d91461031e57600080fd5b806355725d4114610251578063572ca9e714610264578063586f99331461028b5780635fe3b567146102d057600080fd5b80630e32cb86116101b85780630e32cb8614610218578063126082cf1461022b57806340a1dd461461023457806342e8a9721461023e57600080fd5b8063046f7da2146101df5780630696819f146101e95780630d35d2ed14610205575b600080fd5b6101e7610488565b005b6101f260fe5481565b6040519081526020015b60405180910390f35b6101e7610213366004612623565b610574565b6101e761022636600461264f565b610a28565b6101f261271081565b6101f26101005481565b6101e761024c366004612673565b610a3c565b6101e761025f366004612673565b610b11565b6101f27f000000000000000000000000000000000000000000000000000000000000000081565b60fc546102ab9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fc565b60fb546102ab9073ffffffffffffffffffffffffffffffffffffffff1681565b6101e76102fe366004612673565b610bde565b6101e7610c5a565b6101e761031936600461268c565b610c6e565b6101f260fd5481565b6101e7610f8d565b6101e7611025565b6101e761034536600461264f565b611110565b60335473ffffffffffffffffffffffffffffffffffffffff166102ab565b6102ab7f000000000000000000000000000000000000000000000000000000000000000081565b6101e761039d36600461264f565b61121c565b610101546103b09060ff1681565b60405190151581526020016101fc565b60975473ffffffffffffffffffffffffffffffffffffffff166102ab565b6102ab7f000000000000000000000000000000000000000000000000000000000000000081565b6101f260ff5481565b6101e761041c366004612623565b6112da565b60655473ffffffffffffffffffffffffffffffffffffffff166102ab565b6101f2670de0b6b3a764000081565b6101e761045c36600461264f565b6117af565b6102ab7f000000000000000000000000000000000000000000000000000000000000000081565b6104c66040518060400160405280600881526020017f726573756d65282900000000000000000000000000000000000000000000000081525061185f565b6101015460ff1661051e5760405162461bcd60e51b815260206004820152601260248201527f50534d206973206e6f74207061757365642e000000000000000000000000000060448201526064015b60405180910390fd5b61010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560405133907f108589e68122bb4da8e5020c44387cab025243d0894392e275459641a90181a290600090a2565b6101015460ff16156105c85760405162461bcd60e51b815260206004820152601360248201527f436f6e7472616374206973207061757365642e000000000000000000000000006044820152606401610515565b6105d0611938565b6105d982611991565b6000811161064f5760405162461bcd60e51b815260206004820152602160248201527f416d6f756e74206d7573742062652067726561746572207468616e207a65726f60448201527f2e000000000000000000000000000000000000000000000000000000000000006064820152608401610515565b600061065c8260016119f4565b9050600061066b826001611a25565b90506106778183612720565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a08231906024016020604051808303816000875af1158015610703573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107279190612738565b10156107755760405162461bcd60e51b815260206004820152600f60248201527f4e6f7420656e6f756768205641492e00000000000000000000000000000000006044820152606401610515565b816101005410156107c85760405162461bcd60e51b815260206004820181905260248201527f43616e2774206275726e206d6f726520564149207468616e206d696e7465642e6044820152606401610515565b6101008054839003905580156108ee5760fc546040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9182166024820152604481018390526000917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610879573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089d9190612751565b9050806108ec5760405162461bcd60e51b815260206004820152601860248201527f56414920666565207472616e73666572206661696c65642e00000000000000006044820152606401610515565b505b6040517f9dc29fac000000000000000000000000000000000000000000000000000000008152336004820152602481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690639dc29fac90604401600060405180830381600087803b15801561097c57600080fd5b505af1158015610990573d6000803e3d6000fd5b506109d792505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690508585611ada565b60408051838152602081018390529081018490527f193aebac4ee542588a7c4a31d025211f727993d5dcec18b4d6cd64518677c8d99060600160405180910390a15050610a24600160c955565b5050565b610a30611bba565b610a3981611c21565b50565b610a7a6040518060400160405280601281526020017f7365744665654f75742875696e7432353629000000000000000000000000000081525061185f565b6127108110610acb5760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206665652e00000000000000000000000000000000000000006044820152606401610515565b60fe80549082905560408051828152602081018490527fdc61767cf6b8f2d5ec16cd975db6d3a79fc69dc428b04c93e8db271de5e43b9f91015b60405180910390a15050565b610b4f6040518060400160405280601181526020017f736574466565496e2875696e743235362900000000000000000000000000000081525061185f565b6127108110610ba05760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206665652e00000000000000000000000000000000000000006044820152606401610515565b60fd80549082905560408051828152602081018490527fb76804f9786a4411a614b09a8211b2fd86f1f5b7a5e4410f35aa1578aac64e049101610b05565b610c1c6040518060400160405280601681526020017f7365745661694d696e744361702875696e74323536290000000000000000000081525061185f565b60ff80549082905560408051828152602081018490527f7c907ad6b82d09686cae9d7a7aeaca89d479b6f4bea645228455dc222d4ce4849101610b05565b610c62611bba565b610c6c6000611d29565b565b600054610100900460ff1615808015610c8e5750600054600160ff909116105b80610ca85750303b158015610ca8575060005460ff166001145b610d1a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610515565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610d7857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610d8187611991565b610d8a86611991565b610d9385611991565b610e0a8573ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610de1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e059190612773565b611991565b610e1387611d5a565b610e1b611de8565b6127108410610e6c5760405162461bcd60e51b815260206004820152600f60248201527f496e76616c69642066656520696e2e00000000000000000000000000000000006044820152606401610515565b6127108310610ebd5760405162461bcd60e51b815260206004820152601060248201527f496e76616c696420666565206f75742e000000000000000000000000000000006044820152606401610515565b60fd84905560fe83905560ff82905560fc805473ffffffffffffffffffffffffffffffffffffffff8089167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161790925560fb8054928816929091169190911790558015610f8457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b606554339073ffffffffffffffffffffffffffffffffffffffff16811461101c5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e657200000000000000000000000000000000000000000000006064820152608401610515565b610a3981611d29565b6110636040518060400160405280600781526020017f706175736528290000000000000000000000000000000000000000000000000081525061185f565b6101015460ff16156110b75760405162461bcd60e51b815260206004820152601660248201527f50534d20697320616c7265616479207061757365642e000000000000000000006044820152606401610515565b61010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905560405133907fb7aabc84a8f1fe9971d4bfffb4bb336af2c63e547360dd116940dc70da8159e190600090a2565b61114e6040518060400160405280601781526020017f736574436f6d7074726f6c6c657228616464726573732900000000000000000081525061185f565b61115781611991565b6111a58173ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610de1573d6000803e3d6000fd5b60fb805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f14d85f53464bf93dea3f478c71487155c412ff19f1384aa9fc205fa7638a150d90600090a35050565b61125a6040518060400160405280601981526020017f73657456656e757354726561737572792861646472657373290000000000000081525061185f565b61126381611991565b60fc805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f35655f8f1a1f8b7ff254ff70c675c0a26ddcb3da6cb6decd491ecdee167e220b90600090a35050565b6101015460ff161561132e5760405162461bcd60e51b815260206004820152601360248201527f436f6e7472616374206973207061757365642e000000000000000000000000006044820152606401610515565b611336611938565b61133f82611991565b600081116113b55760405162461bcd60e51b815260206004820152602160248201527f416d6f756e74206d7573742062652067726561746572207468616e207a65726f60448201527f2e000000000000000000000000000000000000000000000000000000000000006064820152608401610515565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611442573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114669190612738565b90506114aa73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016333085611e6d565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611537573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155b9190612738565b905060006115698383612790565b905060006115788260006119f4565b90506000611587826000611a25565b905060006115958284612790565b905060ff5483610100546115a99190612720565b11156115f75760405162461bcd60e51b815260206004820152601560248201527f564149206d696e742063617020726561636865642e00000000000000000000006044820152606401610515565b6101008054840190556040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8981166004830152602482018390527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b15801561169057600080fd5b505af11580156116a4573d6000803e3d6000fd5b505050508160001461175e5760fc546040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018490527f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b15801561174557600080fd5b505af1158015611759573d6000803e3d6000fd5b505050505b60408051858152602081018390529081018390527f018e5c6d7bd9e0cafe3512ff02488f4c0ce3524a684e1097aab74666bf4fd00f9060600160405180910390a1505050505050610a24600160c955565b6117b7611bba565b6065805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915561181a60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6097546040517f18c5e8ab00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906318c5e8ab906118b8903390869060040161281d565b602060405180830381865afa1580156118d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f99190612751565b905080610a24573330836040517f4a3fa2930000000000000000000000000000000000000000000000000000000081526004016105159392919061284c565b600260c9540361198a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610515565b600260c955565b73ffffffffffffffffffffffffffffffffffffffff8116610a395760405162461bcd60e51b815260206004820152601660248201527f43616e2774206265207a65726f20616464726573732e000000000000000000006044820152606401610515565b6000670de0b6b3a7640000611a0883611ed1565b611a12908561288e565b611a1c91906128cb565b90505b92915050565b60008080836001811115611a3b57611a3b612906565b03611a49575060fd54611a4e565b5060fe545b80600003611a60576000915050611a1f565b612710611a6d828661288e565b1015611abb5760405162461bcd60e51b815260206004820152601160248201527f416d6f756e7420746f6f20736d616c6c2e0000000000000000000000000000006044820152606401610515565b612710611ac8828661288e565b611ad291906128cb565b915050611a1f565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052611bae9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526120da565b505050565b600160c955565b60335473ffffffffffffffffffffffffffffffffffffffff163314610c6c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610515565b73ffffffffffffffffffffffffffffffffffffffff8116611caa5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610515565b6097805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa09101610b05565b606580547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055610a39816121cc565b600054610100900460ff16611dd75760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b611ddf612243565b610a39816122c8565b600054610100900460ff16611e655760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b610c6c612345565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611ecb9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611b2c565b50505050565b60008060fb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f659190612773565b6040517ffc57d4df00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116600483015291925060009183169063fc57d4df90602401602060405180830381865afa158015611ff7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201b9190612738565b9050600084600181111561203157612031612906565b0361208d577f00000000000000000000000000000000000000000000000000000000000000008110612083577f0000000000000000000000000000000000000000000000000000000000000000612085565b805b949350505050565b7f00000000000000000000000000000000000000000000000000000000000000008111612083577f0000000000000000000000000000000000000000000000000000000000000000612085565b600061213c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166123c29092919063ffffffff16565b805190915015611bae578080602001905181019061215a9190612751565b611bae5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610515565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166122c05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b610c6c6123d1565b600054610100900460ff16610a305760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b600054610100900460ff16611bb35760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b60606120858484600085612457565b600054610100900460ff1661244e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b610c6c33611d29565b6060824710156124cf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610515565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516124f89190612935565b60006040518083038185875af1925050503d8060008114612535576040519150601f19603f3d011682016040523d82523d6000602084013e61253a565b606091505b509150915061254b87838387612556565b979650505050505050565b606083156125d25782516000036125cb5773ffffffffffffffffffffffffffffffffffffffff85163b6125cb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610515565b5081612085565b61208583838151156125e75781518083602001fd5b8060405162461bcd60e51b81526004016105159190612951565b73ffffffffffffffffffffffffffffffffffffffff81168114610a3957600080fd5b6000806040838503121561263657600080fd5b823561264181612601565b946020939093013593505050565b60006020828403121561266157600080fd5b813561266c81612601565b9392505050565b60006020828403121561268557600080fd5b5035919050565b60008060008060008060c087890312156126a557600080fd5b86356126b081612601565b955060208701356126c081612601565b945060408701356126d081612601565b959894975094956060810135955060808101359460a0909101359350915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115612733576127336126f1565b500190565b60006020828403121561274a57600080fd5b5051919050565b60006020828403121561276357600080fd5b8151801515811461266c57600080fd5b60006020828403121561278557600080fd5b815161266c81612601565b6000828210156127a2576127a26126f1565b500390565b60005b838110156127c25781810151838201526020016127aa565b83811115611ecb5750506000910152565b600081518084526127eb8160208601602086016127a7565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600061208560408301846127d3565b600073ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152506060604083015261288560608301846127d3565b95945050505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156128c6576128c66126f1565b500290565b600082612901577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600082516129478184602087016127a7565b9190910192915050565b602081526000611a1c60208301846127d356fea2646970667358221220d5f0902ed9871f12679ff96b47767ac91cf55f1d2c1a746c5fdcc05b4856f88664736f6c634300080d0033", + "solcInputHash": "ad861ed5d4e7191c78cab74f6cb7beec", + "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"stableTokenAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaiAddress_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountTooSmall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEnoughVAI\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Paused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyDecimals\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAIMintCapReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAIMintedUnderflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAITransferFail\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAmount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeIn\",\"type\":\"uint256\"}],\"name\":\"FeeInChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeOut\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeOut\",\"type\":\"uint256\"}],\"name\":\"FeeOutChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldOracle\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOracle\",\"type\":\"address\"}],\"name\":\"OracleChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"PSMPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"PSMResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stableIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vaiOut\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"StableForVAISwapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vaiBurnt\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stableOut\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vaiFee\",\"type\":\"uint256\"}],\"name\":\"VAIForStableSwapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldCap\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newCap\",\"type\":\"uint256\"}],\"name\":\"VAIMintCapChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldTreasury\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"VenusTreasuryChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BASIS_POINTS_DIVISOR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MANTISSA_ONE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ONE_DOLLAR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STABLE_TOKEN_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VAI\",\"outputs\":[{\"internalType\":\"contract IVAI\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"venusTreasury_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"oracleAddress_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeIn_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeOut_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"vaiMintCap_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oracle\",\"outputs\":[{\"internalType\":\"contract ResilientOracleInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"stableTknAmount\",\"type\":\"uint256\"}],\"name\":\"previewSwapStableForVAI\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"stableTknAmount\",\"type\":\"uint256\"}],\"name\":\"previewSwapVAIForStable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resume\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeIn_\",\"type\":\"uint256\"}],\"name\":\"setFeeIn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeOut_\",\"type\":\"uint256\"}],\"name\":\"setFeeOut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracleAddress_\",\"type\":\"address\"}],\"name\":\"setOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"vaiMintCap_\",\"type\":\"uint256\"}],\"name\":\"setVAIMintCap\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"venusTreasury_\",\"type\":\"address\"}],\"name\":\"setVenusTreasury\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"stableTknAmount\",\"type\":\"uint256\"}],\"name\":\"swapStableForVAI\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"stableTknAmount\",\"type\":\"uint256\"}],\"name\":\"swapVAIForStable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vaiMintCap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vaiMinted\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"venusTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus Protocol\",\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\"},\"initialize(address,address,address,uint256,uint256,uint256)\":{\"params\":{\"accessControlManager_\":\"The address of the AccessControlManager contract.\",\"feeIn_\":\"The percentage of fees to be applied to a stablecoin -> VAI swap.\",\"feeOut_\":\"The percentage of fees to be applied to a VAI -> stablecoin swap.\",\"oracleAddress_\":\"The address of the ResilientOracle contract.\",\"vaiMintCap_\":\"The cap for the total amount of VAI that can be minted.\",\"venusTreasury_\":\"The address where fees will be sent.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pause()\":{\"details\":\"Reverts if the contract is already paused.\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"previewSwapStableForVAI(uint256)\":{\"details\":\"This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.\",\"params\":{\"stableTknAmount\":\"The amount of stable tokens provided for the swap.\"},\"returns\":{\"_0\":\"The amount of VAI that would be sent to the receiver.\"}},\"previewSwapVAIForStable(uint256)\":{\"details\":\"This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.\",\"params\":{\"stableTknAmount\":\"The amount of stable tokens to be received after the swap.\"},\"returns\":{\"_0\":\"The amount of VAI that would be taken from the user.\"}},\"renounceOwnership()\":{\"details\":\"Disabling renounceOwnership function.\"},\"resume()\":{\"details\":\"Reverts if the contract is not paused.\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setFeeIn(uint256)\":{\"details\":\"Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).\",\"params\":{\"feeIn_\":\"The new fee percentage for incoming swaps.\"}},\"setFeeOut(uint256)\":{\"details\":\"Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).\",\"params\":{\"feeOut_\":\"The new fee percentage for outgoing swaps.\"}},\"setOracle(address)\":{\"details\":\"Reverts if the new address is zero.\",\"params\":{\"oracleAddress_\":\"The new address of the ResilientOracle contract.\"}},\"setVAIMintCap(uint256)\":{\"details\":\"Set the maximum amount of VAI that can be minted through this contract.\",\"params\":{\"vaiMintCap_\":\"The new maximum amount of VAI that can be minted.\"}},\"setVenusTreasury(address)\":{\"details\":\"Reverts if the new address is zero.\",\"params\":{\"venusTreasury_\":\"The new address of the Venus Treasury contract.\"}},\"swapStableForVAI(address,uint256)\":{\"details\":\"This function adds support to fee-on-transfer tokens. The actualTransferAmt is calculated, by recording token balance state before and after the transfer.\",\"params\":{\"receiver\":\"The address that will receive the VAI tokens.\",\"stableTknAmount\":\"The amount of stable tokens to be swapped.\"},\"returns\":{\"_0\":\"Amount of VAI minted to the sender.\"}},\"swapVAIForStable(address,uint256)\":{\"params\":{\"receiver\":\"The address where the stablecoin will be sent.\",\"stableTknAmount\":\"The amount of stable tokens to receive.\"},\"returns\":{\"_0\":\"The amount of VAI received and burnt from the sender.\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"}},\"stateVariables\":{\"ONE_DOLLAR\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\",\"details\":\"Our oracle is returning amount depending on the number of decimals of the stable token. (36 - asset_decimals) E.g. 8 decimal asset = 1e28.\"},\"STABLE_TOKEN_ADDRESS\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"VAI\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"}},\"title\":\"Peg Stability Contract.\",\"version\":1},\"userdoc\":{\"errors\":{\"AlreadyPaused()\":[{\"notice\":\"thrown when attempted to pause an already paused contract\"}],\"AmountTooSmall()\":[{\"notice\":\"thrown when fee calculation will result in rounding down to 0 due to stable token amount being a too small number\"}],\"InvalidFee()\":[{\"notice\":\"thrown when fee is >= 100%\"}],\"NotEnoughVAI()\":[{\"notice\":\"thrown when the user doesn't have enough VAI balance to provide for the amount of stable tokens he wishes to get\"}],\"NotPaused()\":[{\"notice\":\"thrown when attempted to resume the contract if it is already resumed\"}],\"Paused()\":[{\"notice\":\"thrown when contract is in paused state\"}],\"TooManyDecimals()\":[{\"notice\":\"thrown when stable token has more than 18 decimals\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"VAIMintCapReached()\":[{\"notice\":\"thrown when VAI to be minted will go beyond the mintCap threshold\"}],\"VAIMintedUnderflow()\":[{\"notice\":\"thrown when the amount of VAI to be burnt exceeds the vaiMinted amount\"}],\"VAITransferFail()\":[{\"notice\":\"thrown when the VAI transfer to treasury fails\"}],\"ZeroAddress()\":[{\"notice\":\"thrown when a zero address is passed as a function parameter\"}],\"ZeroAmount()\":[{\"notice\":\"thrown when a zero amount is passed as stable token amount parameter\"}]},\"events\":{\"FeeInChanged(uint256,uint256)\":{\"notice\":\"Event emitted when feeIn state var is modified.\"},\"FeeOutChanged(uint256,uint256)\":{\"notice\":\"Event emitted when feeOut state var is modified.\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"OracleChanged(address,address)\":{\"notice\":\"Event emitted when oracle state var is modified.\"},\"PSMPaused(address)\":{\"notice\":\"Event emitted when contract is paused.\"},\"PSMResumed(address)\":{\"notice\":\"Event emitted when the contract is resumed after pause.\"},\"StableForVAISwapped(uint256,uint256,uint256)\":{\"notice\":\"Event emitted when stable token is swapped for VAI.\"},\"VAIForStableSwapped(uint256,uint256,uint256)\":{\"notice\":\"Event emitted when stable token is swapped for VAI.\"},\"VAIMintCapChanged(uint256,uint256)\":{\"notice\":\"Event emitted when vaiMintCap state var is modified.\"},\"VenusTreasuryChanged(address,address)\":{\"notice\":\"Event emitted when venusTreasury state var is modified.\"}},\"kind\":\"user\",\"methods\":{\"BASIS_POINTS_DIVISOR()\":{\"notice\":\"The divisor used to convert fees to basis points.\"},\"MANTISSA_ONE()\":{\"notice\":\"The mantissa value representing 1 (used for calculations).\"},\"ONE_DOLLAR()\":{\"notice\":\"The value representing one dollar in the stable token.\"},\"STABLE_TOKEN_ADDRESS()\":{\"notice\":\"The address of the stable token contract.\"},\"VAI()\":{\"notice\":\"VAI token contract.\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"feeIn()\":{\"notice\":\"The incoming stableCoin fee. (Fee for swapStableForVAI).\"},\"feeOut()\":{\"notice\":\"The outgoing stableCoin fee. (Fee for swapVAIForStable).\"},\"initialize(address,address,address,uint256,uint256,uint256)\":{\"notice\":\"Initializes the contract via Proxy Contract with the required parameters.\"},\"isPaused()\":{\"notice\":\"A flag indicating whether the contract is currently paused or not.\"},\"oracle()\":{\"notice\":\"The address of ResilientOracle contract wrapped in its interface.\"},\"pause()\":{\"notice\":\"Pause the PSM contract.\"},\"previewSwapStableForVAI(uint256)\":{\"notice\":\"Calculates the amount of VAI that would be sent to the receiver.\"},\"previewSwapVAIForStable(uint256)\":{\"notice\":\"Calculates the amount of VAI that would be burnt from the user.\"},\"resume()\":{\"notice\":\"Resume the PSM contract.\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setFeeIn(uint256)\":{\"notice\":\"Set the fee percentage for incoming swaps.\"},\"setFeeOut(uint256)\":{\"notice\":\"Set the fee percentage for outgoing swaps.\"},\"setOracle(address)\":{\"notice\":\"Set the address of the ResilientOracle contract.\"},\"setVenusTreasury(address)\":{\"notice\":\"Set the address of the Venus Treasury contract.\"},\"swapStableForVAI(address,uint256)\":{\"notice\":\"Swaps stable tokens for VAI with fees.\"},\"swapVAIForStable(address,uint256)\":{\"notice\":\"Swaps VAI for a stable token.\"},\"vaiMintCap()\":{\"notice\":\"The maximum amount of VAI that can be minted through this contract.\"},\"vaiMinted()\":{\"notice\":\"The total amount of VAI minted through this contract.\"},\"venusTreasury()\":{\"notice\":\"The address of the Venus Treasury contract.\"}},\"notice\":\"Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/PegStability/PegStability.sol\":\"PegStability\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xb82ef33f43b6b96109687d91b39c94573fdccaaa423fe28e8ba0977b31c023e0\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x605434219ebbe4653f703640f06969faa5a1d78f0bfef878e5ddbb1ca369ceeb\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xd60f939a3ca0199014d079b4dd66aa757954334947d81eb5c1d35d7a83061ab3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to\\n * 0 before setting it to a non-zero value.\\n */\\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20PermitUpgradeable token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x4dae161227d332808312ee2caf6384929321b83c16cc89b5642985fbec6b814c\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n *\\n * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title Venus Access Control Contract.\\n * @dev The AccessControlledV8 contract is a wrapper around the OpenZeppelin AccessControl contract\\n * It provides a standardized way to control access to methods within the Venus Smart Contract Ecosystem.\\n * The contract allows the owner to set an AccessControlManager contract address.\\n * It can restrict method calls based on the sender's role and the method's signature.\\n */\\n\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x618d942756b93e02340a42f3c80aa99fc56be1a96861f5464dc23a76bf30b3a5\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x41deef84d1839590b243b66506691fde2fb938da01eabde53e82d3b8316fdaf9\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface OracleInterface {\\n function getPrice(address asset) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n\\n function updateAssetPrice(address asset) external;\\n\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address asset) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address asset,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x40031b19684ca0c912e794d08c2c0b0d8be77d3c1bdc937830a0658eff899650\",\"license\":\"BSD-3-Clause\"},\"contracts/PegStability/IVAI.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface IVAI {\\n function balanceOf(address usr) external returns (uint256);\\n\\n function transferFrom(address src, address dst, uint amount) external returns (bool);\\n\\n function mint(address usr, uint wad) external;\\n\\n function burn(address usr, uint wad) external;\\n}\\n\",\"keccak256\":\"0xfd649f7a8201c7568f5224c41ec60b969222f66d266102c6783efae7b11a330d\",\"license\":\"BSD-3-Clause\"},\"contracts/PegStability/PegStability.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { ResilientOracleInterface } from \\\"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\\\";\\nimport { IVAI } from \\\"./IVAI.sol\\\";\\n\\n/**\\n * @title Peg Stability Contract.\\n * @notice Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.\\n * @author Venus Protocol\\n */\\ncontract PegStability is AccessControlledV8, ReentrancyGuardUpgradeable {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n // Helper enum for calculation of the fee.\\n enum FeeDirection {\\n IN,\\n OUT\\n }\\n\\n /// @notice The divisor used to convert fees to basis points.\\n uint256 public constant BASIS_POINTS_DIVISOR = 10000;\\n\\n /// @notice The mantissa value representing 1 (used for calculations).\\n uint256 public constant MANTISSA_ONE = 1e18;\\n\\n /// @notice The value representing one dollar in the stable token.\\n /// @dev Our oracle is returning amount depending on the number of decimals of the stable token. (36 - asset_decimals) E.g. 8 decimal asset = 1e28.\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n uint256 public immutable ONE_DOLLAR;\\n\\n /// @notice VAI token contract.\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n IVAI public immutable VAI;\\n\\n /// @notice The address of the stable token contract.\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable STABLE_TOKEN_ADDRESS;\\n\\n /// @notice The address of ResilientOracle contract wrapped in its interface.\\n ResilientOracleInterface public oracle;\\n\\n /// @notice The address of the Venus Treasury contract.\\n address public venusTreasury;\\n\\n /// @notice The incoming stableCoin fee. (Fee for swapStableForVAI).\\n uint256 public feeIn;\\n\\n /// @notice The outgoing stableCoin fee. (Fee for swapVAIForStable).\\n uint256 public feeOut;\\n\\n /// @notice The maximum amount of VAI that can be minted through this contract.\\n uint256 public vaiMintCap;\\n\\n /// @notice The total amount of VAI minted through this contract.\\n uint256 public vaiMinted;\\n\\n /// @notice A flag indicating whether the contract is currently paused or not.\\n bool public isPaused;\\n\\n /// @notice Event emitted when contract is paused.\\n event PSMPaused(address indexed admin);\\n\\n /// @notice Event emitted when the contract is resumed after pause.\\n event PSMResumed(address indexed admin);\\n\\n /// @notice Event emitted when feeIn state var is modified.\\n event FeeInChanged(uint256 oldFeeIn, uint256 newFeeIn);\\n\\n /// @notice Event emitted when feeOut state var is modified.\\n event FeeOutChanged(uint256 oldFeeOut, uint256 newFeeOut);\\n\\n /// @notice Event emitted when vaiMintCap state var is modified.\\n event VAIMintCapChanged(uint256 oldCap, uint256 newCap);\\n\\n /// @notice Event emitted when venusTreasury state var is modified.\\n event VenusTreasuryChanged(address indexed oldTreasury, address indexed newTreasury);\\n\\n /// @notice Event emitted when oracle state var is modified.\\n event OracleChanged(address indexed oldOracle, address indexed newOracle);\\n\\n /// @notice Event emitted when stable token is swapped for VAI.\\n event StableForVAISwapped(uint256 stableIn, uint256 vaiOut, uint256 fee);\\n\\n /// @notice Event emitted when stable token is swapped for VAI.\\n event VAIForStableSwapped(uint256 vaiBurnt, uint256 stableOut, uint256 vaiFee);\\n\\n /// @notice thrown when contract is in paused state\\n error Paused();\\n\\n /// @notice thrown when attempted to pause an already paused contract\\n error AlreadyPaused();\\n\\n /// @notice thrown when attempted to resume the contract if it is already resumed\\n error NotPaused();\\n\\n /// @notice thrown when stable token has more than 18 decimals\\n error TooManyDecimals();\\n\\n /// @notice thrown when fee is >= 100%\\n error InvalidFee();\\n\\n /// @notice thrown when a zero address is passed as a function parameter\\n error ZeroAddress();\\n\\n /// @notice thrown when a zero amount is passed as stable token amount parameter\\n error ZeroAmount();\\n\\n /// @notice thrown when the user doesn't have enough VAI balance to provide for the amount of stable tokens he wishes to get\\n error NotEnoughVAI();\\n\\n /// @notice thrown when the amount of VAI to be burnt exceeds the vaiMinted amount\\n error VAIMintedUnderflow();\\n\\n /// @notice thrown when the VAI transfer to treasury fails\\n error VAITransferFail();\\n\\n /// @notice thrown when VAI to be minted will go beyond the mintCap threshold\\n error VAIMintCapReached();\\n /// @notice thrown when fee calculation will result in rounding down to 0 due to stable token amount being a too small number\\n error AmountTooSmall();\\n\\n /**\\n * @dev Prevents functions to execute when contract is paused.\\n */\\n modifier isActive() {\\n if (isPaused) revert Paused();\\n _;\\n }\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address stableTokenAddress_, address vaiAddress_) {\\n _ensureNonzeroAddress(stableTokenAddress_);\\n _ensureNonzeroAddress(vaiAddress_);\\n\\n uint256 decimals_ = IERC20MetadataUpgradeable(stableTokenAddress_).decimals();\\n\\n if (decimals_ > 18) {\\n revert TooManyDecimals();\\n }\\n\\n ONE_DOLLAR = 10 ** (36 - decimals_); // 1$ scaled to the decimals returned by our Oracle\\n STABLE_TOKEN_ADDRESS = stableTokenAddress_;\\n VAI = IVAI(vaiAddress_);\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Initializes the contract via Proxy Contract with the required parameters.\\n * @param accessControlManager_ The address of the AccessControlManager contract.\\n * @param venusTreasury_ The address where fees will be sent.\\n * @param oracleAddress_ The address of the ResilientOracle contract.\\n * @param feeIn_ The percentage of fees to be applied to a stablecoin -> VAI swap.\\n * @param feeOut_ The percentage of fees to be applied to a VAI -> stablecoin swap.\\n * @param vaiMintCap_ The cap for the total amount of VAI that can be minted.\\n */\\n function initialize(\\n address accessControlManager_,\\n address venusTreasury_,\\n address oracleAddress_,\\n uint256 feeIn_,\\n uint256 feeOut_,\\n uint256 vaiMintCap_\\n ) external initializer {\\n _ensureNonzeroAddress(accessControlManager_);\\n _ensureNonzeroAddress(venusTreasury_);\\n _ensureNonzeroAddress(oracleAddress_);\\n __AccessControlled_init(accessControlManager_);\\n __ReentrancyGuard_init();\\n\\n if (feeIn_ >= BASIS_POINTS_DIVISOR || feeOut_ >= BASIS_POINTS_DIVISOR) {\\n revert InvalidFee();\\n }\\n\\n feeIn = feeIn_;\\n feeOut = feeOut_;\\n vaiMintCap = vaiMintCap_;\\n venusTreasury = venusTreasury_;\\n oracle = ResilientOracleInterface(oracleAddress_);\\n }\\n\\n /*** Swap Functions ***/\\n\\n /**\\n * @notice Swaps VAI for a stable token.\\n * @param receiver The address where the stablecoin will be sent.\\n * @param stableTknAmount The amount of stable tokens to receive.\\n * @return The amount of VAI received and burnt from the sender.\\n */\\n // @custom:event Emits VAIForStableSwapped event.\\n function swapVAIForStable(\\n address receiver,\\n uint256 stableTknAmount\\n ) external isActive nonReentrant returns (uint256) {\\n _ensureNonzeroAddress(receiver);\\n _ensureNonzeroAmount(stableTknAmount);\\n\\n // update oracle price and calculate USD value of the stable token amount scaled in 18 decimals\\n oracle.updateAssetPrice(STABLE_TOKEN_ADDRESS);\\n uint256 stableTknAmountUSD = _previewTokenUSDAmount(stableTknAmount, FeeDirection.OUT);\\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.OUT);\\n\\n if (VAI.balanceOf(msg.sender) < stableTknAmountUSD + fee) {\\n revert NotEnoughVAI();\\n }\\n if (vaiMinted < stableTknAmountUSD) {\\n revert VAIMintedUnderflow();\\n }\\n\\n unchecked {\\n vaiMinted -= stableTknAmountUSD;\\n }\\n\\n if (fee != 0) {\\n bool success = VAI.transferFrom(msg.sender, venusTreasury, fee);\\n if (!success) {\\n revert VAITransferFail();\\n }\\n }\\n\\n VAI.burn(msg.sender, stableTknAmountUSD);\\n IERC20Upgradeable(STABLE_TOKEN_ADDRESS).safeTransfer(receiver, stableTknAmount);\\n emit VAIForStableSwapped(stableTknAmountUSD, stableTknAmount, fee);\\n return stableTknAmountUSD;\\n }\\n\\n /**\\n * @notice Swaps stable tokens for VAI with fees.\\n * @dev This function adds support to fee-on-transfer tokens. The actualTransferAmt is calculated, by recording token balance state before and after the transfer.\\n * @param receiver The address that will receive the VAI tokens.\\n * @param stableTknAmount The amount of stable tokens to be swapped.\\n * @return Amount of VAI minted to the sender.\\n */\\n // @custom:event Emits StableForVAISwapped event.\\n function swapStableForVAI(\\n address receiver,\\n uint256 stableTknAmount\\n ) external isActive nonReentrant returns (uint256) {\\n _ensureNonzeroAddress(receiver);\\n _ensureNonzeroAmount(stableTknAmount);\\n // transfer IN, supporting fee-on-transfer tokens\\n uint256 balanceBefore = IERC20Upgradeable(STABLE_TOKEN_ADDRESS).balanceOf(address(this));\\n IERC20Upgradeable(STABLE_TOKEN_ADDRESS).safeTransferFrom(msg.sender, address(this), stableTknAmount);\\n uint256 balanceAfter = IERC20Upgradeable(STABLE_TOKEN_ADDRESS).balanceOf(address(this));\\n\\n //calculate actual transfered amount (in case of fee-on-transfer tokens)\\n uint256 actualTransferAmt = balanceAfter - balanceBefore;\\n\\n // update oracle price and calculate USD value of the stable token amount scaled in 18 decimals\\n oracle.updateAssetPrice(STABLE_TOKEN_ADDRESS);\\n uint256 actualTransferAmtInUSD = _previewTokenUSDAmount(actualTransferAmt, FeeDirection.IN);\\n\\n //calculate feeIn\\n uint256 fee = _calculateFee(actualTransferAmtInUSD, FeeDirection.IN);\\n uint256 vaiToMint = actualTransferAmtInUSD - fee;\\n\\n if (vaiMinted + actualTransferAmtInUSD > vaiMintCap) {\\n revert VAIMintCapReached();\\n }\\n unchecked {\\n vaiMinted += actualTransferAmtInUSD;\\n }\\n\\n // mint VAI to receiver\\n VAI.mint(receiver, vaiToMint);\\n\\n // mint VAI fee to venus treasury\\n if (fee != 0) {\\n VAI.mint(venusTreasury, fee);\\n }\\n\\n emit StableForVAISwapped(actualTransferAmt, vaiToMint, fee);\\n return vaiToMint;\\n }\\n\\n /*** Admin Functions ***/\\n\\n /**\\n * @notice Pause the PSM contract.\\n * @dev Reverts if the contract is already paused.\\n */\\n // @custom:event Emits PSMPaused event.\\n function pause() external {\\n _checkAccessAllowed(\\\"pause()\\\");\\n if (isPaused) {\\n revert AlreadyPaused();\\n }\\n isPaused = true;\\n emit PSMPaused(msg.sender);\\n }\\n\\n /**\\n * @notice Resume the PSM contract.\\n * @dev Reverts if the contract is not paused.\\n */\\n // @custom:event Emits PSMResumed event.\\n function resume() external {\\n _checkAccessAllowed(\\\"resume()\\\");\\n if (!isPaused) {\\n revert NotPaused();\\n }\\n isPaused = false;\\n emit PSMResumed(msg.sender);\\n }\\n\\n /**\\n * @notice Set the fee percentage for incoming swaps.\\n * @dev Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).\\n * @param feeIn_ The new fee percentage for incoming swaps.\\n */\\n // @custom:event Emits FeeInChanged event.\\n function setFeeIn(uint256 feeIn_) external {\\n _checkAccessAllowed(\\\"setFeeIn(uint256)\\\");\\n // feeIn = 10000 = 100%\\n if (feeIn_ >= BASIS_POINTS_DIVISOR) {\\n revert InvalidFee();\\n }\\n uint256 oldFeeIn = feeIn;\\n feeIn = feeIn_;\\n emit FeeInChanged(oldFeeIn, feeIn_);\\n }\\n\\n /**\\n * @notice Set the fee percentage for outgoing swaps.\\n * @dev Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).\\n * @param feeOut_ The new fee percentage for outgoing swaps.\\n */\\n // @custom:event Emits FeeOutChanged event.\\n function setFeeOut(uint256 feeOut_) external {\\n _checkAccessAllowed(\\\"setFeeOut(uint256)\\\");\\n // feeOut = 10000 = 100%\\n if (feeOut_ >= BASIS_POINTS_DIVISOR) {\\n revert InvalidFee();\\n }\\n uint256 oldFeeOut = feeOut;\\n feeOut = feeOut_;\\n emit FeeOutChanged(oldFeeOut, feeOut_);\\n }\\n\\n /**\\n * @dev Set the maximum amount of VAI that can be minted through this contract.\\n * @param vaiMintCap_ The new maximum amount of VAI that can be minted.\\n */\\n // @custom:event Emits VAIMintCapChanged event.\\n function setVAIMintCap(uint256 vaiMintCap_) external {\\n _checkAccessAllowed(\\\"setVAIMintCap(uint256)\\\");\\n uint256 oldVAIMintCap = vaiMintCap;\\n vaiMintCap = vaiMintCap_;\\n emit VAIMintCapChanged(oldVAIMintCap, vaiMintCap_);\\n }\\n\\n /**\\n * @notice Set the address of the Venus Treasury contract.\\n * @dev Reverts if the new address is zero.\\n * @param venusTreasury_ The new address of the Venus Treasury contract.\\n */\\n // @custom:event Emits VenusTreasuryChanged event.\\n function setVenusTreasury(address venusTreasury_) external {\\n _checkAccessAllowed(\\\"setVenusTreasury(address)\\\");\\n _ensureNonzeroAddress(venusTreasury_);\\n address oldTreasuryAddress = venusTreasury;\\n venusTreasury = venusTreasury_;\\n emit VenusTreasuryChanged(oldTreasuryAddress, venusTreasury_);\\n }\\n\\n /**\\n * @notice Set the address of the ResilientOracle contract.\\n * @dev Reverts if the new address is zero.\\n * @param oracleAddress_ The new address of the ResilientOracle contract.\\n */\\n // @custom:event Emits OracleChanged event.\\n function setOracle(address oracleAddress_) external {\\n _checkAccessAllowed(\\\"setOracle(address)\\\");\\n _ensureNonzeroAddress(oracleAddress_);\\n address oldOracleAddress = address(oracle);\\n oracle = ResilientOracleInterface(oracleAddress_);\\n emit OracleChanged(oldOracleAddress, oracleAddress_);\\n }\\n\\n /**\\n * @dev Disabling renounceOwnership function.\\n */\\n function renounceOwnership() public override {}\\n\\n /*** Helper Functions ***/\\n\\n /**\\n * @notice Calculates the amount of VAI that would be burnt from the user.\\n * @dev This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.\\n * @param stableTknAmount The amount of stable tokens to be received after the swap.\\n * @return The amount of VAI that would be taken from the user.\\n */\\n function previewSwapVAIForStable(uint256 stableTknAmount) external view returns (uint256) {\\n _ensureNonzeroAmount(stableTknAmount);\\n uint256 stableTknAmountUSD = _previewTokenUSDAmount(stableTknAmount, FeeDirection.OUT);\\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.OUT);\\n\\n if (vaiMinted < stableTknAmountUSD) {\\n revert VAIMintedUnderflow();\\n }\\n\\n return stableTknAmountUSD + fee;\\n }\\n\\n /**\\n * @notice Calculates the amount of VAI that would be sent to the receiver.\\n * @dev This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.\\n * @param stableTknAmount The amount of stable tokens provided for the swap.\\n * @return The amount of VAI that would be sent to the receiver.\\n */\\n function previewSwapStableForVAI(uint256 stableTknAmount) external view returns (uint256) {\\n _ensureNonzeroAmount(stableTknAmount);\\n uint256 stableTknAmountUSD = _previewTokenUSDAmount(stableTknAmount, FeeDirection.IN);\\n\\n //calculate feeIn\\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.IN);\\n uint256 vaiToMint = stableTknAmountUSD - fee;\\n\\n if (vaiMinted + stableTknAmountUSD > vaiMintCap) {\\n revert VAIMintCapReached();\\n }\\n\\n return vaiToMint;\\n }\\n\\n /**\\n * @dev Calculates the USD value of the given amount of stable tokens depending on the swap direction.\\n * @param amount The amount of stable tokens.\\n * @param direction The direction of the swap.\\n * @return The USD value of the given amount of stable tokens scaled by 1e18 taking into account the direction of the swap\\n */\\n function _previewTokenUSDAmount(uint256 amount, FeeDirection direction) internal view returns (uint256) {\\n return (amount * _getPriceInUSD(direction)) / MANTISSA_ONE;\\n }\\n\\n /**\\n * @notice Get the price of stable token in USD.\\n * @dev This function returns either min(1$,oraclePrice) or max(1$,oraclePrice) with a decimal scale (36 - asset_decimals). E.g. for 8 decimal token 1$ will be 1e28.\\n * @param direction The direction of the swap: FeeDirection.IN or FeeDirection.OUT.\\n * @return The price in USD, adjusted based on the selected direction.\\n */\\n function _getPriceInUSD(FeeDirection direction) internal view returns (uint256) {\\n // get price with a scale = (36 - asset_decimals)\\n uint256 price = oracle.getPrice(STABLE_TOKEN_ADDRESS);\\n\\n if (direction == FeeDirection.IN) {\\n // MIN(1, price)\\n return price < ONE_DOLLAR ? price : ONE_DOLLAR;\\n } else {\\n // MAX(1, price)\\n return price > ONE_DOLLAR ? price : ONE_DOLLAR;\\n }\\n }\\n\\n /**\\n * @notice Calculate the fee amount based on the input amount and fee percentage.\\n * @dev Reverts if the fee percentage calculation results in rounding down to 0.\\n * @param amount The input amount to calculate the fee from.\\n * @param direction The direction of the fee: FeeDirection.IN or FeeDirection.OUT.\\n * @return The fee amount.\\n */\\n function _calculateFee(uint256 amount, FeeDirection direction) internal view returns (uint256) {\\n uint256 feePercent;\\n if (direction == FeeDirection.IN) {\\n feePercent = feeIn;\\n } else {\\n feePercent = feeOut;\\n }\\n if (feePercent == 0) {\\n return 0;\\n } else {\\n // checking if the percent calculation will result in rounding down to 0\\n if (amount * feePercent < BASIS_POINTS_DIVISOR) {\\n revert AmountTooSmall();\\n }\\n return (amount * feePercent) / BASIS_POINTS_DIVISOR;\\n }\\n }\\n\\n /**\\n * @notice Checks that the address is not the zero address.\\n * @param someone The address to check.\\n */\\n function _ensureNonzeroAddress(address someone) private pure {\\n if (someone == address(0)) revert ZeroAddress();\\n }\\n\\n /**\\n * @notice Checks that the amount passed as stable tokens is bigger than zero\\n * @param amount The amount to validate\\n */\\n function _ensureNonzeroAmount(uint256 amount) private pure {\\n if (amount == 0) revert ZeroAmount();\\n }\\n}\\n\",\"keccak256\":\"0x38ec1c0980e7ceed082321e1018941322a8a83f3f1845ddd89d96a93ea3cf42c\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", + "bytecode": "0x60e06040523480156200001157600080fd5b506040516200235638038062002356833981016040819052620000349162000225565b6200003f826200011c565b6200004a816200011c565b6000826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200008b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000b191906200025d565b60ff1690506012811115620000d9576040516330e571f960e11b815260040160405180910390fd5b620000e68160246200029f565b620000f390600a620003b8565b6080526001600160a01b0380841660c052821660a0526200011362000147565b505050620003c6565b6001600160a01b038116620001445760405163d92e233d60e01b815260040160405180910390fd5b50565b600054610100900460ff1615620001b45760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161462000206576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b80516001600160a01b03811681146200022057600080fd5b919050565b600080604083850312156200023957600080fd5b620002448362000208565b9150620002546020840162000208565b90509250929050565b6000602082840312156200027057600080fd5b815160ff811681146200028257600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600082821015620002b457620002b462000289565b500390565b600181815b80851115620002fa578160001904821115620002de57620002de62000289565b80851615620002ec57918102915b93841c9390800290620002be565b509250929050565b6000826200031357506001620003b2565b816200032257506000620003b2565b81600181146200033b5760028114620003465762000366565b6001915050620003b2565b60ff8411156200035a576200035a62000289565b50506001821b620003b2565b5060208310610133831016604e8410600b84101617156200038b575081810a620003b2565b620003978383620002b9565b8060001904821115620003ae57620003ae62000289565b0290505b92915050565b600062000282838362000302565b60805160a05160c051611ef0620004666000396000818161033c0152818161051d015281816107d801528181610e9c01528181610f1e01528181610f5e01528181610ff90152611756015260008181610363015281816105bf015281816106bc01528181610767015281816110ec0152611179015260008181610287015281816117eb0152818161181201528181611838015261185f0152611ef06000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c80637adbf9731161010f578063b187bd26116100a2578063e2608fba11610071578063e2608fba146103f6578063e30c397814610409578063f23c0f401461041a578063f2fde38b1461042957600080fd5b8063b187bd26146103ab578063b4a0bdf3146103c9578063d97c057d146103da578063dd081268146103e357600080fd5b80638ec2b239116100de5780638ec2b2391461033757806398f44cd11461035e578063a52f540c14610385578063a589e98a1461039857600080fd5b80637adbf973146102f85780637dc0d1d01461030b5780638456cb591461031e5780638da5cb5b1461032657600080fd5b806342e8a97211610187578063715018a611610156578063715018a6146101f2578063728cdbca146102d4578063769a48d9146102e757806379ba5097146102f057600080fd5b806342e8a9721461025c57806355725d411461026f578063572ca9e714610282578063586f9933146102a957600080fd5b80630e32cb86116101c35780630e32cb8614610223578063126082cf14610236578063187e28bd1461023f57806340a1dd461461025257600080fd5b8063046f7da2146101ea5780630696819f146101f45780630d35d2ed14610210575b600080fd5b6101f261043c565b005b6101fd60fe5481565b6040519081526020015b60405180910390f35b6101fd61021e366004611bfb565b6104c1565b6101f2610231366004611c25565b610855565b6101fd61271081565b6101fd61024d366004611c40565b610869565b6101fd6101005481565b6101f261026a366004611c40565b6108c8565b6101f261027d366004611c40565b610963565b6101fd7f000000000000000000000000000000000000000000000000000000000000000081565b60fc546102bc906001600160a01b031681565b6040516001600160a01b039091168152602001610207565b6101f26102e2366004611c59565b6109f7565b6101fd60fd5481565b6101f2610ba7565b6101f2610306366004611c25565b610c1e565b60fb546102bc906001600160a01b031681565b6101f2610cac565b6033546001600160a01b03166102bc565b6102bc7f000000000000000000000000000000000000000000000000000000000000000081565b6102bc7f000000000000000000000000000000000000000000000000000000000000000081565b6101f2610393366004611c25565b610d34565b6101f26103a6366004611c40565b610dcd565b610101546103b99060ff1681565b6040519015158152602001610207565b6097546001600160a01b03166102bc565b6101fd60ff5481565b6101fd6103f1366004611bfb565b610e42565b6101fd610404366004611c40565b61122a565b6065546001600160a01b03166102bc565b6101fd670de0b6b3a764000081565b6101f2610437366004611c25565b611292565b61046560405180604001604052806008815260200167726573756d65282960c01b815250611303565b6101015460ff1661048957604051636cd6020160e01b815260040160405180910390fd5b610101805460ff1916905560405133907f108589e68122bb4da8e5020c44387cab025243d0894392e275459641a90181a290600090a2565b6101015460009060ff16156104e9576040516313d0ff5960e31b815260040160405180910390fd5b6104f16113a1565b6104fa836113fa565b61050382611421565b60fb5460405163b62cad6960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301529091169063b62cad6990602401600060405180830381600087803b15801561056a57600080fd5b505af115801561057e573d6000803e3d6000fd5b50505050600061058f836001611442565b9050600061059e826001611471565b90506105aa8183611cce565b6040516370a0823160e01b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a08231906024016020604051808303816000875af1158015610610573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106349190611ce6565b1015610656576040516001629d12e360e01b0319815260040160405180910390fd5b8161010054101561067a5760405163a5047e9560e01b815260040160405180910390fd5b61010080548390039055801561074b5760fc546040516323b872dd60e01b81523360048201526001600160a01b039182166024820152604481018390526000917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610705573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107299190611cff565b9050806107495760405163aba1276560e01b815260040160405180910390fd5b505b604051632770a7eb60e21b8152336004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639dc29fac90604401600060405180830381600087803b1580156107b357600080fd5b505af11580156107c7573d6000803e3d6000fd5b506108019250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016905086866114f7565b60408051838152602081018690529081018290527f031e3397b091e3298ff850e89e965fe3543a0c64eb93659927433b06545f3f629060600160405180910390a150905061084f600160c955565b92915050565b61085d611566565b610866816115c0565b50565b600061087482611421565b6000610881836001611442565b90506000610890826001611471565b9050816101005410156108b65760405163a5047e9560e01b815260040160405180910390fd5b6108c08183611cce565b949350505050565b6108fb604051806040016040528060128152602001717365744665654f75742875696e743235362960701b815250611303565b612710811061091d576040516358d620b360e01b815260040160405180910390fd5b60fe80549082905560408051828152602081018490527fdc61767cf6b8f2d5ec16cd975db6d3a79fc69dc428b04c93e8db271de5e43b9f91015b60405180910390a15050565b61099560405180604001604052806011815260200170736574466565496e2875696e743235362960781b815250611303565b61271081106109b7576040516358d620b360e01b815260040160405180910390fd5b60fd80549082905560408051828152602081018490527fb76804f9786a4411a614b09a8211b2fd86f1f5b7a5e4410f35aa1578aac64e049101610957565b565b600054610100900460ff1615808015610a175750600054600160ff909116105b80610a315750303b158015610a31575060005460ff166001145b610a995760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610abc576000805461ff0019166101001790555b610ac5876113fa565b610ace866113fa565b610ad7856113fa565b610ae08761167e565b610ae86116b6565b61271084101580610afb57506127108310155b15610b19576040516358d620b360e01b815260040160405180910390fd5b60fd84905560fe83905560ff82905560fc80546001600160a01b038089166001600160a01b03199283161790925560fb8054928816929091169190911790558015610b9e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b60655433906001600160a01b03168114610c155760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401610a90565b610866816116e5565b610c51604051806040016040528060128152602001717365744f7261636c6528616464726573732960701b815250611303565b610c5a816113fa565b60fb80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f05cd89403c6bdeac21c2ff33de395121a31fa1bc2bf3adf4825f1f86e79969dd90600090a35050565b610cd4604051806040016040528060078152602001667061757365282960c81b815250611303565b6101015460ff1615610cf957604051631785c68160e01b815260040160405180910390fd5b610101805460ff1916600117905560405133907fb7aabc84a8f1fe9971d4bfffb4bb336af2c63e547360dd116940dc70da8159e190600090a2565b610d726040518060400160405280601981526020017f73657456656e7573547265617375727928616464726573732900000000000000815250611303565b610d7b816113fa565b60fc80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f35655f8f1a1f8b7ff254ff70c675c0a26ddcb3da6cb6decd491ecdee167e220b90600090a35050565b610e04604051806040016040528060168152602001757365745641494d696e744361702875696e743235362960501b815250611303565b60ff80549082905560408051828152602081018490527f0f43249751c1ca8dedff5711840ef91871f6fc2ce9b3891c1f33f4163ba1a9a39101610957565b6101015460009060ff1615610e6a576040516313d0ff5960e31b815260040160405180910390fd5b610e726113a1565b610e7b836113fa565b610e8482611421565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610eeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0f9190611ce6565b9050610f466001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330866116fe565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610fad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd19190611ce6565b90506000610fdf8383611d21565b60fb5460405163b62cad6960e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015292935091169063b62cad6990602401600060405180830381600087803b15801561104857600080fd5b505af115801561105c573d6000803e3d6000fd5b50505050600061106d826000611442565b9050600061107c826000611471565b9050600061108a8284611d21565b905060ff54836101005461109e9190611cce565b11156110bd576040516313d3ad1560e31b815260040160405180910390fd5b6101008054840190556040516340c10f1960e01b81526001600160a01b038a81166004830152602482018390527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b15801561113057600080fd5b505af1158015611144573d6000803e3d6000fd5b50505050816000146111d85760fc546040516340c10f1960e01b81526001600160a01b039182166004820152602481018490527f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b1580156111bf57600080fd5b505af11580156111d3573d6000803e3d6000fd5b505050505b60408051858152602081018390529081018390527f018e5c6d7bd9e0cafe3512ff02488f4c0ce3524a684e1097aab74666bf4fd00f9060600160405180910390a19550505050505061084f600160c955565b600061123582611421565b6000611242836000611442565b90506000611251826000611471565b9050600061125f8284611d21565b905060ff5483610100546112739190611cce565b11156108c0576040516313d3ad1560e31b815260040160405180910390fd5b61129a611566565b606580546001600160a01b0383166001600160a01b031990911681179091556112cb6033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6097546040516318c5e8ab60e01b81526000916001600160a01b0316906318c5e8ab906113369033908690600401611d90565b602060405180830381865afa158015611353573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113779190611cff565b90508061139d57333083604051634a3fa29360e01b8152600401610a9093929190611db4565b5050565b600260c954036113f35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a90565b600260c955565b6001600160a01b0381166108665760405163d92e233d60e01b815260040160405180910390fd5b8060000361086657604051631f2a200560e01b815260040160405180910390fd5b6000670de0b6b3a76400006114568361173c565b6114609085611de9565b61146a9190611e08565b9392505050565b6000808083600181111561148757611487611e2a565b03611495575060fd5461149a565b5060fe545b806000036114ac57600091505061084f565b6127106114b98286611de9565b10156114d85760405163617ab12d60e11b815260040160405180910390fd5b6127106114e58286611de9565b6114ef9190611e08565b91505061084f565b6040516001600160a01b03831660248201526044810182905261155a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611883565b505050565b600160c955565b6033546001600160a01b031633146109f55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a90565b6001600160a01b0381166116245760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e61676572206164604482015264647265737360d81b6064820152608401610a90565b609780546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa09101610957565b600054610100900460ff166116a55760405162461bcd60e51b8152600401610a9090611e40565b6116ad611958565b61086681611987565b600054610100900460ff166116dd5760405162461bcd60e51b8152600401610a9090611e40565b6109f56119ae565b606580546001600160a01b0319169055610866816119d5565b6040516001600160a01b03808516602483015283166044820152606481018290526117369085906323b872dd60e01b90608401611523565b50505050565b60fb546040516341976e0960e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260009283929116906341976e0990602401602060405180830381865afa1580156117aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ce9190611ce6565b905060008360018111156117e4576117e4611e2a565b03611836577f0000000000000000000000000000000000000000000000000000000000000000811061084f577f000000000000000000000000000000000000000000000000000000000000000061146a565b7f0000000000000000000000000000000000000000000000000000000000000000811161084f577f000000000000000000000000000000000000000000000000000000000000000061146a565b60006118d8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a279092919063ffffffff16565b90508051600014806118f95750808060200190518101906118f99190611cff565b61155a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a90565b600054610100900460ff1661197f5760405162461bcd60e51b8152600401610a9090611e40565b6109f5611a36565b600054610100900460ff1661085d5760405162461bcd60e51b8152600401610a9090611e40565b600054610100900460ff1661155f5760405162461bcd60e51b8152600401610a9090611e40565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606108c08484600085611a66565b600054610100900460ff16611a5d5760405162461bcd60e51b8152600401610a9090611e40565b6109f5336116e5565b606082471015611ac75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610a90565b600080866001600160a01b03168587604051611ae39190611e8b565b60006040518083038185875af1925050503d8060008114611b20576040519150601f19603f3d011682016040523d82523d6000602084013e611b25565b606091505b5091509150611b3687838387611b41565b979650505050505050565b60608315611bb0578251600003611ba9576001600160a01b0385163b611ba95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a90565b50816108c0565b6108c08383815115611bc55781518083602001fd5b8060405162461bcd60e51b8152600401610a909190611ea7565b80356001600160a01b0381168114611bf657600080fd5b919050565b60008060408385031215611c0e57600080fd5b611c1783611bdf565b946020939093013593505050565b600060208284031215611c3757600080fd5b61146a82611bdf565b600060208284031215611c5257600080fd5b5035919050565b60008060008060008060c08789031215611c7257600080fd5b611c7b87611bdf565b9550611c8960208801611bdf565b9450611c9760408801611bdf565b9350606087013592506080870135915060a087013590509295509295509295565b634e487b7160e01b600052601160045260246000fd5b60008219821115611ce157611ce1611cb8565b500190565b600060208284031215611cf857600080fd5b5051919050565b600060208284031215611d1157600080fd5b8151801515811461146a57600080fd5b600082821015611d3357611d33611cb8565b500390565b60005b83811015611d53578181015183820152602001611d3b565b838111156117365750506000910152565b60008151808452611d7c816020860160208601611d38565b601f01601f19169290920160200192915050565b6001600160a01b03831681526040602082018190526000906108c090830184611d64565b6001600160a01b03848116825283166020820152606060408201819052600090611de090830184611d64565b95945050505050565b6000816000190483118215151615611e0357611e03611cb8565b500290565b600082611e2557634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052602160045260246000fd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008251611e9d818460208701611d38565b9190910192915050565b60208152600061146a6020830184611d6456fea2646970667358221220776bae9a01444556f49e135e272e6d666dc0b437dde23f690af77c95ce44ac9b64736f6c634300080d0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101e55760003560e01c80637adbf9731161010f578063b187bd26116100a2578063e2608fba11610071578063e2608fba146103f6578063e30c397814610409578063f23c0f401461041a578063f2fde38b1461042957600080fd5b8063b187bd26146103ab578063b4a0bdf3146103c9578063d97c057d146103da578063dd081268146103e357600080fd5b80638ec2b239116100de5780638ec2b2391461033757806398f44cd11461035e578063a52f540c14610385578063a589e98a1461039857600080fd5b80637adbf973146102f85780637dc0d1d01461030b5780638456cb591461031e5780638da5cb5b1461032657600080fd5b806342e8a97211610187578063715018a611610156578063715018a6146101f2578063728cdbca146102d4578063769a48d9146102e757806379ba5097146102f057600080fd5b806342e8a9721461025c57806355725d411461026f578063572ca9e714610282578063586f9933146102a957600080fd5b80630e32cb86116101c35780630e32cb8614610223578063126082cf14610236578063187e28bd1461023f57806340a1dd461461025257600080fd5b8063046f7da2146101ea5780630696819f146101f45780630d35d2ed14610210575b600080fd5b6101f261043c565b005b6101fd60fe5481565b6040519081526020015b60405180910390f35b6101fd61021e366004611bfb565b6104c1565b6101f2610231366004611c25565b610855565b6101fd61271081565b6101fd61024d366004611c40565b610869565b6101fd6101005481565b6101f261026a366004611c40565b6108c8565b6101f261027d366004611c40565b610963565b6101fd7f000000000000000000000000000000000000000000000000000000000000000081565b60fc546102bc906001600160a01b031681565b6040516001600160a01b039091168152602001610207565b6101f26102e2366004611c59565b6109f7565b6101fd60fd5481565b6101f2610ba7565b6101f2610306366004611c25565b610c1e565b60fb546102bc906001600160a01b031681565b6101f2610cac565b6033546001600160a01b03166102bc565b6102bc7f000000000000000000000000000000000000000000000000000000000000000081565b6102bc7f000000000000000000000000000000000000000000000000000000000000000081565b6101f2610393366004611c25565b610d34565b6101f26103a6366004611c40565b610dcd565b610101546103b99060ff1681565b6040519015158152602001610207565b6097546001600160a01b03166102bc565b6101fd60ff5481565b6101fd6103f1366004611bfb565b610e42565b6101fd610404366004611c40565b61122a565b6065546001600160a01b03166102bc565b6101fd670de0b6b3a764000081565b6101f2610437366004611c25565b611292565b61046560405180604001604052806008815260200167726573756d65282960c01b815250611303565b6101015460ff1661048957604051636cd6020160e01b815260040160405180910390fd5b610101805460ff1916905560405133907f108589e68122bb4da8e5020c44387cab025243d0894392e275459641a90181a290600090a2565b6101015460009060ff16156104e9576040516313d0ff5960e31b815260040160405180910390fd5b6104f16113a1565b6104fa836113fa565b61050382611421565b60fb5460405163b62cad6960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301529091169063b62cad6990602401600060405180830381600087803b15801561056a57600080fd5b505af115801561057e573d6000803e3d6000fd5b50505050600061058f836001611442565b9050600061059e826001611471565b90506105aa8183611cce565b6040516370a0823160e01b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a08231906024016020604051808303816000875af1158015610610573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106349190611ce6565b1015610656576040516001629d12e360e01b0319815260040160405180910390fd5b8161010054101561067a5760405163a5047e9560e01b815260040160405180910390fd5b61010080548390039055801561074b5760fc546040516323b872dd60e01b81523360048201526001600160a01b039182166024820152604481018390526000917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610705573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107299190611cff565b9050806107495760405163aba1276560e01b815260040160405180910390fd5b505b604051632770a7eb60e21b8152336004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639dc29fac90604401600060405180830381600087803b1580156107b357600080fd5b505af11580156107c7573d6000803e3d6000fd5b506108019250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016905086866114f7565b60408051838152602081018690529081018290527f031e3397b091e3298ff850e89e965fe3543a0c64eb93659927433b06545f3f629060600160405180910390a150905061084f600160c955565b92915050565b61085d611566565b610866816115c0565b50565b600061087482611421565b6000610881836001611442565b90506000610890826001611471565b9050816101005410156108b65760405163a5047e9560e01b815260040160405180910390fd5b6108c08183611cce565b949350505050565b6108fb604051806040016040528060128152602001717365744665654f75742875696e743235362960701b815250611303565b612710811061091d576040516358d620b360e01b815260040160405180910390fd5b60fe80549082905560408051828152602081018490527fdc61767cf6b8f2d5ec16cd975db6d3a79fc69dc428b04c93e8db271de5e43b9f91015b60405180910390a15050565b61099560405180604001604052806011815260200170736574466565496e2875696e743235362960781b815250611303565b61271081106109b7576040516358d620b360e01b815260040160405180910390fd5b60fd80549082905560408051828152602081018490527fb76804f9786a4411a614b09a8211b2fd86f1f5b7a5e4410f35aa1578aac64e049101610957565b565b600054610100900460ff1615808015610a175750600054600160ff909116105b80610a315750303b158015610a31575060005460ff166001145b610a995760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610abc576000805461ff0019166101001790555b610ac5876113fa565b610ace866113fa565b610ad7856113fa565b610ae08761167e565b610ae86116b6565b61271084101580610afb57506127108310155b15610b19576040516358d620b360e01b815260040160405180910390fd5b60fd84905560fe83905560ff82905560fc80546001600160a01b038089166001600160a01b03199283161790925560fb8054928816929091169190911790558015610b9e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b60655433906001600160a01b03168114610c155760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401610a90565b610866816116e5565b610c51604051806040016040528060128152602001717365744f7261636c6528616464726573732960701b815250611303565b610c5a816113fa565b60fb80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f05cd89403c6bdeac21c2ff33de395121a31fa1bc2bf3adf4825f1f86e79969dd90600090a35050565b610cd4604051806040016040528060078152602001667061757365282960c81b815250611303565b6101015460ff1615610cf957604051631785c68160e01b815260040160405180910390fd5b610101805460ff1916600117905560405133907fb7aabc84a8f1fe9971d4bfffb4bb336af2c63e547360dd116940dc70da8159e190600090a2565b610d726040518060400160405280601981526020017f73657456656e7573547265617375727928616464726573732900000000000000815250611303565b610d7b816113fa565b60fc80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f35655f8f1a1f8b7ff254ff70c675c0a26ddcb3da6cb6decd491ecdee167e220b90600090a35050565b610e04604051806040016040528060168152602001757365745641494d696e744361702875696e743235362960501b815250611303565b60ff80549082905560408051828152602081018490527f0f43249751c1ca8dedff5711840ef91871f6fc2ce9b3891c1f33f4163ba1a9a39101610957565b6101015460009060ff1615610e6a576040516313d0ff5960e31b815260040160405180910390fd5b610e726113a1565b610e7b836113fa565b610e8482611421565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610eeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0f9190611ce6565b9050610f466001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330866116fe565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610fad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd19190611ce6565b90506000610fdf8383611d21565b60fb5460405163b62cad6960e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015292935091169063b62cad6990602401600060405180830381600087803b15801561104857600080fd5b505af115801561105c573d6000803e3d6000fd5b50505050600061106d826000611442565b9050600061107c826000611471565b9050600061108a8284611d21565b905060ff54836101005461109e9190611cce565b11156110bd576040516313d3ad1560e31b815260040160405180910390fd5b6101008054840190556040516340c10f1960e01b81526001600160a01b038a81166004830152602482018390527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b15801561113057600080fd5b505af1158015611144573d6000803e3d6000fd5b50505050816000146111d85760fc546040516340c10f1960e01b81526001600160a01b039182166004820152602481018490527f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b1580156111bf57600080fd5b505af11580156111d3573d6000803e3d6000fd5b505050505b60408051858152602081018390529081018390527f018e5c6d7bd9e0cafe3512ff02488f4c0ce3524a684e1097aab74666bf4fd00f9060600160405180910390a19550505050505061084f600160c955565b600061123582611421565b6000611242836000611442565b90506000611251826000611471565b9050600061125f8284611d21565b905060ff5483610100546112739190611cce565b11156108c0576040516313d3ad1560e31b815260040160405180910390fd5b61129a611566565b606580546001600160a01b0383166001600160a01b031990911681179091556112cb6033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6097546040516318c5e8ab60e01b81526000916001600160a01b0316906318c5e8ab906113369033908690600401611d90565b602060405180830381865afa158015611353573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113779190611cff565b90508061139d57333083604051634a3fa29360e01b8152600401610a9093929190611db4565b5050565b600260c954036113f35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a90565b600260c955565b6001600160a01b0381166108665760405163d92e233d60e01b815260040160405180910390fd5b8060000361086657604051631f2a200560e01b815260040160405180910390fd5b6000670de0b6b3a76400006114568361173c565b6114609085611de9565b61146a9190611e08565b9392505050565b6000808083600181111561148757611487611e2a565b03611495575060fd5461149a565b5060fe545b806000036114ac57600091505061084f565b6127106114b98286611de9565b10156114d85760405163617ab12d60e11b815260040160405180910390fd5b6127106114e58286611de9565b6114ef9190611e08565b91505061084f565b6040516001600160a01b03831660248201526044810182905261155a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611883565b505050565b600160c955565b6033546001600160a01b031633146109f55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a90565b6001600160a01b0381166116245760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e61676572206164604482015264647265737360d81b6064820152608401610a90565b609780546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa09101610957565b600054610100900460ff166116a55760405162461bcd60e51b8152600401610a9090611e40565b6116ad611958565b61086681611987565b600054610100900460ff166116dd5760405162461bcd60e51b8152600401610a9090611e40565b6109f56119ae565b606580546001600160a01b0319169055610866816119d5565b6040516001600160a01b03808516602483015283166044820152606481018290526117369085906323b872dd60e01b90608401611523565b50505050565b60fb546040516341976e0960e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260009283929116906341976e0990602401602060405180830381865afa1580156117aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ce9190611ce6565b905060008360018111156117e4576117e4611e2a565b03611836577f0000000000000000000000000000000000000000000000000000000000000000811061084f577f000000000000000000000000000000000000000000000000000000000000000061146a565b7f0000000000000000000000000000000000000000000000000000000000000000811161084f577f000000000000000000000000000000000000000000000000000000000000000061146a565b60006118d8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a279092919063ffffffff16565b90508051600014806118f95750808060200190518101906118f99190611cff565b61155a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a90565b600054610100900460ff1661197f5760405162461bcd60e51b8152600401610a9090611e40565b6109f5611a36565b600054610100900460ff1661085d5760405162461bcd60e51b8152600401610a9090611e40565b600054610100900460ff1661155f5760405162461bcd60e51b8152600401610a9090611e40565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606108c08484600085611a66565b600054610100900460ff16611a5d5760405162461bcd60e51b8152600401610a9090611e40565b6109f5336116e5565b606082471015611ac75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610a90565b600080866001600160a01b03168587604051611ae39190611e8b565b60006040518083038185875af1925050503d8060008114611b20576040519150601f19603f3d011682016040523d82523d6000602084013e611b25565b606091505b5091509150611b3687838387611b41565b979650505050505050565b60608315611bb0578251600003611ba9576001600160a01b0385163b611ba95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a90565b50816108c0565b6108c08383815115611bc55781518083602001fd5b8060405162461bcd60e51b8152600401610a909190611ea7565b80356001600160a01b0381168114611bf657600080fd5b919050565b60008060408385031215611c0e57600080fd5b611c1783611bdf565b946020939093013593505050565b600060208284031215611c3757600080fd5b61146a82611bdf565b600060208284031215611c5257600080fd5b5035919050565b60008060008060008060c08789031215611c7257600080fd5b611c7b87611bdf565b9550611c8960208801611bdf565b9450611c9760408801611bdf565b9350606087013592506080870135915060a087013590509295509295509295565b634e487b7160e01b600052601160045260246000fd5b60008219821115611ce157611ce1611cb8565b500190565b600060208284031215611cf857600080fd5b5051919050565b600060208284031215611d1157600080fd5b8151801515811461146a57600080fd5b600082821015611d3357611d33611cb8565b500390565b60005b83811015611d53578181015183820152602001611d3b565b838111156117365750506000910152565b60008151808452611d7c816020860160208601611d38565b601f01601f19169290920160200192915050565b6001600160a01b03831681526040602082018190526000906108c090830184611d64565b6001600160a01b03848116825283166020820152606060408201819052600090611de090830184611d64565b95945050505050565b6000816000190483118215151615611e0357611e03611cb8565b500290565b600082611e2557634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052602160045260246000fd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008251611e9d818460208701611d38565b9190910192915050565b60208152600061146a6020830184611d6456fea2646970667358221220776bae9a01444556f49e135e272e6d666dc0b437dde23f690af77c95ce44ac9b64736f6c634300080d0033", "devdoc": { "author": "Venus Protocol", "kind": "dev", @@ -726,28 +823,46 @@ }, "initialize(address,address,address,uint256,uint256,uint256)": { "params": { - "accessControlManager_": "The address of the AccessControlManager contract", - "comptroller_": "The address of the Comptroller contract", - "feeIn_": "The percentage of fees to be applied to a stablecoin -> VAI swap", - "feeOut_": "The percentage of fees to be applied to a VAI -> stablecoin swap", - "vaiMintCap_": "The cap for the total amount of VAI that can be minted", - "venusTreasury_": "The address where fees will be sent" + "accessControlManager_": "The address of the AccessControlManager contract.", + "feeIn_": "The percentage of fees to be applied to a stablecoin -> VAI swap.", + "feeOut_": "The percentage of fees to be applied to a VAI -> stablecoin swap.", + "oracleAddress_": "The address of the ResilientOracle contract.", + "vaiMintCap_": "The cap for the total amount of VAI that can be minted.", + "venusTreasury_": "The address where fees will be sent." } }, "owner()": { "details": "Returns the address of the current owner." }, "pause()": { - "details": "Reverts if the contract is already paused" + "details": "Reverts if the contract is already paused." }, "pendingOwner()": { "details": "Returns the address of the pending owner." }, + "previewSwapStableForVAI(uint256)": { + "details": "This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.", + "params": { + "stableTknAmount": "The amount of stable tokens provided for the swap." + }, + "returns": { + "_0": "The amount of VAI that would be sent to the receiver." + } + }, + "previewSwapVAIForStable(uint256)": { + "details": "This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.", + "params": { + "stableTknAmount": "The amount of stable tokens to be received after the swap." + }, + "returns": { + "_0": "The amount of VAI that would be taken from the user." + } + }, "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + "details": "Disabling renounceOwnership function." }, "resume()": { - "details": "Reverts if the contract is not paused" + "details": "Reverts if the contract is not paused." }, "setAccessControlManager(address)": { "custom:access": "Only Governance", @@ -757,34 +872,34 @@ "accessControlManager_": "The new address of the AccessControlManager" } }, - "setComptroller(address)": { - "details": "Reverts if the new address is zero or the oracle address returned from Comptroller is zero", + "setFeeIn(uint256)": { + "details": "Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).", "params": { - "comptroller_": "The new address of the Comptroller contract" + "feeIn_": "The new fee percentage for incoming swaps." } }, - "setFeeIn(uint256)": { - "details": "Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR)", + "setFeeOut(uint256)": { + "details": "Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).", "params": { - "feeIn_": "The new fee percentage for incoming swaps" + "feeOut_": "The new fee percentage for outgoing swaps." } }, - "setFeeOut(uint256)": { - "details": "Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR)", + "setOracle(address)": { + "details": "Reverts if the new address is zero.", "params": { - "feeOut_": "The new fee percentage for outgoing swaps" + "oracleAddress_": "The new address of the ResilientOracle contract." } }, - "setVaiMintCap(uint256)": { - "details": "Set the maximum amount of VAI that can be minted through this contract", + "setVAIMintCap(uint256)": { + "details": "Set the maximum amount of VAI that can be minted through this contract.", "params": { - "vaiMintCap_": "The new maximum amount of VAI that can be minted" + "vaiMintCap_": "The new maximum amount of VAI that can be minted." } }, "setVenusTreasury(address)": { - "details": "Reverts if the new address is zero", + "details": "Reverts if the new address is zero.", "params": { - "venusTreasury_": "The new address of the Venus Treasury contract" + "venusTreasury_": "The new address of the Venus Treasury contract." } }, "swapStableForVAI(address,uint256)": { @@ -792,95 +907,215 @@ "params": { "receiver": "The address that will receive the VAI tokens.", "stableTknAmount": "The amount of stable tokens to be swapped." + }, + "returns": { + "_0": "Amount of VAI minted to the sender." } }, "swapVAIForStable(address,uint256)": { "params": { - "receiver": "The address where the stablecoin will be sent", - "stableTknAmount": "The amount of stable tokens to receive" + "receiver": "The address where the stablecoin will be sent.", + "stableTknAmount": "The amount of stable tokens to receive." + }, + "returns": { + "_0": "The amount of VAI received and burnt from the sender." } }, "transferOwnership(address)": { "details": "Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner." } }, - "title": "Peg Stability Contract", + "stateVariables": { + "ONE_DOLLAR": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable", + "details": "Our oracle is returning amount depending on the number of decimals of the stable token. (36 - asset_decimals) E.g. 8 decimal asset = 1e28." + }, + "STABLE_TOKEN_ADDRESS": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable" + }, + "VAI": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable" + } + }, + "title": "Peg Stability Contract.", "version": 1 }, "userdoc": { "errors": { + "AlreadyPaused()": [ + { + "notice": "thrown when attempted to pause an already paused contract" + } + ], + "AmountTooSmall()": [ + { + "notice": "thrown when fee calculation will result in rounding down to 0 due to stable token amount being a too small number" + } + ], + "InvalidFee()": [ + { + "notice": "thrown when fee is >= 100%" + } + ], + "NotEnoughVAI()": [ + { + "notice": "thrown when the user doesn't have enough VAI balance to provide for the amount of stable tokens he wishes to get" + } + ], + "NotPaused()": [ + { + "notice": "thrown when attempted to resume the contract if it is already resumed" + } + ], + "Paused()": [ + { + "notice": "thrown when contract is in paused state" + } + ], + "TooManyDecimals()": [ + { + "notice": "thrown when stable token has more than 18 decimals" + } + ], "Unauthorized(address,address,string)": [ { "notice": "Thrown when the action is prohibited by AccessControlManager" } + ], + "VAIMintCapReached()": [ + { + "notice": "thrown when VAI to be minted will go beyond the mintCap threshold" + } + ], + "VAIMintedUnderflow()": [ + { + "notice": "thrown when the amount of VAI to be burnt exceeds the vaiMinted amount" + } + ], + "VAITransferFail()": [ + { + "notice": "thrown when the VAI transfer to treasury fails" + } + ], + "ZeroAddress()": [ + { + "notice": "thrown when a zero address is passed as a function parameter" + } + ], + "ZeroAmount()": [ + { + "notice": "thrown when a zero amount is passed as stable token amount parameter" + } ] }, "events": { - "ComptrollerChanged(address,address)": { - "notice": "Event emitted when comptroller state var is modified" - }, "FeeInChanged(uint256,uint256)": { - "notice": "Event emitted when feeIn state var is modified" + "notice": "Event emitted when feeIn state var is modified." }, "FeeOutChanged(uint256,uint256)": { - "notice": "Event emitted when feeOut state var is modified" + "notice": "Event emitted when feeOut state var is modified." }, "NewAccessControlManager(address,address)": { "notice": "Emitted when access control manager contract address is changed" }, + "OracleChanged(address,address)": { + "notice": "Event emitted when oracle state var is modified." + }, "PSMPaused(address)": { - "notice": "Event emitted when contract is paused" + "notice": "Event emitted when contract is paused." }, "PSMResumed(address)": { - "notice": "Event emitted when the contract is resumed after pause" + "notice": "Event emitted when the contract is resumed after pause." }, "StableForVAISwapped(uint256,uint256,uint256)": { - "notice": "Event emitted when stable token is swapped for VAI" + "notice": "Event emitted when stable token is swapped for VAI." }, - "VaiForStableSwapped(uint256,uint256,uint256)": { - "notice": "Event emitted when stable token is swapped for VAI" + "VAIForStableSwapped(uint256,uint256,uint256)": { + "notice": "Event emitted when stable token is swapped for VAI." }, - "VaiMintCapChanged(uint256,uint256)": { - "notice": "Event emitted when vaiMintCap state var is modified" + "VAIMintCapChanged(uint256,uint256)": { + "notice": "Event emitted when vaiMintCap state var is modified." }, "VenusTreasuryChanged(address,address)": { - "notice": "Event emitted when venusTreasury state var is modified" + "notice": "Event emitted when venusTreasury state var is modified." } }, "kind": "user", "methods": { + "BASIS_POINTS_DIVISOR()": { + "notice": "The divisor used to convert fees to basis points." + }, + "MANTISSA_ONE()": { + "notice": "The mantissa value representing 1 (used for calculations)." + }, + "ONE_DOLLAR()": { + "notice": "The value representing one dollar in the stable token." + }, + "STABLE_TOKEN_ADDRESS()": { + "notice": "The address of the stable token contract." + }, + "VAI()": { + "notice": "VAI token contract." + }, "accessControlManager()": { "notice": "Returns the address of the access control manager contract" }, + "feeIn()": { + "notice": "The incoming stableCoin fee. (Fee for swapStableForVAI)." + }, + "feeOut()": { + "notice": "The outgoing stableCoin fee. (Fee for swapVAIForStable)." + }, "initialize(address,address,address,uint256,uint256,uint256)": { - "notice": "Initializes the contract via Proxy Contract with the required parameters" + "notice": "Initializes the contract via Proxy Contract with the required parameters." + }, + "isPaused()": { + "notice": "A flag indicating whether the contract is currently paused or not." + }, + "oracle()": { + "notice": "The address of ResilientOracle contract wrapped in its interface." }, "pause()": { - "notice": "Pause the PSM contract" + "notice": "Pause the PSM contract." + }, + "previewSwapStableForVAI(uint256)": { + "notice": "Calculates the amount of VAI that would be sent to the receiver." + }, + "previewSwapVAIForStable(uint256)": { + "notice": "Calculates the amount of VAI that would be burnt from the user." }, "resume()": { - "notice": "Resume the PSM contract" + "notice": "Resume the PSM contract." }, "setAccessControlManager(address)": { "notice": "Sets the address of AccessControlManager" }, - "setComptroller(address)": { - "notice": "Set the address of the Comptroller contract from which we obtain the oracle address" - }, "setFeeIn(uint256)": { - "notice": "Set the fee percentage for incoming swaps" + "notice": "Set the fee percentage for incoming swaps." }, "setFeeOut(uint256)": { - "notice": "Set the fee percentage for outgoing swaps" + "notice": "Set the fee percentage for outgoing swaps." + }, + "setOracle(address)": { + "notice": "Set the address of the ResilientOracle contract." }, "setVenusTreasury(address)": { - "notice": "Set the address of the Venus Treasury contract" + "notice": "Set the address of the Venus Treasury contract." }, "swapStableForVAI(address,uint256)": { "notice": "Swaps stable tokens for VAI with fees." }, "swapVAIForStable(address,uint256)": { - "notice": "Swaps VAI for a stable token" + "notice": "Swaps VAI for a stable token." + }, + "vaiMintCap()": { + "notice": "The maximum amount of VAI that can be minted through this contract." + }, + "vaiMinted()": { + "notice": "The total amount of VAI minted through this contract." + }, + "venusTreasury()": { + "notice": "The address of the Venus Treasury contract." } }, "notice": "Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.", @@ -905,7 +1140,7 @@ "type": "t_bool" }, { - "astId": 1199, + "astId": 1376, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "__gap", "offset": 0, @@ -945,15 +1180,15 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 2012, + "astId": 1464, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "_accessControlManager", "offset": 0, "slot": "151", - "type": "t_contract(IAccessControlManagerV8)2196" + "type": "t_contract(IAccessControlManagerV8)1648" }, { - "astId": 2017, + "astId": 1469, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "__gap", "offset": 0, @@ -969,7 +1204,7 @@ "type": "t_uint256" }, { - "astId": 478, + "astId": 489, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "__gap", "offset": 0, @@ -977,15 +1212,15 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 3800, + "astId": 1780, "contract": "contracts/PegStability/PegStability.sol:PegStability", - "label": "comptroller", + "label": "oracle", "offset": 0, "slot": "251", - "type": "t_address" + "type": "t_contract(ResilientOracleInterface)1678" }, { - "astId": 3802, + "astId": 1783, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "venusTreasury", "offset": 0, @@ -993,7 +1228,7 @@ "type": "t_address" }, { - "astId": 3804, + "astId": 1786, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "feeIn", "offset": 0, @@ -1001,7 +1236,7 @@ "type": "t_uint256" }, { - "astId": 3806, + "astId": 1789, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "feeOut", "offset": 0, @@ -1009,7 +1244,7 @@ "type": "t_uint256" }, { - "astId": 3808, + "astId": 1792, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "vaiMintCap", "offset": 0, @@ -1017,7 +1252,7 @@ "type": "t_uint256" }, { - "astId": 3810, + "astId": 1795, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "vaiMinted", "offset": 0, @@ -1025,7 +1260,7 @@ "type": "t_uint256" }, { - "astId": 3812, + "astId": 1798, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "isPaused", "offset": 0, @@ -1056,11 +1291,16 @@ "label": "bool", "numberOfBytes": "1" }, - "t_contract(IAccessControlManagerV8)2196": { + "t_contract(IAccessControlManagerV8)1648": { "encoding": "inplace", "label": "contract IAccessControlManagerV8", "numberOfBytes": "20" }, + "t_contract(ResilientOracleInterface)1678": { + "encoding": "inplace", + "label": "contract ResilientOracleInterface", + "numberOfBytes": "20" + }, "t_uint256": { "encoding": "inplace", "label": "uint256", diff --git a/deployments/bscmainnet/PegStability_USDT_Proxy.json b/deployments/bscmainnet/PegStability_USDT_Proxy.json index 74d851ed0..ac2bf805e 100644 --- a/deployments/bscmainnet/PegStability_USDT_Proxy.json +++ b/deployments/bscmainnet/PegStability_USDT_Proxy.json @@ -1,5 +1,5 @@ { - "address": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", + "address": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", "abi": [ { "inputs": [ @@ -146,84 +146,84 @@ "type": "receive" } ], - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", "receipt": { "to": null, "from": "0xa05f990d647287e4E84715b813BC000aEA970467", - "contractAddress": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", - "transactionIndex": 57, - "gasUsed": "907185", - "logsBloom": "0x00000000000000000000000000000000400000010000000000800000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000008000000002000001001000000100000000000000000000000000020000000000000000000800000000800000000000000000000001400000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000400000008000000808000000000000000000000000020000000000000000000040000000000800400000000000000000020000000000000000000000000000000010000000800000000000000000000000000", - "blockHash": "0x97040c02f1f8062705adabe1fac98ebb64e49635974049eae028dc8f2b1c91f1", - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", + "contractAddress": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", + "transactionIndex": 123, + "gasUsed": "883976", + "logsBloom": "0x00000000000000000000004000000000400000000000000000800000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000008000000002000001000000000100000000000000000000000000020000000000000000000800000000800000000010000000000000400000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000400000000000000808000000000000000000008000020000000000000000000040004000000000400000000000000000020000008000000000000000000000000000000000808000000000000000000000000", + "blockHash": "0x1de8d3a609d4d95b8d9d8b69c5e20ac35068599ad34b989266d6e9e0d1a50174", + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", "logs": [ { - "transactionIndex": 57, - "blockNumber": 29298117, - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", - "address": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", + "transactionIndex": 123, + "blockNumber": 30501830, + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", + "address": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", "topics": [ "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x00000000000000000000000053e47c779900962b10fd81ff0ca884ad75c80702" + "0x0000000000000000000000009664568e5131e85f67d87fcd55b249f5d25fa43e" ], "data": "0x", - "logIndex": 132, - "blockHash": "0x97040c02f1f8062705adabe1fac98ebb64e49635974049eae028dc8f2b1c91f1" + "logIndex": 191, + "blockHash": "0x1de8d3a609d4d95b8d9d8b69c5e20ac35068599ad34b989266d6e9e0d1a50174" }, { - "transactionIndex": 57, - "blockNumber": 29298117, - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", - "address": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", + "transactionIndex": 123, + "blockNumber": 30501830, + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", + "address": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000a05f990d647287e4e84715b813bc000aea970467" ], "data": "0x", - "logIndex": 133, - "blockHash": "0x97040c02f1f8062705adabe1fac98ebb64e49635974049eae028dc8f2b1c91f1" + "logIndex": 192, + "blockHash": "0x1de8d3a609d4d95b8d9d8b69c5e20ac35068599ad34b989266d6e9e0d1a50174" }, { - "transactionIndex": 57, - "blockNumber": 29298117, - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", - "address": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", + "transactionIndex": 123, + "blockNumber": 30501830, + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", + "address": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000004788629abc6cfca10f9f969efdeaa1cf70c23555", - "logIndex": 134, - "blockHash": "0x97040c02f1f8062705adabe1fac98ebb64e49635974049eae028dc8f2b1c91f1" + "logIndex": 193, + "blockHash": "0x1de8d3a609d4d95b8d9d8b69c5e20ac35068599ad34b989266d6e9e0d1a50174" }, { - "transactionIndex": 57, - "blockNumber": 29298117, - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", - "address": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", + "transactionIndex": 123, + "blockNumber": 30501830, + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", + "address": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 135, - "blockHash": "0x97040c02f1f8062705adabe1fac98ebb64e49635974049eae028dc8f2b1c91f1" + "logIndex": 194, + "blockHash": "0x1de8d3a609d4d95b8d9d8b69c5e20ac35068599ad34b989266d6e9e0d1a50174" }, { - "transactionIndex": 57, - "blockNumber": 29298117, - "transactionHash": "0x7789c84198ca7fc00212d8a9af0d1fddac66ffd0952118f3d5d24f831645d503", - "address": "0x93dB3f46e1DC91c2b9D8Bc7443790bB4699c0E81", + "transactionIndex": 123, + "blockNumber": 30501830, + "transactionHash": "0x798192121fb1e21f849ce9069d31b44280cdc422c52aaec92c0c5d7c17e28416", + "address": "0xC138aa4E424D1A8539e8F38Af5a754a2B7c3Cc36", "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f918ba9446552ab184c6ffd2e2fcb1fa5ee1e59", - "logIndex": 136, - "blockHash": "0x97040c02f1f8062705adabe1fac98ebb64e49635974049eae028dc8f2b1c91f1" + "logIndex": 195, + "blockHash": "0x1de8d3a609d4d95b8d9d8b69c5e20ac35068599ad34b989266d6e9e0d1a50174" } ], - "blockNumber": 29298117, - "cumulativeGasUsed": "6522198", + "blockNumber": 30501830, + "cumulativeGasUsed": "11339018", "status": 1, "byzantium": true }, "args": [ - "0x53E47c779900962B10fd81fF0ca884ad75c80702", + "0x9664568e5131e85f67d87fCD55B249F5D25fa43e", "0x3f918bA9446552AB184C6Ffd2e2fcB1FA5ee1e59", - "0x728cdbca0000000000000000000000004788629abc6cfca10f9f969efdeaa1cf70c23555000000000000000000000000f322942f644a996a617bd29c16bd7d231d9f35e9000000000000000000000000fd36e2c2a6789db23113685031d7f163291583840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000422ca8b0a00a425000000" + "0x728cdbca0000000000000000000000004788629abc6cfca10f9f969efdeaa1cf70c23555000000000000000000000000f322942f644a996a617bd29c16bd7d231d9f35e90000000000000000000000006592b5de802159f3e74b2486b091d11a8256ab8a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000422ca8b0a00a425000000" ], "numDeployments": 1, "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", diff --git a/deployments/bscmainnet/solcInputs/ad861ed5d4e7191c78cab74f6cb7beec.json b/deployments/bscmainnet/solcInputs/ad861ed5d4e7191c78cab74f6cb7beec.json new file mode 100644 index 000000000..b6602b96e --- /dev/null +++ b/deployments/bscmainnet/solcInputs/ad861ed5d4e7191c78cab74f6cb7beec.json @@ -0,0 +1,78 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./OwnableUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership} and {acceptOwnership}.\n *\n * This module is used through inheritance. It will make available all functions\n * from parent (Ownable).\n */\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\n function __Ownable2Step_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable2Step_init_unchained() internal onlyInitializing {\n }\n address private _pendingOwner;\n\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Returns the address of the pending owner.\n */\n function pendingOwner() public view virtual returns (address) {\n return _pendingOwner;\n }\n\n /**\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual override onlyOwner {\n _pendingOwner = newOwner;\n emit OwnershipTransferStarted(owner(), newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual override {\n delete _pendingOwner;\n super._transferOwnership(newOwner);\n }\n\n /**\n * @dev The new owner accepts the ownership transfer.\n */\n function acceptOwnership() public virtual {\n address sender = _msgSender();\n require(pendingOwner() == sender, \"Ownable2Step: caller is not the new owner\");\n _transferOwnership(sender);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20PermitUpgradeable {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\nimport \"../extensions/IERC20PermitUpgradeable.sol\";\nimport \"../../../utils/AddressUpgradeable.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20Upgradeable {\n using AddressUpgradeable for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to\n * 0 before setting it to a non-zero value.\n */\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20PermitUpgradeable token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\n\nimport \"./IAccessControlManagerV8.sol\";\n\n/**\n * @title Venus Access Control Contract.\n * @dev The AccessControlledV8 contract is a wrapper around the OpenZeppelin AccessControl contract\n * It provides a standardized way to control access to methods within the Venus Smart Contract Ecosystem.\n * The contract allows the owner to set an AccessControlManager contract address.\n * It can restrict method calls based on the sender's role and the method's signature.\n */\n\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\n /// @notice Access control manager contract\n IAccessControlManagerV8 private _accessControlManager;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n\n /// @notice Emitted when access control manager contract address is changed\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\n\n /// @notice Thrown when the action is prohibited by AccessControlManager\n error Unauthorized(address sender, address calledContract, string methodSignature);\n\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\n __Ownable2Step_init();\n __AccessControlled_init_unchained(accessControlManager_);\n }\n\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Sets the address of AccessControlManager\n * @dev Admin function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n * @custom:event Emits NewAccessControlManager event\n * @custom:access Only Governance\n */\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Returns the address of the access control manager contract\n */\n function accessControlManager() external view returns (IAccessControlManagerV8) {\n return _accessControlManager;\n }\n\n /**\n * @dev Internal function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n */\n function _setAccessControlManager(address accessControlManager_) internal {\n require(address(accessControlManager_) != address(0), \"invalid acess control manager address\");\n address oldAccessControlManager = address(_accessControlManager);\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\n }\n\n /**\n * @notice Reverts if the call is not allowed by AccessControlManager\n * @param signature Method signature\n */\n function _checkAccessAllowed(string memory signature) internal view {\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\n\n if (!isAllowedToCall) {\n revert Unauthorized(msg.sender, address(this), signature);\n }\n }\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts/access/IAccessControl.sol\";\n\ninterface IAccessControlManagerV8 is IAccessControl {\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\n\n function revokeCallPermission(\n address contractAddress,\n string calldata functionSig,\n address accountToRevoke\n ) external;\n\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\n\n function hasPermission(\n address account,\n address contractAddress,\n string calldata functionSig\n ) external view returns (bool);\n}\n" + }, + "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\ninterface OracleInterface {\n function getPrice(address asset) external view returns (uint256);\n}\n\ninterface ResilientOracleInterface is OracleInterface {\n function updatePrice(address vToken) external;\n\n function updateAssetPrice(address asset) external;\n\n function getUnderlyingPrice(address vToken) external view returns (uint256);\n}\n\ninterface TwapInterface is OracleInterface {\n function updateTwap(address asset) external returns (uint256);\n}\n\ninterface BoundValidatorInterface {\n function validatePriceWithAnchorPrice(\n address asset,\n uint256 reporterPrice,\n uint256 anchorPrice\n ) external view returns (bool);\n}\n" + }, + "contracts/PegStability/IVAI.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\ninterface IVAI {\n function balanceOf(address usr) external returns (uint256);\n\n function transferFrom(address src, address dst, uint amount) external returns (bool);\n\n function mint(address usr, uint wad) external;\n\n function burn(address usr, uint wad) external;\n}\n" + }, + "contracts/PegStability/PegStability.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\";\nimport \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { ResilientOracleInterface } from \"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\";\nimport { IVAI } from \"./IVAI.sol\";\n\n/**\n * @title Peg Stability Contract.\n * @notice Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.\n * @author Venus Protocol\n */\ncontract PegStability is AccessControlledV8, ReentrancyGuardUpgradeable {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n // Helper enum for calculation of the fee.\n enum FeeDirection {\n IN,\n OUT\n }\n\n /// @notice The divisor used to convert fees to basis points.\n uint256 public constant BASIS_POINTS_DIVISOR = 10000;\n\n /// @notice The mantissa value representing 1 (used for calculations).\n uint256 public constant MANTISSA_ONE = 1e18;\n\n /// @notice The value representing one dollar in the stable token.\n /// @dev Our oracle is returning amount depending on the number of decimals of the stable token. (36 - asset_decimals) E.g. 8 decimal asset = 1e28.\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n uint256 public immutable ONE_DOLLAR;\n\n /// @notice VAI token contract.\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n IVAI public immutable VAI;\n\n /// @notice The address of the stable token contract.\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable STABLE_TOKEN_ADDRESS;\n\n /// @notice The address of ResilientOracle contract wrapped in its interface.\n ResilientOracleInterface public oracle;\n\n /// @notice The address of the Venus Treasury contract.\n address public venusTreasury;\n\n /// @notice The incoming stableCoin fee. (Fee for swapStableForVAI).\n uint256 public feeIn;\n\n /// @notice The outgoing stableCoin fee. (Fee for swapVAIForStable).\n uint256 public feeOut;\n\n /// @notice The maximum amount of VAI that can be minted through this contract.\n uint256 public vaiMintCap;\n\n /// @notice The total amount of VAI minted through this contract.\n uint256 public vaiMinted;\n\n /// @notice A flag indicating whether the contract is currently paused or not.\n bool public isPaused;\n\n /// @notice Event emitted when contract is paused.\n event PSMPaused(address indexed admin);\n\n /// @notice Event emitted when the contract is resumed after pause.\n event PSMResumed(address indexed admin);\n\n /// @notice Event emitted when feeIn state var is modified.\n event FeeInChanged(uint256 oldFeeIn, uint256 newFeeIn);\n\n /// @notice Event emitted when feeOut state var is modified.\n event FeeOutChanged(uint256 oldFeeOut, uint256 newFeeOut);\n\n /// @notice Event emitted when vaiMintCap state var is modified.\n event VAIMintCapChanged(uint256 oldCap, uint256 newCap);\n\n /// @notice Event emitted when venusTreasury state var is modified.\n event VenusTreasuryChanged(address indexed oldTreasury, address indexed newTreasury);\n\n /// @notice Event emitted when oracle state var is modified.\n event OracleChanged(address indexed oldOracle, address indexed newOracle);\n\n /// @notice Event emitted when stable token is swapped for VAI.\n event StableForVAISwapped(uint256 stableIn, uint256 vaiOut, uint256 fee);\n\n /// @notice Event emitted when stable token is swapped for VAI.\n event VAIForStableSwapped(uint256 vaiBurnt, uint256 stableOut, uint256 vaiFee);\n\n /// @notice thrown when contract is in paused state\n error Paused();\n\n /// @notice thrown when attempted to pause an already paused contract\n error AlreadyPaused();\n\n /// @notice thrown when attempted to resume the contract if it is already resumed\n error NotPaused();\n\n /// @notice thrown when stable token has more than 18 decimals\n error TooManyDecimals();\n\n /// @notice thrown when fee is >= 100%\n error InvalidFee();\n\n /// @notice thrown when a zero address is passed as a function parameter\n error ZeroAddress();\n\n /// @notice thrown when a zero amount is passed as stable token amount parameter\n error ZeroAmount();\n\n /// @notice thrown when the user doesn't have enough VAI balance to provide for the amount of stable tokens he wishes to get\n error NotEnoughVAI();\n\n /// @notice thrown when the amount of VAI to be burnt exceeds the vaiMinted amount\n error VAIMintedUnderflow();\n\n /// @notice thrown when the VAI transfer to treasury fails\n error VAITransferFail();\n\n /// @notice thrown when VAI to be minted will go beyond the mintCap threshold\n error VAIMintCapReached();\n /// @notice thrown when fee calculation will result in rounding down to 0 due to stable token amount being a too small number\n error AmountTooSmall();\n\n /**\n * @dev Prevents functions to execute when contract is paused.\n */\n modifier isActive() {\n if (isPaused) revert Paused();\n _;\n }\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address stableTokenAddress_, address vaiAddress_) {\n _ensureNonzeroAddress(stableTokenAddress_);\n _ensureNonzeroAddress(vaiAddress_);\n\n uint256 decimals_ = IERC20MetadataUpgradeable(stableTokenAddress_).decimals();\n\n if (decimals_ > 18) {\n revert TooManyDecimals();\n }\n\n ONE_DOLLAR = 10 ** (36 - decimals_); // 1$ scaled to the decimals returned by our Oracle\n STABLE_TOKEN_ADDRESS = stableTokenAddress_;\n VAI = IVAI(vaiAddress_);\n _disableInitializers();\n }\n\n /**\n * @notice Initializes the contract via Proxy Contract with the required parameters.\n * @param accessControlManager_ The address of the AccessControlManager contract.\n * @param venusTreasury_ The address where fees will be sent.\n * @param oracleAddress_ The address of the ResilientOracle contract.\n * @param feeIn_ The percentage of fees to be applied to a stablecoin -> VAI swap.\n * @param feeOut_ The percentage of fees to be applied to a VAI -> stablecoin swap.\n * @param vaiMintCap_ The cap for the total amount of VAI that can be minted.\n */\n function initialize(\n address accessControlManager_,\n address venusTreasury_,\n address oracleAddress_,\n uint256 feeIn_,\n uint256 feeOut_,\n uint256 vaiMintCap_\n ) external initializer {\n _ensureNonzeroAddress(accessControlManager_);\n _ensureNonzeroAddress(venusTreasury_);\n _ensureNonzeroAddress(oracleAddress_);\n __AccessControlled_init(accessControlManager_);\n __ReentrancyGuard_init();\n\n if (feeIn_ >= BASIS_POINTS_DIVISOR || feeOut_ >= BASIS_POINTS_DIVISOR) {\n revert InvalidFee();\n }\n\n feeIn = feeIn_;\n feeOut = feeOut_;\n vaiMintCap = vaiMintCap_;\n venusTreasury = venusTreasury_;\n oracle = ResilientOracleInterface(oracleAddress_);\n }\n\n /*** Swap Functions ***/\n\n /**\n * @notice Swaps VAI for a stable token.\n * @param receiver The address where the stablecoin will be sent.\n * @param stableTknAmount The amount of stable tokens to receive.\n * @return The amount of VAI received and burnt from the sender.\n */\n // @custom:event Emits VAIForStableSwapped event.\n function swapVAIForStable(\n address receiver,\n uint256 stableTknAmount\n ) external isActive nonReentrant returns (uint256) {\n _ensureNonzeroAddress(receiver);\n _ensureNonzeroAmount(stableTknAmount);\n\n // update oracle price and calculate USD value of the stable token amount scaled in 18 decimals\n oracle.updateAssetPrice(STABLE_TOKEN_ADDRESS);\n uint256 stableTknAmountUSD = _previewTokenUSDAmount(stableTknAmount, FeeDirection.OUT);\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.OUT);\n\n if (VAI.balanceOf(msg.sender) < stableTknAmountUSD + fee) {\n revert NotEnoughVAI();\n }\n if (vaiMinted < stableTknAmountUSD) {\n revert VAIMintedUnderflow();\n }\n\n unchecked {\n vaiMinted -= stableTknAmountUSD;\n }\n\n if (fee != 0) {\n bool success = VAI.transferFrom(msg.sender, venusTreasury, fee);\n if (!success) {\n revert VAITransferFail();\n }\n }\n\n VAI.burn(msg.sender, stableTknAmountUSD);\n IERC20Upgradeable(STABLE_TOKEN_ADDRESS).safeTransfer(receiver, stableTknAmount);\n emit VAIForStableSwapped(stableTknAmountUSD, stableTknAmount, fee);\n return stableTknAmountUSD;\n }\n\n /**\n * @notice Swaps stable tokens for VAI with fees.\n * @dev This function adds support to fee-on-transfer tokens. The actualTransferAmt is calculated, by recording token balance state before and after the transfer.\n * @param receiver The address that will receive the VAI tokens.\n * @param stableTknAmount The amount of stable tokens to be swapped.\n * @return Amount of VAI minted to the sender.\n */\n // @custom:event Emits StableForVAISwapped event.\n function swapStableForVAI(\n address receiver,\n uint256 stableTknAmount\n ) external isActive nonReentrant returns (uint256) {\n _ensureNonzeroAddress(receiver);\n _ensureNonzeroAmount(stableTknAmount);\n // transfer IN, supporting fee-on-transfer tokens\n uint256 balanceBefore = IERC20Upgradeable(STABLE_TOKEN_ADDRESS).balanceOf(address(this));\n IERC20Upgradeable(STABLE_TOKEN_ADDRESS).safeTransferFrom(msg.sender, address(this), stableTknAmount);\n uint256 balanceAfter = IERC20Upgradeable(STABLE_TOKEN_ADDRESS).balanceOf(address(this));\n\n //calculate actual transfered amount (in case of fee-on-transfer tokens)\n uint256 actualTransferAmt = balanceAfter - balanceBefore;\n\n // update oracle price and calculate USD value of the stable token amount scaled in 18 decimals\n oracle.updateAssetPrice(STABLE_TOKEN_ADDRESS);\n uint256 actualTransferAmtInUSD = _previewTokenUSDAmount(actualTransferAmt, FeeDirection.IN);\n\n //calculate feeIn\n uint256 fee = _calculateFee(actualTransferAmtInUSD, FeeDirection.IN);\n uint256 vaiToMint = actualTransferAmtInUSD - fee;\n\n if (vaiMinted + actualTransferAmtInUSD > vaiMintCap) {\n revert VAIMintCapReached();\n }\n unchecked {\n vaiMinted += actualTransferAmtInUSD;\n }\n\n // mint VAI to receiver\n VAI.mint(receiver, vaiToMint);\n\n // mint VAI fee to venus treasury\n if (fee != 0) {\n VAI.mint(venusTreasury, fee);\n }\n\n emit StableForVAISwapped(actualTransferAmt, vaiToMint, fee);\n return vaiToMint;\n }\n\n /*** Admin Functions ***/\n\n /**\n * @notice Pause the PSM contract.\n * @dev Reverts if the contract is already paused.\n */\n // @custom:event Emits PSMPaused event.\n function pause() external {\n _checkAccessAllowed(\"pause()\");\n if (isPaused) {\n revert AlreadyPaused();\n }\n isPaused = true;\n emit PSMPaused(msg.sender);\n }\n\n /**\n * @notice Resume the PSM contract.\n * @dev Reverts if the contract is not paused.\n */\n // @custom:event Emits PSMResumed event.\n function resume() external {\n _checkAccessAllowed(\"resume()\");\n if (!isPaused) {\n revert NotPaused();\n }\n isPaused = false;\n emit PSMResumed(msg.sender);\n }\n\n /**\n * @notice Set the fee percentage for incoming swaps.\n * @dev Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).\n * @param feeIn_ The new fee percentage for incoming swaps.\n */\n // @custom:event Emits FeeInChanged event.\n function setFeeIn(uint256 feeIn_) external {\n _checkAccessAllowed(\"setFeeIn(uint256)\");\n // feeIn = 10000 = 100%\n if (feeIn_ >= BASIS_POINTS_DIVISOR) {\n revert InvalidFee();\n }\n uint256 oldFeeIn = feeIn;\n feeIn = feeIn_;\n emit FeeInChanged(oldFeeIn, feeIn_);\n }\n\n /**\n * @notice Set the fee percentage for outgoing swaps.\n * @dev Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).\n * @param feeOut_ The new fee percentage for outgoing swaps.\n */\n // @custom:event Emits FeeOutChanged event.\n function setFeeOut(uint256 feeOut_) external {\n _checkAccessAllowed(\"setFeeOut(uint256)\");\n // feeOut = 10000 = 100%\n if (feeOut_ >= BASIS_POINTS_DIVISOR) {\n revert InvalidFee();\n }\n uint256 oldFeeOut = feeOut;\n feeOut = feeOut_;\n emit FeeOutChanged(oldFeeOut, feeOut_);\n }\n\n /**\n * @dev Set the maximum amount of VAI that can be minted through this contract.\n * @param vaiMintCap_ The new maximum amount of VAI that can be minted.\n */\n // @custom:event Emits VAIMintCapChanged event.\n function setVAIMintCap(uint256 vaiMintCap_) external {\n _checkAccessAllowed(\"setVAIMintCap(uint256)\");\n uint256 oldVAIMintCap = vaiMintCap;\n vaiMintCap = vaiMintCap_;\n emit VAIMintCapChanged(oldVAIMintCap, vaiMintCap_);\n }\n\n /**\n * @notice Set the address of the Venus Treasury contract.\n * @dev Reverts if the new address is zero.\n * @param venusTreasury_ The new address of the Venus Treasury contract.\n */\n // @custom:event Emits VenusTreasuryChanged event.\n function setVenusTreasury(address venusTreasury_) external {\n _checkAccessAllowed(\"setVenusTreasury(address)\");\n _ensureNonzeroAddress(venusTreasury_);\n address oldTreasuryAddress = venusTreasury;\n venusTreasury = venusTreasury_;\n emit VenusTreasuryChanged(oldTreasuryAddress, venusTreasury_);\n }\n\n /**\n * @notice Set the address of the ResilientOracle contract.\n * @dev Reverts if the new address is zero.\n * @param oracleAddress_ The new address of the ResilientOracle contract.\n */\n // @custom:event Emits OracleChanged event.\n function setOracle(address oracleAddress_) external {\n _checkAccessAllowed(\"setOracle(address)\");\n _ensureNonzeroAddress(oracleAddress_);\n address oldOracleAddress = address(oracle);\n oracle = ResilientOracleInterface(oracleAddress_);\n emit OracleChanged(oldOracleAddress, oracleAddress_);\n }\n\n /**\n * @dev Disabling renounceOwnership function.\n */\n function renounceOwnership() public override {}\n\n /*** Helper Functions ***/\n\n /**\n * @notice Calculates the amount of VAI that would be burnt from the user.\n * @dev This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.\n * @param stableTknAmount The amount of stable tokens to be received after the swap.\n * @return The amount of VAI that would be taken from the user.\n */\n function previewSwapVAIForStable(uint256 stableTknAmount) external view returns (uint256) {\n _ensureNonzeroAmount(stableTknAmount);\n uint256 stableTknAmountUSD = _previewTokenUSDAmount(stableTknAmount, FeeDirection.OUT);\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.OUT);\n\n if (vaiMinted < stableTknAmountUSD) {\n revert VAIMintedUnderflow();\n }\n\n return stableTknAmountUSD + fee;\n }\n\n /**\n * @notice Calculates the amount of VAI that would be sent to the receiver.\n * @dev This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.\n * @param stableTknAmount The amount of stable tokens provided for the swap.\n * @return The amount of VAI that would be sent to the receiver.\n */\n function previewSwapStableForVAI(uint256 stableTknAmount) external view returns (uint256) {\n _ensureNonzeroAmount(stableTknAmount);\n uint256 stableTknAmountUSD = _previewTokenUSDAmount(stableTknAmount, FeeDirection.IN);\n\n //calculate feeIn\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.IN);\n uint256 vaiToMint = stableTknAmountUSD - fee;\n\n if (vaiMinted + stableTknAmountUSD > vaiMintCap) {\n revert VAIMintCapReached();\n }\n\n return vaiToMint;\n }\n\n /**\n * @dev Calculates the USD value of the given amount of stable tokens depending on the swap direction.\n * @param amount The amount of stable tokens.\n * @param direction The direction of the swap.\n * @return The USD value of the given amount of stable tokens scaled by 1e18 taking into account the direction of the swap\n */\n function _previewTokenUSDAmount(uint256 amount, FeeDirection direction) internal view returns (uint256) {\n return (amount * _getPriceInUSD(direction)) / MANTISSA_ONE;\n }\n\n /**\n * @notice Get the price of stable token in USD.\n * @dev This function returns either min(1$,oraclePrice) or max(1$,oraclePrice) with a decimal scale (36 - asset_decimals). E.g. for 8 decimal token 1$ will be 1e28.\n * @param direction The direction of the swap: FeeDirection.IN or FeeDirection.OUT.\n * @return The price in USD, adjusted based on the selected direction.\n */\n function _getPriceInUSD(FeeDirection direction) internal view returns (uint256) {\n // get price with a scale = (36 - asset_decimals)\n uint256 price = oracle.getPrice(STABLE_TOKEN_ADDRESS);\n\n if (direction == FeeDirection.IN) {\n // MIN(1, price)\n return price < ONE_DOLLAR ? price : ONE_DOLLAR;\n } else {\n // MAX(1, price)\n return price > ONE_DOLLAR ? price : ONE_DOLLAR;\n }\n }\n\n /**\n * @notice Calculate the fee amount based on the input amount and fee percentage.\n * @dev Reverts if the fee percentage calculation results in rounding down to 0.\n * @param amount The input amount to calculate the fee from.\n * @param direction The direction of the fee: FeeDirection.IN or FeeDirection.OUT.\n * @return The fee amount.\n */\n function _calculateFee(uint256 amount, FeeDirection direction) internal view returns (uint256) {\n uint256 feePercent;\n if (direction == FeeDirection.IN) {\n feePercent = feeIn;\n } else {\n feePercent = feeOut;\n }\n if (feePercent == 0) {\n return 0;\n } else {\n // checking if the percent calculation will result in rounding down to 0\n if (amount * feePercent < BASIS_POINTS_DIVISOR) {\n revert AmountTooSmall();\n }\n return (amount * feePercent) / BASIS_POINTS_DIVISOR;\n }\n }\n\n /**\n * @notice Checks that the address is not the zero address.\n * @param someone The address to check.\n */\n function _ensureNonzeroAddress(address someone) private pure {\n if (someone == address(0)) revert ZeroAddress();\n }\n\n /**\n * @notice Checks that the amount passed as stable tokens is bigger than zero\n * @param amount The amount to validate\n */\n function _ensureNonzeroAmount(uint256 amount) private pure {\n if (amount == 0) revert ZeroAmount();\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "storageLayout", + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "evm.gasEstimates" + ], + "": ["ast"] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} diff --git a/deployments/bsctestnet/.migrations.json b/deployments/bsctestnet/.migrations.json index 6dbfee109..176ba986b 100644 --- a/deployments/bsctestnet/.migrations.json +++ b/deployments/bsctestnet/.migrations.json @@ -1,3 +1,3 @@ { - "psm_initial_deploy": 1687438575 + "psm_initial_deploy": 1690971955 } diff --git a/deployments/bsctestnet/PegStability_USDT.json b/deployments/bsctestnet/PegStability_USDT.json index a6c6ec5ad..b039e0695 100644 --- a/deployments/bsctestnet/PegStability_USDT.json +++ b/deployments/bsctestnet/PegStability_USDT.json @@ -1,5 +1,5 @@ { - "address": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", + "address": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", "abi": [ { "anonymous": false, @@ -124,6 +124,41 @@ "stateMutability": "payable", "type": "receive" }, + { + "inputs": [], + "name": "AlreadyPaused", + "type": "error" + }, + { + "inputs": [], + "name": "AmountTooSmall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidFee", + "type": "error" + }, + { + "inputs": [], + "name": "NotEnoughVAI", + "type": "error" + }, + { + "inputs": [], + "name": "NotPaused", + "type": "error" + }, + { + "inputs": [], + "name": "Paused", + "type": "error" + }, + { + "inputs": [], + "name": "TooManyDecimals", + "type": "error" + }, { "inputs": [ { @@ -146,23 +181,29 @@ "type": "error" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "oldComptroller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newComptroller", - "type": "address" - } - ], - "name": "ComptrollerChanged", - "type": "event" + "inputs": [], + "name": "VAIMintCapReached", + "type": "error" + }, + { + "inputs": [], + "name": "VAIMintedUnderflow", + "type": "error" + }, + { + "inputs": [], + "name": "VAITransferFail", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAmount", + "type": "error" }, { "anonymous": false, @@ -234,6 +275,25 @@ "name": "NewAccessControlManager", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -335,17 +395,17 @@ { "indexed": false, "internalType": "uint256", - "name": "vaiFee", + "name": "stableOut", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "stableOut", + "name": "vaiFee", "type": "uint256" } ], - "name": "VaiForStableSwapped", + "name": "VAIForStableSwapped", "type": "event" }, { @@ -364,7 +424,7 @@ "type": "uint256" } ], - "name": "VaiMintCapChanged", + "name": "VAIMintCapChanged", "type": "event" }, { @@ -440,23 +500,10 @@ }, { "inputs": [], - "name": "VAI_ADDRESS", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "VTOKEN_ADDRESS", + "name": "VAI", "outputs": [ { - "internalType": "address", + "internalType": "contract IVAI", "name": "", "type": "address" } @@ -484,19 +531,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "comptroller", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "feeIn", @@ -537,7 +571,7 @@ }, { "internalType": "address", - "name": "comptroller_", + "name": "oracleAddress_", "type": "address" }, { @@ -574,6 +608,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "owner", @@ -607,6 +654,44 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stableTknAmount", + "type": "uint256" + } + ], + "name": "previewSwapStableForVAI", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stableTknAmount", + "type": "uint256" + } + ], + "name": "previewSwapVAIForStable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "renounceOwnership", @@ -637,12 +722,12 @@ { "inputs": [ { - "internalType": "address", - "name": "comptroller_", - "type": "address" + "internalType": "uint256", + "name": "feeIn_", + "type": "uint256" } ], - "name": "setComptroller", + "name": "setFeeIn", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -651,11 +736,11 @@ "inputs": [ { "internalType": "uint256", - "name": "feeIn_", + "name": "feeOut_", "type": "uint256" } ], - "name": "setFeeIn", + "name": "setFeeOut", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -663,12 +748,12 @@ { "inputs": [ { - "internalType": "uint256", - "name": "feeOut_", - "type": "uint256" + "internalType": "address", + "name": "oracleAddress_", + "type": "address" } ], - "name": "setFeeOut", + "name": "setOracle", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -681,7 +766,7 @@ "type": "uint256" } ], - "name": "setVaiMintCap", + "name": "setVAIMintCap", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -713,7 +798,13 @@ } ], "name": "swapStableForVAI", - "outputs": [], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, @@ -731,7 +822,13 @@ } ], "name": "swapVAIForStable", - "outputs": [], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, @@ -809,84 +906,84 @@ "type": "constructor" } ], - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", "receipt": { "to": null, - "from": "0xFEA1c651A47FE29dB9b1bf3cC1f224d8D9CFF68C", - "contractAddress": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", - "transactionIndex": 10, - "gasUsed": "907219", - "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000000000000000000000000000000000000000000000000000200000000000000008000000000000000000000000000000002040001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000400000000000000800000000000000000000000000024000000000000000010040000000000040401000000000000000020000000020000000000010000000000000000000800000000000000000100000000", - "blockHash": "0xeec7469873a8faf83d5a6981e12f4e2eec12704dcf7086a0fddd84bcc8f1239f", - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", + "from": "0x8BDA9f9E1fEF0DFd404Fef338D9fE4c543d172e1", + "contractAddress": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", + "transactionIndex": 0, + "gasUsed": "912188", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000000000000000000000040000000000000000800000000002000000000000000008000010000000000000000000000000002000001040400000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000080000000000080000000000000800000000000000000000010000000000400000004000000800000000000000000000000000020000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000800000000000000000000000000", + "blockHash": "0xfd6ae513584f44db7bf9add95b28841640721a6902c07934cc11654c36812776", + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", "logs": [ { - "transactionIndex": 10, - "blockNumber": 30883315, - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", - "address": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", + "transactionIndex": 0, + "blockNumber": 32091799, + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", + "address": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", "topics": [ "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000c319b8207a9fb2797710bb79b4ab8933f90da9b3" + "0x000000000000000000000000dda903294fb71141302ad3bf2af37dd6cbd5dbbf" ], "data": "0x", - "logIndex": 45, - "blockHash": "0xeec7469873a8faf83d5a6981e12f4e2eec12704dcf7086a0fddd84bcc8f1239f" + "logIndex": 0, + "blockHash": "0xfd6ae513584f44db7bf9add95b28841640721a6902c07934cc11654c36812776" }, { - "transactionIndex": 10, - "blockNumber": 30883315, - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", - "address": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", + "transactionIndex": 0, + "blockNumber": 32091799, + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", + "address": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000fea1c651a47fe29db9b1bf3cc1f224d8d9cff68c" + "0x0000000000000000000000008bda9f9e1fef0dfd404fef338d9fe4c543d172e1" ], "data": "0x", - "logIndex": 46, - "blockHash": "0xeec7469873a8faf83d5a6981e12f4e2eec12704dcf7086a0fddd84bcc8f1239f" + "logIndex": 1, + "blockHash": "0xfd6ae513584f44db7bf9add95b28841640721a6902c07934cc11654c36812776" }, { - "transactionIndex": 10, - "blockNumber": 30883315, - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", - "address": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", + "transactionIndex": 0, + "blockNumber": 32091799, + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", + "address": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045f8a08f534f34a97187626e05d4b6648eeaa9aa", - "logIndex": 47, - "blockHash": "0xeec7469873a8faf83d5a6981e12f4e2eec12704dcf7086a0fddd84bcc8f1239f" + "logIndex": 2, + "blockHash": "0xfd6ae513584f44db7bf9add95b28841640721a6902c07934cc11654c36812776" }, { - "transactionIndex": 10, - "blockNumber": 30883315, - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", - "address": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", + "transactionIndex": 0, + "blockNumber": 32091799, + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", + "address": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 48, - "blockHash": "0xeec7469873a8faf83d5a6981e12f4e2eec12704dcf7086a0fddd84bcc8f1239f" + "logIndex": 3, + "blockHash": "0xfd6ae513584f44db7bf9add95b28841640721a6902c07934cc11654c36812776" }, { - "transactionIndex": 10, - "blockNumber": 30883315, - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", - "address": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", + "transactionIndex": 0, + "blockNumber": 32091799, + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", + "address": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000007877ffd62649b6a1557b55d4c20fcbab17344c91", - "logIndex": 49, - "blockHash": "0xeec7469873a8faf83d5a6981e12f4e2eec12704dcf7086a0fddd84bcc8f1239f" + "logIndex": 4, + "blockHash": "0xfd6ae513584f44db7bf9add95b28841640721a6902c07934cc11654c36812776" } ], - "blockNumber": 30883315, - "cumulativeGasUsed": "2792437", + "blockNumber": 32091799, + "cumulativeGasUsed": "912188", "status": 1, "byzantium": true }, "args": [ - "0xC319b8207a9FB2797710BB79B4aB8933f90dA9B3", + "0xDDa903294fB71141302aD3Bf2AF37dD6Cbd5DBbF", "0x7877fFd62649b6A1557B55D4c20fcBaB17344C91", - "0x728cdbca00000000000000000000000045f8a08f534f34a97187626e05d4b6648eeaa9aa000000000000000000000000fea1c651a47fe29db9b1bf3cc1f224d8d9cff68c00000000000000000000000094d1820b2d1c7c7452a163983dc888cec546b77d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000422ca8b0a00a425000000" + "0x728cdbca00000000000000000000000045f8a08f534f34a97187626e05d4b6648eeaa9aa000000000000000000000000fea1c651a47fe29db9b1bf3cc1f224d8d9cff68c0000000000000000000000003cd69251d04a28d887ac14cbe2e14c52f3d578230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000422ca8b0a00a425000000" ], "numDeployments": 1, "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", @@ -898,7 +995,7 @@ "args": [ "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA", "0xFEA1c651A47FE29dB9b1bf3cC1f224d8D9CFF68C", - "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D", + "0x3cD69251D04A28d887Ac14cbe2E14c52F3D57823", 0, 10, { @@ -907,7 +1004,7 @@ } ] }, - "implementation": "0xC319b8207a9FB2797710BB79B4aB8933f90dA9B3", + "implementation": "0xDDa903294fB71141302aD3Bf2AF37dD6Cbd5DBbF", "devdoc": { "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", "kind": "dev", diff --git a/deployments/bsctestnet/PegStability_USDT_Implementation.json b/deployments/bsctestnet/PegStability_USDT_Implementation.json index 08c7fde04..3dec014d7 100644 --- a/deployments/bsctestnet/PegStability_USDT_Implementation.json +++ b/deployments/bsctestnet/PegStability_USDT_Implementation.json @@ -1,11 +1,11 @@ { - "address": "0xC319b8207a9FB2797710BB79B4aB8933f90dA9B3", + "address": "0xDDa903294fB71141302aD3Bf2AF37dD6Cbd5DBbF", "abi": [ { "inputs": [ { "internalType": "address", - "name": "vTokenAddress_", + "name": "stableTokenAddress_", "type": "address" }, { @@ -17,6 +17,41 @@ "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [], + "name": "AlreadyPaused", + "type": "error" + }, + { + "inputs": [], + "name": "AmountTooSmall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidFee", + "type": "error" + }, + { + "inputs": [], + "name": "NotEnoughVAI", + "type": "error" + }, + { + "inputs": [], + "name": "NotPaused", + "type": "error" + }, + { + "inputs": [], + "name": "Paused", + "type": "error" + }, + { + "inputs": [], + "name": "TooManyDecimals", + "type": "error" + }, { "inputs": [ { @@ -39,23 +74,29 @@ "type": "error" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "oldComptroller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newComptroller", - "type": "address" - } - ], - "name": "ComptrollerChanged", - "type": "event" + "inputs": [], + "name": "VAIMintCapReached", + "type": "error" + }, + { + "inputs": [], + "name": "VAIMintedUnderflow", + "type": "error" + }, + { + "inputs": [], + "name": "VAITransferFail", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAmount", + "type": "error" }, { "anonymous": false, @@ -127,6 +168,25 @@ "name": "NewAccessControlManager", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -228,17 +288,17 @@ { "indexed": false, "internalType": "uint256", - "name": "vaiFee", + "name": "stableOut", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "stableOut", + "name": "vaiFee", "type": "uint256" } ], - "name": "VaiForStableSwapped", + "name": "VAIForStableSwapped", "type": "event" }, { @@ -257,7 +317,7 @@ "type": "uint256" } ], - "name": "VaiMintCapChanged", + "name": "VAIMintCapChanged", "type": "event" }, { @@ -333,23 +393,10 @@ }, { "inputs": [], - "name": "VAI_ADDRESS", + "name": "VAI", "outputs": [ { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "VTOKEN_ADDRESS", - "outputs": [ - { - "internalType": "address", + "internalType": "contract IVAI", "name": "", "type": "address" } @@ -377,19 +424,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "comptroller", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "feeIn", @@ -430,7 +464,7 @@ }, { "internalType": "address", - "name": "comptroller_", + "name": "oracleAddress_", "type": "address" }, { @@ -467,6 +501,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "owner", @@ -500,6 +547,44 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stableTknAmount", + "type": "uint256" + } + ], + "name": "previewSwapStableForVAI", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stableTknAmount", + "type": "uint256" + } + ], + "name": "previewSwapVAIForStable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "renounceOwnership", @@ -530,12 +615,12 @@ { "inputs": [ { - "internalType": "address", - "name": "comptroller_", - "type": "address" + "internalType": "uint256", + "name": "feeIn_", + "type": "uint256" } ], - "name": "setComptroller", + "name": "setFeeIn", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -544,11 +629,11 @@ "inputs": [ { "internalType": "uint256", - "name": "feeIn_", + "name": "feeOut_", "type": "uint256" } ], - "name": "setFeeIn", + "name": "setFeeOut", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -556,12 +641,12 @@ { "inputs": [ { - "internalType": "uint256", - "name": "feeOut_", - "type": "uint256" + "internalType": "address", + "name": "oracleAddress_", + "type": "address" } ], - "name": "setFeeOut", + "name": "setOracle", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -574,7 +659,7 @@ "type": "uint256" } ], - "name": "setVaiMintCap", + "name": "setVAIMintCap", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -606,7 +691,13 @@ } ], "name": "swapStableForVAI", - "outputs": [], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, @@ -624,7 +715,13 @@ } ], "name": "swapVAIForStable", - "outputs": [], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, @@ -681,39 +778,39 @@ "type": "function" } ], - "transactionHash": "0x0c0d681916965a130042f585f3ef1374e830653c976e79867c18a9ac698608b5", + "transactionHash": "0xb9a823d382b902a2eed1fee1cfc76de8c98569103d2722538917ced54bdcd06f", "receipt": { "to": null, - "from": "0xFEA1c651A47FE29dB9b1bf3cC1f224d8D9CFF68C", - "contractAddress": "0xC319b8207a9FB2797710BB79B4aB8933f90dA9B3", - "transactionIndex": 1, - "gasUsed": "2382519", - "logsBloom": "0x00000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000080000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xc5984d7685e04962bda7516ebb47bab2719739d1db17089da314be535f6cc6c5", - "transactionHash": "0x0c0d681916965a130042f585f3ef1374e830653c976e79867c18a9ac698608b5", + "from": "0x8BDA9f9E1fEF0DFd404Fef338D9fE4c543d172e1", + "contractAddress": "0xDDa903294fB71141302aD3Bf2AF37dD6Cbd5DBbF", + "transactionIndex": 0, + "gasUsed": "1803394", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000004000000000000000000000000000000000040040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xd5aa7e7016d8ee6745aa590e1b9dceb35009b71496f5dd10e0bbe28dfc3322aa", + "transactionHash": "0xb9a823d382b902a2eed1fee1cfc76de8c98569103d2722538917ced54bdcd06f", "logs": [ { - "transactionIndex": 1, - "blockNumber": 30883313, - "transactionHash": "0x0c0d681916965a130042f585f3ef1374e830653c976e79867c18a9ac698608b5", - "address": "0xC319b8207a9FB2797710BB79B4aB8933f90dA9B3", + "transactionIndex": 0, + "blockNumber": 32091797, + "transactionHash": "0xb9a823d382b902a2eed1fee1cfc76de8c98569103d2722538917ced54bdcd06f", + "address": "0xDDa903294fB71141302aD3Bf2AF37dD6Cbd5DBbF", "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", "logIndex": 0, - "blockHash": "0xc5984d7685e04962bda7516ebb47bab2719739d1db17089da314be535f6cc6c5" + "blockHash": "0xd5aa7e7016d8ee6745aa590e1b9dceb35009b71496f5dd10e0bbe28dfc3322aa" } ], - "blockNumber": 30883313, - "cumulativeGasUsed": "2403519", + "blockNumber": 32091797, + "cumulativeGasUsed": "1803394", "status": 1, "byzantium": true }, - "args": ["0xb7526572FFE56AB9D7489838Bf2E18e3323b441A", "0x5fFbE5302BadED40941A403228E6AD03f93752d9"], + "args": ["0xA11c8D9DC9b66E209Ef60F0C8D969D3CD988782c", "0x5fFbE5302BadED40941A403228E6AD03f93752d9"], "numDeployments": 1, - "solcInputHash": "70d128da5db4d0b45c404d3f3fe2c806", - "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vTokenAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaiAddress_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldComptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newComptroller\",\"type\":\"address\"}],\"name\":\"ComptrollerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeIn\",\"type\":\"uint256\"}],\"name\":\"FeeInChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeOut\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeOut\",\"type\":\"uint256\"}],\"name\":\"FeeOutChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"PSMPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"PSMResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stableIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vaiOut\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"StableForVAISwapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vaiBurnt\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vaiFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stableOut\",\"type\":\"uint256\"}],\"name\":\"VaiForStableSwapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldCap\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newCap\",\"type\":\"uint256\"}],\"name\":\"VaiMintCapChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldTreasury\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"VenusTreasuryChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BASIS_POINTS_DIVISOR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MANTISSA_ONE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ONE_DOLLAR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STABLE_TOKEN_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VAI_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VTOKEN_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"comptroller\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"venusTreasury_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"comptroller_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeIn_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeOut_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"vaiMintCap_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resume\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller_\",\"type\":\"address\"}],\"name\":\"setComptroller\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeIn_\",\"type\":\"uint256\"}],\"name\":\"setFeeIn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeOut_\",\"type\":\"uint256\"}],\"name\":\"setFeeOut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"vaiMintCap_\",\"type\":\"uint256\"}],\"name\":\"setVaiMintCap\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"venusTreasury_\",\"type\":\"address\"}],\"name\":\"setVenusTreasury\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"stableTknAmount\",\"type\":\"uint256\"}],\"name\":\"swapStableForVAI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"stableTknAmount\",\"type\":\"uint256\"}],\"name\":\"swapVAIForStable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vaiMintCap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vaiMinted\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"venusTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus Protocol\",\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\"},\"initialize(address,address,address,uint256,uint256,uint256)\":{\"params\":{\"accessControlManager_\":\"The address of the AccessControlManager contract\",\"comptroller_\":\"The address of the Comptroller contract\",\"feeIn_\":\"The percentage of fees to be applied to a stablecoin -> VAI swap\",\"feeOut_\":\"The percentage of fees to be applied to a VAI -> stablecoin swap\",\"vaiMintCap_\":\"The cap for the total amount of VAI that can be minted\",\"venusTreasury_\":\"The address where fees will be sent\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pause()\":{\"details\":\"Reverts if the contract is already paused\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"resume()\":{\"details\":\"Reverts if the contract is not paused\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setComptroller(address)\":{\"details\":\"Reverts if the new address is zero or the oracle address returned from Comptroller is zero\",\"params\":{\"comptroller_\":\"The new address of the Comptroller contract\"}},\"setFeeIn(uint256)\":{\"details\":\"Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR)\",\"params\":{\"feeIn_\":\"The new fee percentage for incoming swaps\"}},\"setFeeOut(uint256)\":{\"details\":\"Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR)\",\"params\":{\"feeOut_\":\"The new fee percentage for outgoing swaps\"}},\"setVaiMintCap(uint256)\":{\"details\":\"Set the maximum amount of VAI that can be minted through this contract\",\"params\":{\"vaiMintCap_\":\"The new maximum amount of VAI that can be minted\"}},\"setVenusTreasury(address)\":{\"details\":\"Reverts if the new address is zero\",\"params\":{\"venusTreasury_\":\"The new address of the Venus Treasury contract\"}},\"swapStableForVAI(address,uint256)\":{\"details\":\"This function adds support to fee-on-transfer tokens. The actualTransferAmt is calculated, by recording token balance state before and after the transfer.\",\"params\":{\"receiver\":\"The address that will receive the VAI tokens.\",\"stableTknAmount\":\"The amount of stable tokens to be swapped.\"}},\"swapVAIForStable(address,uint256)\":{\"params\":{\"receiver\":\"The address where the stablecoin will be sent\",\"stableTknAmount\":\"The amount of stable tokens to receive\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"}},\"title\":\"Peg Stability Contract\",\"version\":1},\"userdoc\":{\"errors\":{\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}]},\"events\":{\"ComptrollerChanged(address,address)\":{\"notice\":\"Event emitted when comptroller state var is modified\"},\"FeeInChanged(uint256,uint256)\":{\"notice\":\"Event emitted when feeIn state var is modified\"},\"FeeOutChanged(uint256,uint256)\":{\"notice\":\"Event emitted when feeOut state var is modified\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"PSMPaused(address)\":{\"notice\":\"Event emitted when contract is paused\"},\"PSMResumed(address)\":{\"notice\":\"Event emitted when the contract is resumed after pause\"},\"StableForVAISwapped(uint256,uint256,uint256)\":{\"notice\":\"Event emitted when stable token is swapped for VAI\"},\"VaiForStableSwapped(uint256,uint256,uint256)\":{\"notice\":\"Event emitted when stable token is swapped for VAI\"},\"VaiMintCapChanged(uint256,uint256)\":{\"notice\":\"Event emitted when vaiMintCap state var is modified\"},\"VenusTreasuryChanged(address,address)\":{\"notice\":\"Event emitted when venusTreasury state var is modified\"}},\"kind\":\"user\",\"methods\":{\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"initialize(address,address,address,uint256,uint256,uint256)\":{\"notice\":\"Initializes the contract via Proxy Contract with the required parameters\"},\"pause()\":{\"notice\":\"Pause the PSM contract\"},\"resume()\":{\"notice\":\"Resume the PSM contract\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setComptroller(address)\":{\"notice\":\"Set the address of the Comptroller contract from which we obtain the oracle address\"},\"setFeeIn(uint256)\":{\"notice\":\"Set the fee percentage for incoming swaps\"},\"setFeeOut(uint256)\":{\"notice\":\"Set the fee percentage for outgoing swaps\"},\"setVenusTreasury(address)\":{\"notice\":\"Set the address of the Venus Treasury contract\"},\"swapStableForVAI(address,uint256)\":{\"notice\":\"Swaps stable tokens for VAI with fees.\"},\"swapVAIForStable(address,uint256)\":{\"notice\":\"Swaps VAI for a stable token\"}},\"notice\":\"Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/PegStability/PegStability.sol\":\"PegStability\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() external {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xd712fb45b3ea0ab49679164e3895037adc26ce12879d5184feb040e01c1c07a9\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x2b3005a0064cfc558bdf64b2bae94b565f4574a536aadd61c13838d4f2157790\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x4e733d3164f73f461eaf9d8087a7ad1ea180bdc8ba0d3d61b0e1ae16d8e63dff\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xcc70d8e2281fb3ff69e8ab242500f10142cd0a7fa8dd9e45882be270d4d09024\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/draft-IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n function safeTransfer(\\n IERC20Upgradeable token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20Upgradeable token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20Upgradeable token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20Upgradeable token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20Upgradeable token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n function safePermit(\\n IERC20PermitUpgradeable token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x220c4a5af915e656be2aaa85ca57505d102418e476b1e2ef6c62e0c6ac143871\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title Venus Access Control Contract.\\n * @dev The AccessControlledV8 contract is a wrapper around the OpenZeppelin AccessControl contract\\n * It provides a standardized way to control access to methods within the Venus Smart Contract Ecosystem.\\n * The contract allows the owner to set an AccessControlManager contract address.\\n * It can restrict method calls based on the sender's role and the method's signature.\\n */\\n\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x618d942756b93e02340a42f3c80aa99fc56be1a96861f5464dc23a76bf30b3a5\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x41deef84d1839590b243b66506691fde2fb938da01eabde53e82d3b8316fdaf9\",\"license\":\"BSD-3-Clause\"},\"contracts/PegStability/PegStability.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\n\\ninterface VAI {\\n function balanceOf(address usr) external returns (uint256);\\n\\n function transferFrom(address src, address dst, uint amount) external returns (bool);\\n\\n function mint(address usr, uint wad) external;\\n\\n function burn(address usr, uint wad) external;\\n}\\n\\ninterface IPriceOracle {\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface IVTokenUnderlying {\\n function underlying() external view returns (address);\\n}\\n\\ninterface OracleProviderInterface {\\n function oracle() external view returns (address);\\n}\\n\\ninterface DecimalProvider {\\n function decimals() external view returns (uint8);\\n}\\n\\n/**\\n * @title Peg Stability Contract\\n * @notice Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.\\n * @author Venus Protocol\\n */\\ncontract PegStability is AccessControlledV8, ReentrancyGuardUpgradeable {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n // Helper enum for calculation of the fee\\n enum FeeDirection {\\n IN,\\n OUT\\n }\\n uint256 public constant BASIS_POINTS_DIVISOR = 10000; // fee is in basis points\\n uint256 public constant MANTISSA_ONE = 1e18;\\n uint256 public immutable ONE_DOLLAR; // Our oracle is returning amount depending on the number of decimals of the stable token. (36 - asset_decimals). E.g. 8 decimal asset = 1e28\\n address public immutable VAI_ADDRESS;\\n address public immutable STABLE_TOKEN_ADDRESS;\\n address public immutable VTOKEN_ADDRESS; // vToken having as underlying the stableToken\\n address public comptroller; // used as a single point of truth for oracle address\\n address public venusTreasury;\\n uint256 public feeIn; // incoming VAI fee\\n uint256 public feeOut; // outgoing VAI fee\\n uint256 public vaiMintCap; // max amount of VAI that can be minted through this contract\\n uint256 public vaiMinted;\\n bool public isPaused;\\n\\n /// @notice Event emitted when contract is paused\\n event PSMPaused(address indexed admin);\\n\\n /// @notice Event emitted when the contract is resumed after pause\\n event PSMResumed(address indexed admin);\\n\\n /// @notice Event emitted when feeIn state var is modified\\n event FeeInChanged(uint256 oldFeeIn, uint256 newFeeIn);\\n\\n /// @notice Event emitted when feeOut state var is modified\\n event FeeOutChanged(uint256 oldFeeOut, uint256 newFeeOut);\\n\\n /// @notice Event emitted when vaiMintCap state var is modified\\n event VaiMintCapChanged(uint256 oldCap, uint256 newCap);\\n\\n /// @notice Event emitted when venusTreasury state var is modified\\n event VenusTreasuryChanged(address indexed oldTreasury, address indexed newTreasury);\\n\\n /// @notice Event emitted when comptroller state var is modified\\n event ComptrollerChanged(address indexed oldComptroller, address indexed newComptroller);\\n\\n /// @notice Event emitted when stable token is swapped for VAI\\n event StableForVAISwapped(uint256 stableIn, uint256 vaiOut, uint256 fee);\\n\\n /// @notice Event emitted when stable token is swapped for VAI\\n event VaiForStableSwapped(uint256 vaiBurnt, uint256 vaiFee, uint256 stableOut);\\n\\n /**\\n * @dev Prevents functions to execute when contract is paused.\\n */\\n modifier isActive() {\\n require(!isPaused, \\\"Contract is paused.\\\");\\n _;\\n }\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address vTokenAddress_, address vaiAddress_) {\\n ensureNonzeroAddress(vTokenAddress_);\\n ensureNonzeroAddress(vaiAddress_);\\n\\n address stableTokenAddress_ = IVTokenUnderlying(vTokenAddress_).underlying();\\n uint256 decimals_ = DecimalProvider(stableTokenAddress_).decimals();\\n require(decimals_ <= 18, \\\"too much decimals\\\");\\n ONE_DOLLAR = 10 ** (36 - decimals_); // 1$ scaled to the decimals returned by our Oracle\\n\\n VTOKEN_ADDRESS = vTokenAddress_;\\n STABLE_TOKEN_ADDRESS = stableTokenAddress_;\\n VAI_ADDRESS = vaiAddress_;\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Initializes the contract via Proxy Contract with the required parameters\\n * @param accessControlManager_ The address of the AccessControlManager contract\\n * @param venusTreasury_ The address where fees will be sent\\n * @param comptroller_ The address of the Comptroller contract\\n * @param feeIn_ The percentage of fees to be applied to a stablecoin -> VAI swap\\n * @param feeOut_ The percentage of fees to be applied to a VAI -> stablecoin swap\\n * @param vaiMintCap_ The cap for the total amount of VAI that can be minted\\n */\\n function initialize(\\n address accessControlManager_,\\n address venusTreasury_,\\n address comptroller_,\\n uint256 feeIn_,\\n uint256 feeOut_,\\n uint256 vaiMintCap_\\n ) external initializer {\\n ensureNonzeroAddress(accessControlManager_);\\n ensureNonzeroAddress(venusTreasury_);\\n ensureNonzeroAddress(comptroller_);\\n ensureNonzeroAddress(OracleProviderInterface(comptroller_).oracle());\\n __AccessControlled_init(accessControlManager_);\\n __ReentrancyGuard_init();\\n\\n require(feeIn_ < BASIS_POINTS_DIVISOR, \\\"Invalid fee in.\\\");\\n require(feeOut_ < BASIS_POINTS_DIVISOR, \\\"Invalid fee out.\\\");\\n\\n feeIn = feeIn_;\\n feeOut = feeOut_;\\n vaiMintCap = vaiMintCap_;\\n venusTreasury = venusTreasury_;\\n comptroller = comptroller_;\\n }\\n\\n /*** Swap Functions ***/\\n\\n /**\\n * @notice Swaps VAI for a stable token\\n * @param receiver The address where the stablecoin will be sent\\n * @param stableTknAmount The amount of stable tokens to receive\\n */\\n // @custom:event Emits VaiForStableSwapped event\\n function swapVAIForStable(address receiver, uint256 stableTknAmount) external isActive nonReentrant {\\n ensureNonzeroAddress(receiver);\\n require(stableTknAmount > 0, \\\"Amount must be greater than zero.\\\");\\n\\n // calculate USD value of the stable token amount scaled in 18 decimals\\n uint256 stableTknAmountUSD = previewTokenUSDAmount(stableTknAmount, FeeDirection.OUT);\\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.OUT);\\n\\n require(VAI(VAI_ADDRESS).balanceOf(msg.sender) >= stableTknAmountUSD + fee, \\\"Not enough VAI.\\\");\\n require(vaiMinted >= stableTknAmountUSD, \\\"Can't burn more VAI than minted.\\\");\\n\\n unchecked {\\n vaiMinted -= stableTknAmountUSD;\\n }\\n\\n if (fee != 0) {\\n bool success = VAI(VAI_ADDRESS).transferFrom(msg.sender, venusTreasury, fee);\\n require(success, \\\"VAI fee transfer failed.\\\");\\n }\\n\\n VAI(VAI_ADDRESS).burn(msg.sender, stableTknAmountUSD);\\n IERC20Upgradeable(STABLE_TOKEN_ADDRESS).safeTransfer(receiver, stableTknAmount);\\n emit VaiForStableSwapped(stableTknAmountUSD, fee, stableTknAmount);\\n }\\n\\n /**\\n * @notice Swaps stable tokens for VAI with fees.\\n * @dev This function adds support to fee-on-transfer tokens. The actualTransferAmt is calculated, by recording token balance state before and after the transfer.\\n * @param receiver The address that will receive the VAI tokens.\\n * @param stableTknAmount The amount of stable tokens to be swapped.\\n */\\n // @custom:event Emits StableForVAISwapped event\\n function swapStableForVAI(address receiver, uint256 stableTknAmount) external isActive nonReentrant {\\n ensureNonzeroAddress(receiver);\\n require(stableTknAmount > 0, \\\"Amount must be greater than zero.\\\");\\n\\n // transfer IN, supporting fee-on-transfer tokens\\n uint256 balanceBefore = IERC20Upgradeable(STABLE_TOKEN_ADDRESS).balanceOf(address(this));\\n IERC20Upgradeable(STABLE_TOKEN_ADDRESS).safeTransferFrom(msg.sender, address(this), stableTknAmount);\\n uint256 balanceAfter = IERC20Upgradeable(STABLE_TOKEN_ADDRESS).balanceOf(address(this));\\n\\n //calculate actual transfered amount (in case of fee-on-transfer tokens)\\n uint256 actualTransferAmt = balanceAfter - balanceBefore;\\n\\n // calculate USD value of the stable token amount scaled in 18 decimals\\n uint256 actualTransferAmtInUSD = previewTokenUSDAmount(actualTransferAmt, FeeDirection.IN);\\n\\n //calculate feeIn\\n uint256 fee = _calculateFee(actualTransferAmtInUSD, FeeDirection.IN);\\n uint256 vaiToMint = actualTransferAmtInUSD - fee;\\n\\n require(vaiMinted + actualTransferAmtInUSD <= vaiMintCap, \\\"VAI mint cap reached.\\\");\\n unchecked {\\n vaiMinted += actualTransferAmtInUSD;\\n }\\n\\n // mint VAI to receiver\\n VAI(VAI_ADDRESS).mint(receiver, vaiToMint);\\n\\n // mint VAI fee to venus treasury\\n if (fee != 0) {\\n VAI(VAI_ADDRESS).mint(venusTreasury, fee);\\n }\\n\\n emit StableForVAISwapped(actualTransferAmt, vaiToMint, fee);\\n }\\n\\n /*** Admin Functions ***/\\n\\n /**\\n * @notice Pause the PSM contract\\n * @dev Reverts if the contract is already paused\\n */\\n // @custom:event Emits PSMPaused event\\n function pause() external {\\n _checkAccessAllowed(\\\"pause()\\\");\\n require(!isPaused, \\\"PSM is already paused.\\\");\\n isPaused = true;\\n emit PSMPaused(msg.sender);\\n }\\n\\n /**\\n * @notice Resume the PSM contract\\n * @dev Reverts if the contract is not paused\\n */\\n // @custom:event Emits PSMResumed event\\n function resume() external {\\n _checkAccessAllowed(\\\"resume()\\\");\\n require(isPaused, \\\"PSM is not paused.\\\");\\n isPaused = false;\\n emit PSMResumed(msg.sender);\\n }\\n\\n /**\\n * @notice Set the fee percentage for incoming swaps\\n * @dev Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR)\\n * @param feeIn_ The new fee percentage for incoming swaps\\n */\\n // @custom:event Emits FeeInChanged event\\n function setFeeIn(uint256 feeIn_) external {\\n _checkAccessAllowed(\\\"setFeeIn(uint256)\\\");\\n // feeIn = 10000 = 100%\\n require(feeIn_ < BASIS_POINTS_DIVISOR, \\\"Invalid fee.\\\");\\n uint256 oldFeeIn = feeIn;\\n feeIn = feeIn_;\\n emit FeeInChanged(oldFeeIn, feeIn_);\\n }\\n\\n /**\\n * @notice Set the fee percentage for outgoing swaps\\n * @dev Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR)\\n * @param feeOut_ The new fee percentage for outgoing swaps\\n */\\n // @custom:event Emits FeeOutChanged event\\n function setFeeOut(uint256 feeOut_) external {\\n _checkAccessAllowed(\\\"setFeeOut(uint256)\\\");\\n // feeOut = 10000 = 100%\\n require(feeOut_ < BASIS_POINTS_DIVISOR, \\\"Invalid fee.\\\");\\n uint256 oldFeeOut = feeOut;\\n feeOut = feeOut_;\\n emit FeeOutChanged(oldFeeOut, feeOut_);\\n }\\n\\n /**\\n * @dev Set the maximum amount of VAI that can be minted through this contract\\n * @param vaiMintCap_ The new maximum amount of VAI that can be minted\\n */\\n // @custom:event Emits VaiMintCapChanged event\\n function setVaiMintCap(uint256 vaiMintCap_) external {\\n _checkAccessAllowed(\\\"setVaiMintCap(uint256)\\\");\\n uint256 oldVaiMintCap = vaiMintCap;\\n vaiMintCap = vaiMintCap_;\\n emit VaiMintCapChanged(oldVaiMintCap, vaiMintCap_);\\n }\\n\\n /**\\n * @notice Set the address of the Venus Treasury contract\\n * @dev Reverts if the new address is zero\\n * @param venusTreasury_ The new address of the Venus Treasury contract\\n */\\n // @custom:event Emits VenusTreasuryChanged event\\n function setVenusTreasury(address venusTreasury_) external {\\n _checkAccessAllowed(\\\"setVenusTreasury(address)\\\");\\n ensureNonzeroAddress(venusTreasury_);\\n address oldTreasuryAddress = venusTreasury;\\n venusTreasury = venusTreasury_;\\n emit VenusTreasuryChanged(oldTreasuryAddress, venusTreasury_);\\n }\\n\\n /**\\n * @notice Set the address of the Comptroller contract from which we obtain the oracle address\\n * @dev Reverts if the new address is zero or the oracle address returned from Comptroller is zero\\n * @param comptroller_ The new address of the Comptroller contract\\n */\\n // @custom:event Emits ComptrollerChanged event\\n function setComptroller(address comptroller_) external {\\n _checkAccessAllowed(\\\"setComptroller(address)\\\");\\n ensureNonzeroAddress(comptroller_);\\n ensureNonzeroAddress(OracleProviderInterface(comptroller_).oracle());\\n address oldComptrollerAddress = comptroller;\\n comptroller = comptroller_;\\n emit ComptrollerChanged(oldComptrollerAddress, comptroller_);\\n }\\n\\n /*** Helper Functions ***/\\n\\n /**\\n * @dev Calculates the USD value of the given amount of stable tokens depending on the swap direction.\\n * @param amount The amount of stable tokens.\\n * @param direction The direction of the swap.\\n * @return The USD value of the given amount of stable tokens scaled by 1e18 taking into account the direction of the swap\\n */\\n function previewTokenUSDAmount(uint256 amount, FeeDirection direction) internal view returns (uint256) {\\n return (amount * getPriceInUSD(direction)) / MANTISSA_ONE;\\n }\\n\\n /**\\n * @notice Get the price of stable token in USD\\n * @dev This function returns either min(1$,oraclePrice) or max(1$,oraclePrice) with a decimal scale (36 - asset_decimals). E.g. for 8 decimal token 1$ will be 1e28\\n * @param direction The direction of the swap: FeeDirection.IN or FeeDirection.OUT\\n * @return The price in USD, adjusted based on the selected direction\\n */\\n function getPriceInUSD(FeeDirection direction) internal view returns (uint256) {\\n address priceOracleAddress = OracleProviderInterface(comptroller).oracle();\\n // get price with a scale = (36 - asset_decimals)\\n uint256 price = IPriceOracle(priceOracleAddress).getUnderlyingPrice(VTOKEN_ADDRESS);\\n\\n if (direction == FeeDirection.IN) {\\n // MIN(1, price)\\n return price < ONE_DOLLAR ? price : ONE_DOLLAR;\\n } else {\\n // MAX(1, price)\\n return price > ONE_DOLLAR ? price : ONE_DOLLAR;\\n }\\n }\\n\\n /**\\n * @notice Calculate the fee amount based on the input amount and fee percentage\\n * @dev Reverts if the fee percentage calculation results in rounding down to 0\\n * @param amount The input amount to calculate the fee from\\n * @param direction The direction of the fee: FeeDirection.IN or FeeDirection.OUT\\n * @return The fee amount\\n */\\n function _calculateFee(uint256 amount, FeeDirection direction) internal view returns (uint256) {\\n uint256 feePercent;\\n if (direction == FeeDirection.IN) {\\n feePercent = feeIn;\\n } else {\\n feePercent = feeOut;\\n }\\n if (feePercent == 0) {\\n return 0;\\n } else {\\n // checking if the percent calculation will result in rounding down to 0\\n require(amount * feePercent >= BASIS_POINTS_DIVISOR, \\\"Amount too small.\\\");\\n return (amount * feePercent) / BASIS_POINTS_DIVISOR;\\n }\\n }\\n\\n /**\\n * @notice Checks that the address is not the zero address\\n * @param someone The address to check\\n */\\n function ensureNonzeroAddress(address someone) private pure {\\n require(someone != address(0), \\\"Can't be zero address.\\\");\\n }\\n}\\n\",\"keccak256\":\"0x1ca013d295c0ea306a417bb9a4fae6f9f3c43bf40f31ba394b9c6091d341acdc\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", - "bytecode": "0x6101006040523480156200001257600080fd5b5060405162002ee138038062002ee18339810160408190526200003591620002ec565b6200004082620001b5565b6200004b81620001b5565b6000826001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200008c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000b2919062000324565b90506000816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200011b919062000349565b60ff16905060128111156200016b5760405162461bcd60e51b8152602060048201526011602482015270746f6f206d75636820646563696d616c7360781b60448201526064015b60405180910390fd5b6200017881602462000384565b6200018590600a6200049d565b6080526001600160a01b0380851660e05282811660c052831660a052620001ab62000210565b50505050620004ab565b6001600160a01b0381166200020d5760405162461bcd60e51b815260206004820152601660248201527f43616e2774206265207a65726f20616464726573732e00000000000000000000604482015260640162000162565b50565b600054610100900460ff16156200027a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840162000162565b60005460ff9081161015620002cd576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b80516001600160a01b0381168114620002e757600080fd5b919050565b600080604083850312156200030057600080fd5b6200030b83620002cf565b91506200031b60208401620002cf565b90509250929050565b6000602082840312156200033757600080fd5b6200034282620002cf565b9392505050565b6000602082840312156200035c57600080fd5b815160ff811681146200034257600080fd5b634e487b7160e01b600052601160045260246000fd5b6000828210156200039957620003996200036e565b500390565b600181815b80851115620003df578160001904821115620003c357620003c36200036e565b80851615620003d157918102915b93841c9390800290620003a3565b509250929050565b600082620003f85750600162000497565b81620004075750600062000497565b81600181146200042057600281146200042b576200044b565b600191505062000497565b60ff8411156200043f576200043f6200036e565b50506001821b62000497565b5060208310610133831016604e8410600b841016171562000470575081810a62000497565b6200047c83836200039e565b80600019048211156200049357620004936200036e565b0290505b92915050565b6000620003428383620003e7565b60805160a05160c05160e05161299a62000547600039600081816104660152611fa201526000818161036d015281816109ae015281816113e60152818161148201526114db0152600081816103e3015281816106a501528181610830015281816109230152818161164c01526116ff015260008181610269015281816120380152818161205f0152818161208f01526120b6015261299a6000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806379ba509711610104578063b4a0bdf3116100a2578063e30c397811610071578063e30c397814610421578063f23c0f401461043f578063f2fde38b1461044e578063f34d11191461046157600080fd5b8063b4a0bdf3146103c0578063bb644b03146103de578063d97c057d14610405578063dd0812681461040e57600080fd5b80638da5cb5b116100de5780638da5cb5b1461034a5780638ec2b23914610368578063a52f540c1461038f578063b187bd26146103a257600080fd5b806379ba5097146103275780638456cb591461032f5780638bad38dd1461033757600080fd5b806355725d411161017c5780636ebcd7ac1161014b5780636ebcd7ac146102f0578063715018a614610303578063728cdbca1461030b578063769a48d91461031e57600080fd5b806355725d4114610251578063572ca9e714610264578063586f99331461028b5780635fe3b567146102d057600080fd5b80630e32cb86116101b85780630e32cb8614610218578063126082cf1461022b57806340a1dd461461023457806342e8a9721461023e57600080fd5b8063046f7da2146101df5780630696819f146101e95780630d35d2ed14610205575b600080fd5b6101e7610488565b005b6101f260fe5481565b6040519081526020015b60405180910390f35b6101e7610213366004612623565b610574565b6101e761022636600461264f565b610a28565b6101f261271081565b6101f26101005481565b6101e761024c366004612673565b610a3c565b6101e761025f366004612673565b610b11565b6101f27f000000000000000000000000000000000000000000000000000000000000000081565b60fc546102ab9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fc565b60fb546102ab9073ffffffffffffffffffffffffffffffffffffffff1681565b6101e76102fe366004612673565b610bde565b6101e7610c5a565b6101e761031936600461268c565b610c6e565b6101f260fd5481565b6101e7610f8d565b6101e7611025565b6101e761034536600461264f565b611110565b60335473ffffffffffffffffffffffffffffffffffffffff166102ab565b6102ab7f000000000000000000000000000000000000000000000000000000000000000081565b6101e761039d36600461264f565b61121c565b610101546103b09060ff1681565b60405190151581526020016101fc565b60975473ffffffffffffffffffffffffffffffffffffffff166102ab565b6102ab7f000000000000000000000000000000000000000000000000000000000000000081565b6101f260ff5481565b6101e761041c366004612623565b6112da565b60655473ffffffffffffffffffffffffffffffffffffffff166102ab565b6101f2670de0b6b3a764000081565b6101e761045c36600461264f565b6117af565b6102ab7f000000000000000000000000000000000000000000000000000000000000000081565b6104c66040518060400160405280600881526020017f726573756d65282900000000000000000000000000000000000000000000000081525061185f565b6101015460ff1661051e5760405162461bcd60e51b815260206004820152601260248201527f50534d206973206e6f74207061757365642e000000000000000000000000000060448201526064015b60405180910390fd5b61010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560405133907f108589e68122bb4da8e5020c44387cab025243d0894392e275459641a90181a290600090a2565b6101015460ff16156105c85760405162461bcd60e51b815260206004820152601360248201527f436f6e7472616374206973207061757365642e000000000000000000000000006044820152606401610515565b6105d0611938565b6105d982611991565b6000811161064f5760405162461bcd60e51b815260206004820152602160248201527f416d6f756e74206d7573742062652067726561746572207468616e207a65726f60448201527f2e000000000000000000000000000000000000000000000000000000000000006064820152608401610515565b600061065c8260016119f4565b9050600061066b826001611a25565b90506106778183612720565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a08231906024016020604051808303816000875af1158015610703573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107279190612738565b10156107755760405162461bcd60e51b815260206004820152600f60248201527f4e6f7420656e6f756768205641492e00000000000000000000000000000000006044820152606401610515565b816101005410156107c85760405162461bcd60e51b815260206004820181905260248201527f43616e2774206275726e206d6f726520564149207468616e206d696e7465642e6044820152606401610515565b6101008054839003905580156108ee5760fc546040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9182166024820152604481018390526000917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610879573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089d9190612751565b9050806108ec5760405162461bcd60e51b815260206004820152601860248201527f56414920666565207472616e73666572206661696c65642e00000000000000006044820152606401610515565b505b6040517f9dc29fac000000000000000000000000000000000000000000000000000000008152336004820152602481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690639dc29fac90604401600060405180830381600087803b15801561097c57600080fd5b505af1158015610990573d6000803e3d6000fd5b506109d792505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690508585611ada565b60408051838152602081018390529081018490527f193aebac4ee542588a7c4a31d025211f727993d5dcec18b4d6cd64518677c8d99060600160405180910390a15050610a24600160c955565b5050565b610a30611bba565b610a3981611c21565b50565b610a7a6040518060400160405280601281526020017f7365744665654f75742875696e7432353629000000000000000000000000000081525061185f565b6127108110610acb5760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206665652e00000000000000000000000000000000000000006044820152606401610515565b60fe80549082905560408051828152602081018490527fdc61767cf6b8f2d5ec16cd975db6d3a79fc69dc428b04c93e8db271de5e43b9f91015b60405180910390a15050565b610b4f6040518060400160405280601181526020017f736574466565496e2875696e743235362900000000000000000000000000000081525061185f565b6127108110610ba05760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206665652e00000000000000000000000000000000000000006044820152606401610515565b60fd80549082905560408051828152602081018490527fb76804f9786a4411a614b09a8211b2fd86f1f5b7a5e4410f35aa1578aac64e049101610b05565b610c1c6040518060400160405280601681526020017f7365745661694d696e744361702875696e74323536290000000000000000000081525061185f565b60ff80549082905560408051828152602081018490527f7c907ad6b82d09686cae9d7a7aeaca89d479b6f4bea645228455dc222d4ce4849101610b05565b610c62611bba565b610c6c6000611d29565b565b600054610100900460ff1615808015610c8e5750600054600160ff909116105b80610ca85750303b158015610ca8575060005460ff166001145b610d1a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610515565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610d7857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610d8187611991565b610d8a86611991565b610d9385611991565b610e0a8573ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610de1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e059190612773565b611991565b610e1387611d5a565b610e1b611de8565b6127108410610e6c5760405162461bcd60e51b815260206004820152600f60248201527f496e76616c69642066656520696e2e00000000000000000000000000000000006044820152606401610515565b6127108310610ebd5760405162461bcd60e51b815260206004820152601060248201527f496e76616c696420666565206f75742e000000000000000000000000000000006044820152606401610515565b60fd84905560fe83905560ff82905560fc805473ffffffffffffffffffffffffffffffffffffffff8089167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161790925560fb8054928816929091169190911790558015610f8457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b606554339073ffffffffffffffffffffffffffffffffffffffff16811461101c5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e657200000000000000000000000000000000000000000000006064820152608401610515565b610a3981611d29565b6110636040518060400160405280600781526020017f706175736528290000000000000000000000000000000000000000000000000081525061185f565b6101015460ff16156110b75760405162461bcd60e51b815260206004820152601660248201527f50534d20697320616c7265616479207061757365642e000000000000000000006044820152606401610515565b61010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905560405133907fb7aabc84a8f1fe9971d4bfffb4bb336af2c63e547360dd116940dc70da8159e190600090a2565b61114e6040518060400160405280601781526020017f736574436f6d7074726f6c6c657228616464726573732900000000000000000081525061185f565b61115781611991565b6111a58173ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610de1573d6000803e3d6000fd5b60fb805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f14d85f53464bf93dea3f478c71487155c412ff19f1384aa9fc205fa7638a150d90600090a35050565b61125a6040518060400160405280601981526020017f73657456656e757354726561737572792861646472657373290000000000000081525061185f565b61126381611991565b60fc805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f35655f8f1a1f8b7ff254ff70c675c0a26ddcb3da6cb6decd491ecdee167e220b90600090a35050565b6101015460ff161561132e5760405162461bcd60e51b815260206004820152601360248201527f436f6e7472616374206973207061757365642e000000000000000000000000006044820152606401610515565b611336611938565b61133f82611991565b600081116113b55760405162461bcd60e51b815260206004820152602160248201527f416d6f756e74206d7573742062652067726561746572207468616e207a65726f60448201527f2e000000000000000000000000000000000000000000000000000000000000006064820152608401610515565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611442573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114669190612738565b90506114aa73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016333085611e6d565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611537573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155b9190612738565b905060006115698383612790565b905060006115788260006119f4565b90506000611587826000611a25565b905060006115958284612790565b905060ff5483610100546115a99190612720565b11156115f75760405162461bcd60e51b815260206004820152601560248201527f564149206d696e742063617020726561636865642e00000000000000000000006044820152606401610515565b6101008054840190556040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8981166004830152602482018390527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b15801561169057600080fd5b505af11580156116a4573d6000803e3d6000fd5b505050508160001461175e5760fc546040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018490527f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b15801561174557600080fd5b505af1158015611759573d6000803e3d6000fd5b505050505b60408051858152602081018390529081018390527f018e5c6d7bd9e0cafe3512ff02488f4c0ce3524a684e1097aab74666bf4fd00f9060600160405180910390a1505050505050610a24600160c955565b6117b7611bba565b6065805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915561181a60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6097546040517f18c5e8ab00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906318c5e8ab906118b8903390869060040161281d565b602060405180830381865afa1580156118d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f99190612751565b905080610a24573330836040517f4a3fa2930000000000000000000000000000000000000000000000000000000081526004016105159392919061284c565b600260c9540361198a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610515565b600260c955565b73ffffffffffffffffffffffffffffffffffffffff8116610a395760405162461bcd60e51b815260206004820152601660248201527f43616e2774206265207a65726f20616464726573732e000000000000000000006044820152606401610515565b6000670de0b6b3a7640000611a0883611ed1565b611a12908561288e565b611a1c91906128cb565b90505b92915050565b60008080836001811115611a3b57611a3b612906565b03611a49575060fd54611a4e565b5060fe545b80600003611a60576000915050611a1f565b612710611a6d828661288e565b1015611abb5760405162461bcd60e51b815260206004820152601160248201527f416d6f756e7420746f6f20736d616c6c2e0000000000000000000000000000006044820152606401610515565b612710611ac8828661288e565b611ad291906128cb565b915050611a1f565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052611bae9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526120da565b505050565b600160c955565b60335473ffffffffffffffffffffffffffffffffffffffff163314610c6c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610515565b73ffffffffffffffffffffffffffffffffffffffff8116611caa5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610515565b6097805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa09101610b05565b606580547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055610a39816121cc565b600054610100900460ff16611dd75760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b611ddf612243565b610a39816122c8565b600054610100900460ff16611e655760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b610c6c612345565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611ecb9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611b2c565b50505050565b60008060fb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f659190612773565b6040517ffc57d4df00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116600483015291925060009183169063fc57d4df90602401602060405180830381865afa158015611ff7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201b9190612738565b9050600084600181111561203157612031612906565b0361208d577f00000000000000000000000000000000000000000000000000000000000000008110612083577f0000000000000000000000000000000000000000000000000000000000000000612085565b805b949350505050565b7f00000000000000000000000000000000000000000000000000000000000000008111612083577f0000000000000000000000000000000000000000000000000000000000000000612085565b600061213c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166123c29092919063ffffffff16565b805190915015611bae578080602001905181019061215a9190612751565b611bae5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610515565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166122c05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b610c6c6123d1565b600054610100900460ff16610a305760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b600054610100900460ff16611bb35760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b60606120858484600085612457565b600054610100900460ff1661244e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b610c6c33611d29565b6060824710156124cf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610515565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516124f89190612935565b60006040518083038185875af1925050503d8060008114612535576040519150601f19603f3d011682016040523d82523d6000602084013e61253a565b606091505b509150915061254b87838387612556565b979650505050505050565b606083156125d25782516000036125cb5773ffffffffffffffffffffffffffffffffffffffff85163b6125cb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610515565b5081612085565b61208583838151156125e75781518083602001fd5b8060405162461bcd60e51b81526004016105159190612951565b73ffffffffffffffffffffffffffffffffffffffff81168114610a3957600080fd5b6000806040838503121561263657600080fd5b823561264181612601565b946020939093013593505050565b60006020828403121561266157600080fd5b813561266c81612601565b9392505050565b60006020828403121561268557600080fd5b5035919050565b60008060008060008060c087890312156126a557600080fd5b86356126b081612601565b955060208701356126c081612601565b945060408701356126d081612601565b959894975094956060810135955060808101359460a0909101359350915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115612733576127336126f1565b500190565b60006020828403121561274a57600080fd5b5051919050565b60006020828403121561276357600080fd5b8151801515811461266c57600080fd5b60006020828403121561278557600080fd5b815161266c81612601565b6000828210156127a2576127a26126f1565b500390565b60005b838110156127c25781810151838201526020016127aa565b83811115611ecb5750506000910152565b600081518084526127eb8160208601602086016127a7565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600061208560408301846127d3565b600073ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152506060604083015261288560608301846127d3565b95945050505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156128c6576128c66126f1565b500290565b600082612901577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600082516129478184602087016127a7565b9190910192915050565b602081526000611a1c60208301846127d356fea2646970667358221220d5f0902ed9871f12679ff96b47767ac91cf55f1d2c1a746c5fdcc05b4856f88664736f6c634300080d0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806379ba509711610104578063b4a0bdf3116100a2578063e30c397811610071578063e30c397814610421578063f23c0f401461043f578063f2fde38b1461044e578063f34d11191461046157600080fd5b8063b4a0bdf3146103c0578063bb644b03146103de578063d97c057d14610405578063dd0812681461040e57600080fd5b80638da5cb5b116100de5780638da5cb5b1461034a5780638ec2b23914610368578063a52f540c1461038f578063b187bd26146103a257600080fd5b806379ba5097146103275780638456cb591461032f5780638bad38dd1461033757600080fd5b806355725d411161017c5780636ebcd7ac1161014b5780636ebcd7ac146102f0578063715018a614610303578063728cdbca1461030b578063769a48d91461031e57600080fd5b806355725d4114610251578063572ca9e714610264578063586f99331461028b5780635fe3b567146102d057600080fd5b80630e32cb86116101b85780630e32cb8614610218578063126082cf1461022b57806340a1dd461461023457806342e8a9721461023e57600080fd5b8063046f7da2146101df5780630696819f146101e95780630d35d2ed14610205575b600080fd5b6101e7610488565b005b6101f260fe5481565b6040519081526020015b60405180910390f35b6101e7610213366004612623565b610574565b6101e761022636600461264f565b610a28565b6101f261271081565b6101f26101005481565b6101e761024c366004612673565b610a3c565b6101e761025f366004612673565b610b11565b6101f27f000000000000000000000000000000000000000000000000000000000000000081565b60fc546102ab9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fc565b60fb546102ab9073ffffffffffffffffffffffffffffffffffffffff1681565b6101e76102fe366004612673565b610bde565b6101e7610c5a565b6101e761031936600461268c565b610c6e565b6101f260fd5481565b6101e7610f8d565b6101e7611025565b6101e761034536600461264f565b611110565b60335473ffffffffffffffffffffffffffffffffffffffff166102ab565b6102ab7f000000000000000000000000000000000000000000000000000000000000000081565b6101e761039d36600461264f565b61121c565b610101546103b09060ff1681565b60405190151581526020016101fc565b60975473ffffffffffffffffffffffffffffffffffffffff166102ab565b6102ab7f000000000000000000000000000000000000000000000000000000000000000081565b6101f260ff5481565b6101e761041c366004612623565b6112da565b60655473ffffffffffffffffffffffffffffffffffffffff166102ab565b6101f2670de0b6b3a764000081565b6101e761045c36600461264f565b6117af565b6102ab7f000000000000000000000000000000000000000000000000000000000000000081565b6104c66040518060400160405280600881526020017f726573756d65282900000000000000000000000000000000000000000000000081525061185f565b6101015460ff1661051e5760405162461bcd60e51b815260206004820152601260248201527f50534d206973206e6f74207061757365642e000000000000000000000000000060448201526064015b60405180910390fd5b61010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560405133907f108589e68122bb4da8e5020c44387cab025243d0894392e275459641a90181a290600090a2565b6101015460ff16156105c85760405162461bcd60e51b815260206004820152601360248201527f436f6e7472616374206973207061757365642e000000000000000000000000006044820152606401610515565b6105d0611938565b6105d982611991565b6000811161064f5760405162461bcd60e51b815260206004820152602160248201527f416d6f756e74206d7573742062652067726561746572207468616e207a65726f60448201527f2e000000000000000000000000000000000000000000000000000000000000006064820152608401610515565b600061065c8260016119f4565b9050600061066b826001611a25565b90506106778183612720565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a08231906024016020604051808303816000875af1158015610703573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107279190612738565b10156107755760405162461bcd60e51b815260206004820152600f60248201527f4e6f7420656e6f756768205641492e00000000000000000000000000000000006044820152606401610515565b816101005410156107c85760405162461bcd60e51b815260206004820181905260248201527f43616e2774206275726e206d6f726520564149207468616e206d696e7465642e6044820152606401610515565b6101008054839003905580156108ee5760fc546040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9182166024820152604481018390526000917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610879573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089d9190612751565b9050806108ec5760405162461bcd60e51b815260206004820152601860248201527f56414920666565207472616e73666572206661696c65642e00000000000000006044820152606401610515565b505b6040517f9dc29fac000000000000000000000000000000000000000000000000000000008152336004820152602481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690639dc29fac90604401600060405180830381600087803b15801561097c57600080fd5b505af1158015610990573d6000803e3d6000fd5b506109d792505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690508585611ada565b60408051838152602081018390529081018490527f193aebac4ee542588a7c4a31d025211f727993d5dcec18b4d6cd64518677c8d99060600160405180910390a15050610a24600160c955565b5050565b610a30611bba565b610a3981611c21565b50565b610a7a6040518060400160405280601281526020017f7365744665654f75742875696e7432353629000000000000000000000000000081525061185f565b6127108110610acb5760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206665652e00000000000000000000000000000000000000006044820152606401610515565b60fe80549082905560408051828152602081018490527fdc61767cf6b8f2d5ec16cd975db6d3a79fc69dc428b04c93e8db271de5e43b9f91015b60405180910390a15050565b610b4f6040518060400160405280601181526020017f736574466565496e2875696e743235362900000000000000000000000000000081525061185f565b6127108110610ba05760405162461bcd60e51b815260206004820152600c60248201527f496e76616c6964206665652e00000000000000000000000000000000000000006044820152606401610515565b60fd80549082905560408051828152602081018490527fb76804f9786a4411a614b09a8211b2fd86f1f5b7a5e4410f35aa1578aac64e049101610b05565b610c1c6040518060400160405280601681526020017f7365745661694d696e744361702875696e74323536290000000000000000000081525061185f565b60ff80549082905560408051828152602081018490527f7c907ad6b82d09686cae9d7a7aeaca89d479b6f4bea645228455dc222d4ce4849101610b05565b610c62611bba565b610c6c6000611d29565b565b600054610100900460ff1615808015610c8e5750600054600160ff909116105b80610ca85750303b158015610ca8575060005460ff166001145b610d1a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610515565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610d7857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610d8187611991565b610d8a86611991565b610d9385611991565b610e0a8573ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610de1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e059190612773565b611991565b610e1387611d5a565b610e1b611de8565b6127108410610e6c5760405162461bcd60e51b815260206004820152600f60248201527f496e76616c69642066656520696e2e00000000000000000000000000000000006044820152606401610515565b6127108310610ebd5760405162461bcd60e51b815260206004820152601060248201527f496e76616c696420666565206f75742e000000000000000000000000000000006044820152606401610515565b60fd84905560fe83905560ff82905560fc805473ffffffffffffffffffffffffffffffffffffffff8089167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161790925560fb8054928816929091169190911790558015610f8457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b606554339073ffffffffffffffffffffffffffffffffffffffff16811461101c5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e657200000000000000000000000000000000000000000000006064820152608401610515565b610a3981611d29565b6110636040518060400160405280600781526020017f706175736528290000000000000000000000000000000000000000000000000081525061185f565b6101015460ff16156110b75760405162461bcd60e51b815260206004820152601660248201527f50534d20697320616c7265616479207061757365642e000000000000000000006044820152606401610515565b61010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905560405133907fb7aabc84a8f1fe9971d4bfffb4bb336af2c63e547360dd116940dc70da8159e190600090a2565b61114e6040518060400160405280601781526020017f736574436f6d7074726f6c6c657228616464726573732900000000000000000081525061185f565b61115781611991565b6111a58173ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610de1573d6000803e3d6000fd5b60fb805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f14d85f53464bf93dea3f478c71487155c412ff19f1384aa9fc205fa7638a150d90600090a35050565b61125a6040518060400160405280601981526020017f73657456656e757354726561737572792861646472657373290000000000000081525061185f565b61126381611991565b60fc805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f35655f8f1a1f8b7ff254ff70c675c0a26ddcb3da6cb6decd491ecdee167e220b90600090a35050565b6101015460ff161561132e5760405162461bcd60e51b815260206004820152601360248201527f436f6e7472616374206973207061757365642e000000000000000000000000006044820152606401610515565b611336611938565b61133f82611991565b600081116113b55760405162461bcd60e51b815260206004820152602160248201527f416d6f756e74206d7573742062652067726561746572207468616e207a65726f60448201527f2e000000000000000000000000000000000000000000000000000000000000006064820152608401610515565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611442573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114669190612738565b90506114aa73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016333085611e6d565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015611537573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155b9190612738565b905060006115698383612790565b905060006115788260006119f4565b90506000611587826000611a25565b905060006115958284612790565b905060ff5483610100546115a99190612720565b11156115f75760405162461bcd60e51b815260206004820152601560248201527f564149206d696e742063617020726561636865642e00000000000000000000006044820152606401610515565b6101008054840190556040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8981166004830152602482018390527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b15801561169057600080fd5b505af11580156116a4573d6000803e3d6000fd5b505050508160001461175e5760fc546040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018490527f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b15801561174557600080fd5b505af1158015611759573d6000803e3d6000fd5b505050505b60408051858152602081018390529081018390527f018e5c6d7bd9e0cafe3512ff02488f4c0ce3524a684e1097aab74666bf4fd00f9060600160405180910390a1505050505050610a24600160c955565b6117b7611bba565b6065805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915561181a60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6097546040517f18c5e8ab00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906318c5e8ab906118b8903390869060040161281d565b602060405180830381865afa1580156118d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f99190612751565b905080610a24573330836040517f4a3fa2930000000000000000000000000000000000000000000000000000000081526004016105159392919061284c565b600260c9540361198a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610515565b600260c955565b73ffffffffffffffffffffffffffffffffffffffff8116610a395760405162461bcd60e51b815260206004820152601660248201527f43616e2774206265207a65726f20616464726573732e000000000000000000006044820152606401610515565b6000670de0b6b3a7640000611a0883611ed1565b611a12908561288e565b611a1c91906128cb565b90505b92915050565b60008080836001811115611a3b57611a3b612906565b03611a49575060fd54611a4e565b5060fe545b80600003611a60576000915050611a1f565b612710611a6d828661288e565b1015611abb5760405162461bcd60e51b815260206004820152601160248201527f416d6f756e7420746f6f20736d616c6c2e0000000000000000000000000000006044820152606401610515565b612710611ac8828661288e565b611ad291906128cb565b915050611a1f565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052611bae9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526120da565b505050565b600160c955565b60335473ffffffffffffffffffffffffffffffffffffffff163314610c6c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610515565b73ffffffffffffffffffffffffffffffffffffffff8116611caa5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610515565b6097805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa09101610b05565b606580547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055610a39816121cc565b600054610100900460ff16611dd75760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b611ddf612243565b610a39816122c8565b600054610100900460ff16611e655760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b610c6c612345565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611ecb9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611b2c565b50505050565b60008060fb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f659190612773565b6040517ffc57d4df00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116600483015291925060009183169063fc57d4df90602401602060405180830381865afa158015611ff7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201b9190612738565b9050600084600181111561203157612031612906565b0361208d577f00000000000000000000000000000000000000000000000000000000000000008110612083577f0000000000000000000000000000000000000000000000000000000000000000612085565b805b949350505050565b7f00000000000000000000000000000000000000000000000000000000000000008111612083577f0000000000000000000000000000000000000000000000000000000000000000612085565b600061213c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166123c29092919063ffffffff16565b805190915015611bae578080602001905181019061215a9190612751565b611bae5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610515565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166122c05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b610c6c6123d1565b600054610100900460ff16610a305760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b600054610100900460ff16611bb35760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b60606120858484600085612457565b600054610100900460ff1661244e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610515565b610c6c33611d29565b6060824710156124cf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610515565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516124f89190612935565b60006040518083038185875af1925050503d8060008114612535576040519150601f19603f3d011682016040523d82523d6000602084013e61253a565b606091505b509150915061254b87838387612556565b979650505050505050565b606083156125d25782516000036125cb5773ffffffffffffffffffffffffffffffffffffffff85163b6125cb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610515565b5081612085565b61208583838151156125e75781518083602001fd5b8060405162461bcd60e51b81526004016105159190612951565b73ffffffffffffffffffffffffffffffffffffffff81168114610a3957600080fd5b6000806040838503121561263657600080fd5b823561264181612601565b946020939093013593505050565b60006020828403121561266157600080fd5b813561266c81612601565b9392505050565b60006020828403121561268557600080fd5b5035919050565b60008060008060008060c087890312156126a557600080fd5b86356126b081612601565b955060208701356126c081612601565b945060408701356126d081612601565b959894975094956060810135955060808101359460a0909101359350915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115612733576127336126f1565b500190565b60006020828403121561274a57600080fd5b5051919050565b60006020828403121561276357600080fd5b8151801515811461266c57600080fd5b60006020828403121561278557600080fd5b815161266c81612601565b6000828210156127a2576127a26126f1565b500390565b60005b838110156127c25781810151838201526020016127aa565b83811115611ecb5750506000910152565b600081518084526127eb8160208601602086016127a7565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600061208560408301846127d3565b600073ffffffffffffffffffffffffffffffffffffffff80861683528085166020840152506060604083015261288560608301846127d3565b95945050505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156128c6576128c66126f1565b500290565b600082612901577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600082516129478184602087016127a7565b9190910192915050565b602081526000611a1c60208301846127d356fea2646970667358221220d5f0902ed9871f12679ff96b47767ac91cf55f1d2c1a746c5fdcc05b4856f88664736f6c634300080d0033", + "solcInputHash": "ad861ed5d4e7191c78cab74f6cb7beec", + "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"stableTokenAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaiAddress_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountTooSmall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEnoughVAI\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Paused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooManyDecimals\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAIMintCapReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAIMintedUnderflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"VAITransferFail\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAmount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeIn\",\"type\":\"uint256\"}],\"name\":\"FeeInChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeOut\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeOut\",\"type\":\"uint256\"}],\"name\":\"FeeOutChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldOracle\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOracle\",\"type\":\"address\"}],\"name\":\"OracleChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"PSMPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"PSMResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stableIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vaiOut\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"StableForVAISwapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vaiBurnt\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stableOut\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vaiFee\",\"type\":\"uint256\"}],\"name\":\"VAIForStableSwapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldCap\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newCap\",\"type\":\"uint256\"}],\"name\":\"VAIMintCapChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldTreasury\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"VenusTreasuryChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BASIS_POINTS_DIVISOR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MANTISSA_ONE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ONE_DOLLAR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STABLE_TOKEN_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VAI\",\"outputs\":[{\"internalType\":\"contract IVAI\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"venusTreasury_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"oracleAddress_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeIn_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeOut_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"vaiMintCap_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oracle\",\"outputs\":[{\"internalType\":\"contract ResilientOracleInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"stableTknAmount\",\"type\":\"uint256\"}],\"name\":\"previewSwapStableForVAI\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"stableTknAmount\",\"type\":\"uint256\"}],\"name\":\"previewSwapVAIForStable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resume\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeIn_\",\"type\":\"uint256\"}],\"name\":\"setFeeIn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"feeOut_\",\"type\":\"uint256\"}],\"name\":\"setFeeOut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracleAddress_\",\"type\":\"address\"}],\"name\":\"setOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"vaiMintCap_\",\"type\":\"uint256\"}],\"name\":\"setVAIMintCap\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"venusTreasury_\",\"type\":\"address\"}],\"name\":\"setVenusTreasury\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"stableTknAmount\",\"type\":\"uint256\"}],\"name\":\"swapStableForVAI\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"stableTknAmount\",\"type\":\"uint256\"}],\"name\":\"swapVAIForStable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vaiMintCap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vaiMinted\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"venusTreasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus Protocol\",\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\"},\"initialize(address,address,address,uint256,uint256,uint256)\":{\"params\":{\"accessControlManager_\":\"The address of the AccessControlManager contract.\",\"feeIn_\":\"The percentage of fees to be applied to a stablecoin -> VAI swap.\",\"feeOut_\":\"The percentage of fees to be applied to a VAI -> stablecoin swap.\",\"oracleAddress_\":\"The address of the ResilientOracle contract.\",\"vaiMintCap_\":\"The cap for the total amount of VAI that can be minted.\",\"venusTreasury_\":\"The address where fees will be sent.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pause()\":{\"details\":\"Reverts if the contract is already paused.\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"previewSwapStableForVAI(uint256)\":{\"details\":\"This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.\",\"params\":{\"stableTknAmount\":\"The amount of stable tokens provided for the swap.\"},\"returns\":{\"_0\":\"The amount of VAI that would be sent to the receiver.\"}},\"previewSwapVAIForStable(uint256)\":{\"details\":\"This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.\",\"params\":{\"stableTknAmount\":\"The amount of stable tokens to be received after the swap.\"},\"returns\":{\"_0\":\"The amount of VAI that would be taken from the user.\"}},\"renounceOwnership()\":{\"details\":\"Disabling renounceOwnership function.\"},\"resume()\":{\"details\":\"Reverts if the contract is not paused.\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setFeeIn(uint256)\":{\"details\":\"Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).\",\"params\":{\"feeIn_\":\"The new fee percentage for incoming swaps.\"}},\"setFeeOut(uint256)\":{\"details\":\"Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).\",\"params\":{\"feeOut_\":\"The new fee percentage for outgoing swaps.\"}},\"setOracle(address)\":{\"details\":\"Reverts if the new address is zero.\",\"params\":{\"oracleAddress_\":\"The new address of the ResilientOracle contract.\"}},\"setVAIMintCap(uint256)\":{\"details\":\"Set the maximum amount of VAI that can be minted through this contract.\",\"params\":{\"vaiMintCap_\":\"The new maximum amount of VAI that can be minted.\"}},\"setVenusTreasury(address)\":{\"details\":\"Reverts if the new address is zero.\",\"params\":{\"venusTreasury_\":\"The new address of the Venus Treasury contract.\"}},\"swapStableForVAI(address,uint256)\":{\"details\":\"This function adds support to fee-on-transfer tokens. The actualTransferAmt is calculated, by recording token balance state before and after the transfer.\",\"params\":{\"receiver\":\"The address that will receive the VAI tokens.\",\"stableTknAmount\":\"The amount of stable tokens to be swapped.\"},\"returns\":{\"_0\":\"Amount of VAI minted to the sender.\"}},\"swapVAIForStable(address,uint256)\":{\"params\":{\"receiver\":\"The address where the stablecoin will be sent.\",\"stableTknAmount\":\"The amount of stable tokens to receive.\"},\"returns\":{\"_0\":\"The amount of VAI received and burnt from the sender.\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"}},\"stateVariables\":{\"ONE_DOLLAR\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\",\"details\":\"Our oracle is returning amount depending on the number of decimals of the stable token. (36 - asset_decimals) E.g. 8 decimal asset = 1e28.\"},\"STABLE_TOKEN_ADDRESS\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"VAI\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"}},\"title\":\"Peg Stability Contract.\",\"version\":1},\"userdoc\":{\"errors\":{\"AlreadyPaused()\":[{\"notice\":\"thrown when attempted to pause an already paused contract\"}],\"AmountTooSmall()\":[{\"notice\":\"thrown when fee calculation will result in rounding down to 0 due to stable token amount being a too small number\"}],\"InvalidFee()\":[{\"notice\":\"thrown when fee is >= 100%\"}],\"NotEnoughVAI()\":[{\"notice\":\"thrown when the user doesn't have enough VAI balance to provide for the amount of stable tokens he wishes to get\"}],\"NotPaused()\":[{\"notice\":\"thrown when attempted to resume the contract if it is already resumed\"}],\"Paused()\":[{\"notice\":\"thrown when contract is in paused state\"}],\"TooManyDecimals()\":[{\"notice\":\"thrown when stable token has more than 18 decimals\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"VAIMintCapReached()\":[{\"notice\":\"thrown when VAI to be minted will go beyond the mintCap threshold\"}],\"VAIMintedUnderflow()\":[{\"notice\":\"thrown when the amount of VAI to be burnt exceeds the vaiMinted amount\"}],\"VAITransferFail()\":[{\"notice\":\"thrown when the VAI transfer to treasury fails\"}],\"ZeroAddress()\":[{\"notice\":\"thrown when a zero address is passed as a function parameter\"}],\"ZeroAmount()\":[{\"notice\":\"thrown when a zero amount is passed as stable token amount parameter\"}]},\"events\":{\"FeeInChanged(uint256,uint256)\":{\"notice\":\"Event emitted when feeIn state var is modified.\"},\"FeeOutChanged(uint256,uint256)\":{\"notice\":\"Event emitted when feeOut state var is modified.\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"OracleChanged(address,address)\":{\"notice\":\"Event emitted when oracle state var is modified.\"},\"PSMPaused(address)\":{\"notice\":\"Event emitted when contract is paused.\"},\"PSMResumed(address)\":{\"notice\":\"Event emitted when the contract is resumed after pause.\"},\"StableForVAISwapped(uint256,uint256,uint256)\":{\"notice\":\"Event emitted when stable token is swapped for VAI.\"},\"VAIForStableSwapped(uint256,uint256,uint256)\":{\"notice\":\"Event emitted when stable token is swapped for VAI.\"},\"VAIMintCapChanged(uint256,uint256)\":{\"notice\":\"Event emitted when vaiMintCap state var is modified.\"},\"VenusTreasuryChanged(address,address)\":{\"notice\":\"Event emitted when venusTreasury state var is modified.\"}},\"kind\":\"user\",\"methods\":{\"BASIS_POINTS_DIVISOR()\":{\"notice\":\"The divisor used to convert fees to basis points.\"},\"MANTISSA_ONE()\":{\"notice\":\"The mantissa value representing 1 (used for calculations).\"},\"ONE_DOLLAR()\":{\"notice\":\"The value representing one dollar in the stable token.\"},\"STABLE_TOKEN_ADDRESS()\":{\"notice\":\"The address of the stable token contract.\"},\"VAI()\":{\"notice\":\"VAI token contract.\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"feeIn()\":{\"notice\":\"The incoming stableCoin fee. (Fee for swapStableForVAI).\"},\"feeOut()\":{\"notice\":\"The outgoing stableCoin fee. (Fee for swapVAIForStable).\"},\"initialize(address,address,address,uint256,uint256,uint256)\":{\"notice\":\"Initializes the contract via Proxy Contract with the required parameters.\"},\"isPaused()\":{\"notice\":\"A flag indicating whether the contract is currently paused or not.\"},\"oracle()\":{\"notice\":\"The address of ResilientOracle contract wrapped in its interface.\"},\"pause()\":{\"notice\":\"Pause the PSM contract.\"},\"previewSwapStableForVAI(uint256)\":{\"notice\":\"Calculates the amount of VAI that would be sent to the receiver.\"},\"previewSwapVAIForStable(uint256)\":{\"notice\":\"Calculates the amount of VAI that would be burnt from the user.\"},\"resume()\":{\"notice\":\"Resume the PSM contract.\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setFeeIn(uint256)\":{\"notice\":\"Set the fee percentage for incoming swaps.\"},\"setFeeOut(uint256)\":{\"notice\":\"Set the fee percentage for outgoing swaps.\"},\"setOracle(address)\":{\"notice\":\"Set the address of the ResilientOracle contract.\"},\"setVenusTreasury(address)\":{\"notice\":\"Set the address of the Venus Treasury contract.\"},\"swapStableForVAI(address,uint256)\":{\"notice\":\"Swaps stable tokens for VAI with fees.\"},\"swapVAIForStable(address,uint256)\":{\"notice\":\"Swaps VAI for a stable token.\"},\"vaiMintCap()\":{\"notice\":\"The maximum amount of VAI that can be minted through this contract.\"},\"vaiMinted()\":{\"notice\":\"The total amount of VAI minted through this contract.\"},\"venusTreasury()\":{\"notice\":\"The address of the Venus Treasury contract.\"}},\"notice\":\"Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/PegStability/PegStability.sol\":\"PegStability\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xb82ef33f43b6b96109687d91b39c94573fdccaaa423fe28e8ba0977b31c023e0\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x605434219ebbe4653f703640f06969faa5a1d78f0bfef878e5ddbb1ca369ceeb\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xd60f939a3ca0199014d079b4dd66aa757954334947d81eb5c1d35d7a83061ab3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to\\n * 0 before setting it to a non-zero value.\\n */\\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20PermitUpgradeable token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x4dae161227d332808312ee2caf6384929321b83c16cc89b5642985fbec6b814c\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n *\\n * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title Venus Access Control Contract.\\n * @dev The AccessControlledV8 contract is a wrapper around the OpenZeppelin AccessControl contract\\n * It provides a standardized way to control access to methods within the Venus Smart Contract Ecosystem.\\n * The contract allows the owner to set an AccessControlManager contract address.\\n * It can restrict method calls based on the sender's role and the method's signature.\\n */\\n\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x618d942756b93e02340a42f3c80aa99fc56be1a96861f5464dc23a76bf30b3a5\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x41deef84d1839590b243b66506691fde2fb938da01eabde53e82d3b8316fdaf9\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface OracleInterface {\\n function getPrice(address asset) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n\\n function updateAssetPrice(address asset) external;\\n\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address asset) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address asset,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x40031b19684ca0c912e794d08c2c0b0d8be77d3c1bdc937830a0658eff899650\",\"license\":\"BSD-3-Clause\"},\"contracts/PegStability/IVAI.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface IVAI {\\n function balanceOf(address usr) external returns (uint256);\\n\\n function transferFrom(address src, address dst, uint amount) external returns (bool);\\n\\n function mint(address usr, uint wad) external;\\n\\n function burn(address usr, uint wad) external;\\n}\\n\",\"keccak256\":\"0xfd649f7a8201c7568f5224c41ec60b969222f66d266102c6783efae7b11a330d\",\"license\":\"BSD-3-Clause\"},\"contracts/PegStability/PegStability.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { ResilientOracleInterface } from \\\"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\\\";\\nimport { IVAI } from \\\"./IVAI.sol\\\";\\n\\n/**\\n * @title Peg Stability Contract.\\n * @notice Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.\\n * @author Venus Protocol\\n */\\ncontract PegStability is AccessControlledV8, ReentrancyGuardUpgradeable {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n // Helper enum for calculation of the fee.\\n enum FeeDirection {\\n IN,\\n OUT\\n }\\n\\n /// @notice The divisor used to convert fees to basis points.\\n uint256 public constant BASIS_POINTS_DIVISOR = 10000;\\n\\n /// @notice The mantissa value representing 1 (used for calculations).\\n uint256 public constant MANTISSA_ONE = 1e18;\\n\\n /// @notice The value representing one dollar in the stable token.\\n /// @dev Our oracle is returning amount depending on the number of decimals of the stable token. (36 - asset_decimals) E.g. 8 decimal asset = 1e28.\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n uint256 public immutable ONE_DOLLAR;\\n\\n /// @notice VAI token contract.\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n IVAI public immutable VAI;\\n\\n /// @notice The address of the stable token contract.\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable STABLE_TOKEN_ADDRESS;\\n\\n /// @notice The address of ResilientOracle contract wrapped in its interface.\\n ResilientOracleInterface public oracle;\\n\\n /// @notice The address of the Venus Treasury contract.\\n address public venusTreasury;\\n\\n /// @notice The incoming stableCoin fee. (Fee for swapStableForVAI).\\n uint256 public feeIn;\\n\\n /// @notice The outgoing stableCoin fee. (Fee for swapVAIForStable).\\n uint256 public feeOut;\\n\\n /// @notice The maximum amount of VAI that can be minted through this contract.\\n uint256 public vaiMintCap;\\n\\n /// @notice The total amount of VAI minted through this contract.\\n uint256 public vaiMinted;\\n\\n /// @notice A flag indicating whether the contract is currently paused or not.\\n bool public isPaused;\\n\\n /// @notice Event emitted when contract is paused.\\n event PSMPaused(address indexed admin);\\n\\n /// @notice Event emitted when the contract is resumed after pause.\\n event PSMResumed(address indexed admin);\\n\\n /// @notice Event emitted when feeIn state var is modified.\\n event FeeInChanged(uint256 oldFeeIn, uint256 newFeeIn);\\n\\n /// @notice Event emitted when feeOut state var is modified.\\n event FeeOutChanged(uint256 oldFeeOut, uint256 newFeeOut);\\n\\n /// @notice Event emitted when vaiMintCap state var is modified.\\n event VAIMintCapChanged(uint256 oldCap, uint256 newCap);\\n\\n /// @notice Event emitted when venusTreasury state var is modified.\\n event VenusTreasuryChanged(address indexed oldTreasury, address indexed newTreasury);\\n\\n /// @notice Event emitted when oracle state var is modified.\\n event OracleChanged(address indexed oldOracle, address indexed newOracle);\\n\\n /// @notice Event emitted when stable token is swapped for VAI.\\n event StableForVAISwapped(uint256 stableIn, uint256 vaiOut, uint256 fee);\\n\\n /// @notice Event emitted when stable token is swapped for VAI.\\n event VAIForStableSwapped(uint256 vaiBurnt, uint256 stableOut, uint256 vaiFee);\\n\\n /// @notice thrown when contract is in paused state\\n error Paused();\\n\\n /// @notice thrown when attempted to pause an already paused contract\\n error AlreadyPaused();\\n\\n /// @notice thrown when attempted to resume the contract if it is already resumed\\n error NotPaused();\\n\\n /// @notice thrown when stable token has more than 18 decimals\\n error TooManyDecimals();\\n\\n /// @notice thrown when fee is >= 100%\\n error InvalidFee();\\n\\n /// @notice thrown when a zero address is passed as a function parameter\\n error ZeroAddress();\\n\\n /// @notice thrown when a zero amount is passed as stable token amount parameter\\n error ZeroAmount();\\n\\n /// @notice thrown when the user doesn't have enough VAI balance to provide for the amount of stable tokens he wishes to get\\n error NotEnoughVAI();\\n\\n /// @notice thrown when the amount of VAI to be burnt exceeds the vaiMinted amount\\n error VAIMintedUnderflow();\\n\\n /// @notice thrown when the VAI transfer to treasury fails\\n error VAITransferFail();\\n\\n /// @notice thrown when VAI to be minted will go beyond the mintCap threshold\\n error VAIMintCapReached();\\n /// @notice thrown when fee calculation will result in rounding down to 0 due to stable token amount being a too small number\\n error AmountTooSmall();\\n\\n /**\\n * @dev Prevents functions to execute when contract is paused.\\n */\\n modifier isActive() {\\n if (isPaused) revert Paused();\\n _;\\n }\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address stableTokenAddress_, address vaiAddress_) {\\n _ensureNonzeroAddress(stableTokenAddress_);\\n _ensureNonzeroAddress(vaiAddress_);\\n\\n uint256 decimals_ = IERC20MetadataUpgradeable(stableTokenAddress_).decimals();\\n\\n if (decimals_ > 18) {\\n revert TooManyDecimals();\\n }\\n\\n ONE_DOLLAR = 10 ** (36 - decimals_); // 1$ scaled to the decimals returned by our Oracle\\n STABLE_TOKEN_ADDRESS = stableTokenAddress_;\\n VAI = IVAI(vaiAddress_);\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Initializes the contract via Proxy Contract with the required parameters.\\n * @param accessControlManager_ The address of the AccessControlManager contract.\\n * @param venusTreasury_ The address where fees will be sent.\\n * @param oracleAddress_ The address of the ResilientOracle contract.\\n * @param feeIn_ The percentage of fees to be applied to a stablecoin -> VAI swap.\\n * @param feeOut_ The percentage of fees to be applied to a VAI -> stablecoin swap.\\n * @param vaiMintCap_ The cap for the total amount of VAI that can be minted.\\n */\\n function initialize(\\n address accessControlManager_,\\n address venusTreasury_,\\n address oracleAddress_,\\n uint256 feeIn_,\\n uint256 feeOut_,\\n uint256 vaiMintCap_\\n ) external initializer {\\n _ensureNonzeroAddress(accessControlManager_);\\n _ensureNonzeroAddress(venusTreasury_);\\n _ensureNonzeroAddress(oracleAddress_);\\n __AccessControlled_init(accessControlManager_);\\n __ReentrancyGuard_init();\\n\\n if (feeIn_ >= BASIS_POINTS_DIVISOR || feeOut_ >= BASIS_POINTS_DIVISOR) {\\n revert InvalidFee();\\n }\\n\\n feeIn = feeIn_;\\n feeOut = feeOut_;\\n vaiMintCap = vaiMintCap_;\\n venusTreasury = venusTreasury_;\\n oracle = ResilientOracleInterface(oracleAddress_);\\n }\\n\\n /*** Swap Functions ***/\\n\\n /**\\n * @notice Swaps VAI for a stable token.\\n * @param receiver The address where the stablecoin will be sent.\\n * @param stableTknAmount The amount of stable tokens to receive.\\n * @return The amount of VAI received and burnt from the sender.\\n */\\n // @custom:event Emits VAIForStableSwapped event.\\n function swapVAIForStable(\\n address receiver,\\n uint256 stableTknAmount\\n ) external isActive nonReentrant returns (uint256) {\\n _ensureNonzeroAddress(receiver);\\n _ensureNonzeroAmount(stableTknAmount);\\n\\n // update oracle price and calculate USD value of the stable token amount scaled in 18 decimals\\n oracle.updateAssetPrice(STABLE_TOKEN_ADDRESS);\\n uint256 stableTknAmountUSD = _previewTokenUSDAmount(stableTknAmount, FeeDirection.OUT);\\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.OUT);\\n\\n if (VAI.balanceOf(msg.sender) < stableTknAmountUSD + fee) {\\n revert NotEnoughVAI();\\n }\\n if (vaiMinted < stableTknAmountUSD) {\\n revert VAIMintedUnderflow();\\n }\\n\\n unchecked {\\n vaiMinted -= stableTknAmountUSD;\\n }\\n\\n if (fee != 0) {\\n bool success = VAI.transferFrom(msg.sender, venusTreasury, fee);\\n if (!success) {\\n revert VAITransferFail();\\n }\\n }\\n\\n VAI.burn(msg.sender, stableTknAmountUSD);\\n IERC20Upgradeable(STABLE_TOKEN_ADDRESS).safeTransfer(receiver, stableTknAmount);\\n emit VAIForStableSwapped(stableTknAmountUSD, stableTknAmount, fee);\\n return stableTknAmountUSD;\\n }\\n\\n /**\\n * @notice Swaps stable tokens for VAI with fees.\\n * @dev This function adds support to fee-on-transfer tokens. The actualTransferAmt is calculated, by recording token balance state before and after the transfer.\\n * @param receiver The address that will receive the VAI tokens.\\n * @param stableTknAmount The amount of stable tokens to be swapped.\\n * @return Amount of VAI minted to the sender.\\n */\\n // @custom:event Emits StableForVAISwapped event.\\n function swapStableForVAI(\\n address receiver,\\n uint256 stableTknAmount\\n ) external isActive nonReentrant returns (uint256) {\\n _ensureNonzeroAddress(receiver);\\n _ensureNonzeroAmount(stableTknAmount);\\n // transfer IN, supporting fee-on-transfer tokens\\n uint256 balanceBefore = IERC20Upgradeable(STABLE_TOKEN_ADDRESS).balanceOf(address(this));\\n IERC20Upgradeable(STABLE_TOKEN_ADDRESS).safeTransferFrom(msg.sender, address(this), stableTknAmount);\\n uint256 balanceAfter = IERC20Upgradeable(STABLE_TOKEN_ADDRESS).balanceOf(address(this));\\n\\n //calculate actual transfered amount (in case of fee-on-transfer tokens)\\n uint256 actualTransferAmt = balanceAfter - balanceBefore;\\n\\n // update oracle price and calculate USD value of the stable token amount scaled in 18 decimals\\n oracle.updateAssetPrice(STABLE_TOKEN_ADDRESS);\\n uint256 actualTransferAmtInUSD = _previewTokenUSDAmount(actualTransferAmt, FeeDirection.IN);\\n\\n //calculate feeIn\\n uint256 fee = _calculateFee(actualTransferAmtInUSD, FeeDirection.IN);\\n uint256 vaiToMint = actualTransferAmtInUSD - fee;\\n\\n if (vaiMinted + actualTransferAmtInUSD > vaiMintCap) {\\n revert VAIMintCapReached();\\n }\\n unchecked {\\n vaiMinted += actualTransferAmtInUSD;\\n }\\n\\n // mint VAI to receiver\\n VAI.mint(receiver, vaiToMint);\\n\\n // mint VAI fee to venus treasury\\n if (fee != 0) {\\n VAI.mint(venusTreasury, fee);\\n }\\n\\n emit StableForVAISwapped(actualTransferAmt, vaiToMint, fee);\\n return vaiToMint;\\n }\\n\\n /*** Admin Functions ***/\\n\\n /**\\n * @notice Pause the PSM contract.\\n * @dev Reverts if the contract is already paused.\\n */\\n // @custom:event Emits PSMPaused event.\\n function pause() external {\\n _checkAccessAllowed(\\\"pause()\\\");\\n if (isPaused) {\\n revert AlreadyPaused();\\n }\\n isPaused = true;\\n emit PSMPaused(msg.sender);\\n }\\n\\n /**\\n * @notice Resume the PSM contract.\\n * @dev Reverts if the contract is not paused.\\n */\\n // @custom:event Emits PSMResumed event.\\n function resume() external {\\n _checkAccessAllowed(\\\"resume()\\\");\\n if (!isPaused) {\\n revert NotPaused();\\n }\\n isPaused = false;\\n emit PSMResumed(msg.sender);\\n }\\n\\n /**\\n * @notice Set the fee percentage for incoming swaps.\\n * @dev Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).\\n * @param feeIn_ The new fee percentage for incoming swaps.\\n */\\n // @custom:event Emits FeeInChanged event.\\n function setFeeIn(uint256 feeIn_) external {\\n _checkAccessAllowed(\\\"setFeeIn(uint256)\\\");\\n // feeIn = 10000 = 100%\\n if (feeIn_ >= BASIS_POINTS_DIVISOR) {\\n revert InvalidFee();\\n }\\n uint256 oldFeeIn = feeIn;\\n feeIn = feeIn_;\\n emit FeeInChanged(oldFeeIn, feeIn_);\\n }\\n\\n /**\\n * @notice Set the fee percentage for outgoing swaps.\\n * @dev Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).\\n * @param feeOut_ The new fee percentage for outgoing swaps.\\n */\\n // @custom:event Emits FeeOutChanged event.\\n function setFeeOut(uint256 feeOut_) external {\\n _checkAccessAllowed(\\\"setFeeOut(uint256)\\\");\\n // feeOut = 10000 = 100%\\n if (feeOut_ >= BASIS_POINTS_DIVISOR) {\\n revert InvalidFee();\\n }\\n uint256 oldFeeOut = feeOut;\\n feeOut = feeOut_;\\n emit FeeOutChanged(oldFeeOut, feeOut_);\\n }\\n\\n /**\\n * @dev Set the maximum amount of VAI that can be minted through this contract.\\n * @param vaiMintCap_ The new maximum amount of VAI that can be minted.\\n */\\n // @custom:event Emits VAIMintCapChanged event.\\n function setVAIMintCap(uint256 vaiMintCap_) external {\\n _checkAccessAllowed(\\\"setVAIMintCap(uint256)\\\");\\n uint256 oldVAIMintCap = vaiMintCap;\\n vaiMintCap = vaiMintCap_;\\n emit VAIMintCapChanged(oldVAIMintCap, vaiMintCap_);\\n }\\n\\n /**\\n * @notice Set the address of the Venus Treasury contract.\\n * @dev Reverts if the new address is zero.\\n * @param venusTreasury_ The new address of the Venus Treasury contract.\\n */\\n // @custom:event Emits VenusTreasuryChanged event.\\n function setVenusTreasury(address venusTreasury_) external {\\n _checkAccessAllowed(\\\"setVenusTreasury(address)\\\");\\n _ensureNonzeroAddress(venusTreasury_);\\n address oldTreasuryAddress = venusTreasury;\\n venusTreasury = venusTreasury_;\\n emit VenusTreasuryChanged(oldTreasuryAddress, venusTreasury_);\\n }\\n\\n /**\\n * @notice Set the address of the ResilientOracle contract.\\n * @dev Reverts if the new address is zero.\\n * @param oracleAddress_ The new address of the ResilientOracle contract.\\n */\\n // @custom:event Emits OracleChanged event.\\n function setOracle(address oracleAddress_) external {\\n _checkAccessAllowed(\\\"setOracle(address)\\\");\\n _ensureNonzeroAddress(oracleAddress_);\\n address oldOracleAddress = address(oracle);\\n oracle = ResilientOracleInterface(oracleAddress_);\\n emit OracleChanged(oldOracleAddress, oracleAddress_);\\n }\\n\\n /**\\n * @dev Disabling renounceOwnership function.\\n */\\n function renounceOwnership() public override {}\\n\\n /*** Helper Functions ***/\\n\\n /**\\n * @notice Calculates the amount of VAI that would be burnt from the user.\\n * @dev This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.\\n * @param stableTknAmount The amount of stable tokens to be received after the swap.\\n * @return The amount of VAI that would be taken from the user.\\n */\\n function previewSwapVAIForStable(uint256 stableTknAmount) external view returns (uint256) {\\n _ensureNonzeroAmount(stableTknAmount);\\n uint256 stableTknAmountUSD = _previewTokenUSDAmount(stableTknAmount, FeeDirection.OUT);\\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.OUT);\\n\\n if (vaiMinted < stableTknAmountUSD) {\\n revert VAIMintedUnderflow();\\n }\\n\\n return stableTknAmountUSD + fee;\\n }\\n\\n /**\\n * @notice Calculates the amount of VAI that would be sent to the receiver.\\n * @dev This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.\\n * @param stableTknAmount The amount of stable tokens provided for the swap.\\n * @return The amount of VAI that would be sent to the receiver.\\n */\\n function previewSwapStableForVAI(uint256 stableTknAmount) external view returns (uint256) {\\n _ensureNonzeroAmount(stableTknAmount);\\n uint256 stableTknAmountUSD = _previewTokenUSDAmount(stableTknAmount, FeeDirection.IN);\\n\\n //calculate feeIn\\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.IN);\\n uint256 vaiToMint = stableTknAmountUSD - fee;\\n\\n if (vaiMinted + stableTknAmountUSD > vaiMintCap) {\\n revert VAIMintCapReached();\\n }\\n\\n return vaiToMint;\\n }\\n\\n /**\\n * @dev Calculates the USD value of the given amount of stable tokens depending on the swap direction.\\n * @param amount The amount of stable tokens.\\n * @param direction The direction of the swap.\\n * @return The USD value of the given amount of stable tokens scaled by 1e18 taking into account the direction of the swap\\n */\\n function _previewTokenUSDAmount(uint256 amount, FeeDirection direction) internal view returns (uint256) {\\n return (amount * _getPriceInUSD(direction)) / MANTISSA_ONE;\\n }\\n\\n /**\\n * @notice Get the price of stable token in USD.\\n * @dev This function returns either min(1$,oraclePrice) or max(1$,oraclePrice) with a decimal scale (36 - asset_decimals). E.g. for 8 decimal token 1$ will be 1e28.\\n * @param direction The direction of the swap: FeeDirection.IN or FeeDirection.OUT.\\n * @return The price in USD, adjusted based on the selected direction.\\n */\\n function _getPriceInUSD(FeeDirection direction) internal view returns (uint256) {\\n // get price with a scale = (36 - asset_decimals)\\n uint256 price = oracle.getPrice(STABLE_TOKEN_ADDRESS);\\n\\n if (direction == FeeDirection.IN) {\\n // MIN(1, price)\\n return price < ONE_DOLLAR ? price : ONE_DOLLAR;\\n } else {\\n // MAX(1, price)\\n return price > ONE_DOLLAR ? price : ONE_DOLLAR;\\n }\\n }\\n\\n /**\\n * @notice Calculate the fee amount based on the input amount and fee percentage.\\n * @dev Reverts if the fee percentage calculation results in rounding down to 0.\\n * @param amount The input amount to calculate the fee from.\\n * @param direction The direction of the fee: FeeDirection.IN or FeeDirection.OUT.\\n * @return The fee amount.\\n */\\n function _calculateFee(uint256 amount, FeeDirection direction) internal view returns (uint256) {\\n uint256 feePercent;\\n if (direction == FeeDirection.IN) {\\n feePercent = feeIn;\\n } else {\\n feePercent = feeOut;\\n }\\n if (feePercent == 0) {\\n return 0;\\n } else {\\n // checking if the percent calculation will result in rounding down to 0\\n if (amount * feePercent < BASIS_POINTS_DIVISOR) {\\n revert AmountTooSmall();\\n }\\n return (amount * feePercent) / BASIS_POINTS_DIVISOR;\\n }\\n }\\n\\n /**\\n * @notice Checks that the address is not the zero address.\\n * @param someone The address to check.\\n */\\n function _ensureNonzeroAddress(address someone) private pure {\\n if (someone == address(0)) revert ZeroAddress();\\n }\\n\\n /**\\n * @notice Checks that the amount passed as stable tokens is bigger than zero\\n * @param amount The amount to validate\\n */\\n function _ensureNonzeroAmount(uint256 amount) private pure {\\n if (amount == 0) revert ZeroAmount();\\n }\\n}\\n\",\"keccak256\":\"0x38ec1c0980e7ceed082321e1018941322a8a83f3f1845ddd89d96a93ea3cf42c\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", + "bytecode": "0x60e06040523480156200001157600080fd5b506040516200235638038062002356833981016040819052620000349162000225565b6200003f826200011c565b6200004a816200011c565b6000826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200008b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000b191906200025d565b60ff1690506012811115620000d9576040516330e571f960e11b815260040160405180910390fd5b620000e68160246200029f565b620000f390600a620003b8565b6080526001600160a01b0380841660c052821660a0526200011362000147565b505050620003c6565b6001600160a01b038116620001445760405163d92e233d60e01b815260040160405180910390fd5b50565b600054610100900460ff1615620001b45760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161462000206576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b80516001600160a01b03811681146200022057600080fd5b919050565b600080604083850312156200023957600080fd5b620002448362000208565b9150620002546020840162000208565b90509250929050565b6000602082840312156200027057600080fd5b815160ff811681146200028257600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600082821015620002b457620002b462000289565b500390565b600181815b80851115620002fa578160001904821115620002de57620002de62000289565b80851615620002ec57918102915b93841c9390800290620002be565b509250929050565b6000826200031357506001620003b2565b816200032257506000620003b2565b81600181146200033b5760028114620003465762000366565b6001915050620003b2565b60ff8411156200035a576200035a62000289565b50506001821b620003b2565b5060208310610133831016604e8410600b84101617156200038b575081810a620003b2565b620003978383620002b9565b8060001904821115620003ae57620003ae62000289565b0290505b92915050565b600062000282838362000302565b60805160a05160c051611ef0620004666000396000818161033c0152818161051d015281816107d801528181610e9c01528181610f1e01528181610f5e01528181610ff90152611756015260008181610363015281816105bf015281816106bc01528181610767015281816110ec0152611179015260008181610287015281816117eb0152818161181201528181611838015261185f0152611ef06000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c80637adbf9731161010f578063b187bd26116100a2578063e2608fba11610071578063e2608fba146103f6578063e30c397814610409578063f23c0f401461041a578063f2fde38b1461042957600080fd5b8063b187bd26146103ab578063b4a0bdf3146103c9578063d97c057d146103da578063dd081268146103e357600080fd5b80638ec2b239116100de5780638ec2b2391461033757806398f44cd11461035e578063a52f540c14610385578063a589e98a1461039857600080fd5b80637adbf973146102f85780637dc0d1d01461030b5780638456cb591461031e5780638da5cb5b1461032657600080fd5b806342e8a97211610187578063715018a611610156578063715018a6146101f2578063728cdbca146102d4578063769a48d9146102e757806379ba5097146102f057600080fd5b806342e8a9721461025c57806355725d411461026f578063572ca9e714610282578063586f9933146102a957600080fd5b80630e32cb86116101c35780630e32cb8614610223578063126082cf14610236578063187e28bd1461023f57806340a1dd461461025257600080fd5b8063046f7da2146101ea5780630696819f146101f45780630d35d2ed14610210575b600080fd5b6101f261043c565b005b6101fd60fe5481565b6040519081526020015b60405180910390f35b6101fd61021e366004611bfb565b6104c1565b6101f2610231366004611c25565b610855565b6101fd61271081565b6101fd61024d366004611c40565b610869565b6101fd6101005481565b6101f261026a366004611c40565b6108c8565b6101f261027d366004611c40565b610963565b6101fd7f000000000000000000000000000000000000000000000000000000000000000081565b60fc546102bc906001600160a01b031681565b6040516001600160a01b039091168152602001610207565b6101f26102e2366004611c59565b6109f7565b6101fd60fd5481565b6101f2610ba7565b6101f2610306366004611c25565b610c1e565b60fb546102bc906001600160a01b031681565b6101f2610cac565b6033546001600160a01b03166102bc565b6102bc7f000000000000000000000000000000000000000000000000000000000000000081565b6102bc7f000000000000000000000000000000000000000000000000000000000000000081565b6101f2610393366004611c25565b610d34565b6101f26103a6366004611c40565b610dcd565b610101546103b99060ff1681565b6040519015158152602001610207565b6097546001600160a01b03166102bc565b6101fd60ff5481565b6101fd6103f1366004611bfb565b610e42565b6101fd610404366004611c40565b61122a565b6065546001600160a01b03166102bc565b6101fd670de0b6b3a764000081565b6101f2610437366004611c25565b611292565b61046560405180604001604052806008815260200167726573756d65282960c01b815250611303565b6101015460ff1661048957604051636cd6020160e01b815260040160405180910390fd5b610101805460ff1916905560405133907f108589e68122bb4da8e5020c44387cab025243d0894392e275459641a90181a290600090a2565b6101015460009060ff16156104e9576040516313d0ff5960e31b815260040160405180910390fd5b6104f16113a1565b6104fa836113fa565b61050382611421565b60fb5460405163b62cad6960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301529091169063b62cad6990602401600060405180830381600087803b15801561056a57600080fd5b505af115801561057e573d6000803e3d6000fd5b50505050600061058f836001611442565b9050600061059e826001611471565b90506105aa8183611cce565b6040516370a0823160e01b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a08231906024016020604051808303816000875af1158015610610573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106349190611ce6565b1015610656576040516001629d12e360e01b0319815260040160405180910390fd5b8161010054101561067a5760405163a5047e9560e01b815260040160405180910390fd5b61010080548390039055801561074b5760fc546040516323b872dd60e01b81523360048201526001600160a01b039182166024820152604481018390526000917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610705573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107299190611cff565b9050806107495760405163aba1276560e01b815260040160405180910390fd5b505b604051632770a7eb60e21b8152336004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639dc29fac90604401600060405180830381600087803b1580156107b357600080fd5b505af11580156107c7573d6000803e3d6000fd5b506108019250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016905086866114f7565b60408051838152602081018690529081018290527f031e3397b091e3298ff850e89e965fe3543a0c64eb93659927433b06545f3f629060600160405180910390a150905061084f600160c955565b92915050565b61085d611566565b610866816115c0565b50565b600061087482611421565b6000610881836001611442565b90506000610890826001611471565b9050816101005410156108b65760405163a5047e9560e01b815260040160405180910390fd5b6108c08183611cce565b949350505050565b6108fb604051806040016040528060128152602001717365744665654f75742875696e743235362960701b815250611303565b612710811061091d576040516358d620b360e01b815260040160405180910390fd5b60fe80549082905560408051828152602081018490527fdc61767cf6b8f2d5ec16cd975db6d3a79fc69dc428b04c93e8db271de5e43b9f91015b60405180910390a15050565b61099560405180604001604052806011815260200170736574466565496e2875696e743235362960781b815250611303565b61271081106109b7576040516358d620b360e01b815260040160405180910390fd5b60fd80549082905560408051828152602081018490527fb76804f9786a4411a614b09a8211b2fd86f1f5b7a5e4410f35aa1578aac64e049101610957565b565b600054610100900460ff1615808015610a175750600054600160ff909116105b80610a315750303b158015610a31575060005460ff166001145b610a995760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610abc576000805461ff0019166101001790555b610ac5876113fa565b610ace866113fa565b610ad7856113fa565b610ae08761167e565b610ae86116b6565b61271084101580610afb57506127108310155b15610b19576040516358d620b360e01b815260040160405180910390fd5b60fd84905560fe83905560ff82905560fc80546001600160a01b038089166001600160a01b03199283161790925560fb8054928816929091169190911790558015610b9e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b60655433906001600160a01b03168114610c155760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401610a90565b610866816116e5565b610c51604051806040016040528060128152602001717365744f7261636c6528616464726573732960701b815250611303565b610c5a816113fa565b60fb80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f05cd89403c6bdeac21c2ff33de395121a31fa1bc2bf3adf4825f1f86e79969dd90600090a35050565b610cd4604051806040016040528060078152602001667061757365282960c81b815250611303565b6101015460ff1615610cf957604051631785c68160e01b815260040160405180910390fd5b610101805460ff1916600117905560405133907fb7aabc84a8f1fe9971d4bfffb4bb336af2c63e547360dd116940dc70da8159e190600090a2565b610d726040518060400160405280601981526020017f73657456656e7573547265617375727928616464726573732900000000000000815250611303565b610d7b816113fa565b60fc80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f35655f8f1a1f8b7ff254ff70c675c0a26ddcb3da6cb6decd491ecdee167e220b90600090a35050565b610e04604051806040016040528060168152602001757365745641494d696e744361702875696e743235362960501b815250611303565b60ff80549082905560408051828152602081018490527f0f43249751c1ca8dedff5711840ef91871f6fc2ce9b3891c1f33f4163ba1a9a39101610957565b6101015460009060ff1615610e6a576040516313d0ff5960e31b815260040160405180910390fd5b610e726113a1565b610e7b836113fa565b610e8482611421565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610eeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0f9190611ce6565b9050610f466001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330866116fe565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610fad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd19190611ce6565b90506000610fdf8383611d21565b60fb5460405163b62cad6960e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015292935091169063b62cad6990602401600060405180830381600087803b15801561104857600080fd5b505af115801561105c573d6000803e3d6000fd5b50505050600061106d826000611442565b9050600061107c826000611471565b9050600061108a8284611d21565b905060ff54836101005461109e9190611cce565b11156110bd576040516313d3ad1560e31b815260040160405180910390fd5b6101008054840190556040516340c10f1960e01b81526001600160a01b038a81166004830152602482018390527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b15801561113057600080fd5b505af1158015611144573d6000803e3d6000fd5b50505050816000146111d85760fc546040516340c10f1960e01b81526001600160a01b039182166004820152602481018490527f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b1580156111bf57600080fd5b505af11580156111d3573d6000803e3d6000fd5b505050505b60408051858152602081018390529081018390527f018e5c6d7bd9e0cafe3512ff02488f4c0ce3524a684e1097aab74666bf4fd00f9060600160405180910390a19550505050505061084f600160c955565b600061123582611421565b6000611242836000611442565b90506000611251826000611471565b9050600061125f8284611d21565b905060ff5483610100546112739190611cce565b11156108c0576040516313d3ad1560e31b815260040160405180910390fd5b61129a611566565b606580546001600160a01b0383166001600160a01b031990911681179091556112cb6033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6097546040516318c5e8ab60e01b81526000916001600160a01b0316906318c5e8ab906113369033908690600401611d90565b602060405180830381865afa158015611353573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113779190611cff565b90508061139d57333083604051634a3fa29360e01b8152600401610a9093929190611db4565b5050565b600260c954036113f35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a90565b600260c955565b6001600160a01b0381166108665760405163d92e233d60e01b815260040160405180910390fd5b8060000361086657604051631f2a200560e01b815260040160405180910390fd5b6000670de0b6b3a76400006114568361173c565b6114609085611de9565b61146a9190611e08565b9392505050565b6000808083600181111561148757611487611e2a565b03611495575060fd5461149a565b5060fe545b806000036114ac57600091505061084f565b6127106114b98286611de9565b10156114d85760405163617ab12d60e11b815260040160405180910390fd5b6127106114e58286611de9565b6114ef9190611e08565b91505061084f565b6040516001600160a01b03831660248201526044810182905261155a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611883565b505050565b600160c955565b6033546001600160a01b031633146109f55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a90565b6001600160a01b0381166116245760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e61676572206164604482015264647265737360d81b6064820152608401610a90565b609780546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa09101610957565b600054610100900460ff166116a55760405162461bcd60e51b8152600401610a9090611e40565b6116ad611958565b61086681611987565b600054610100900460ff166116dd5760405162461bcd60e51b8152600401610a9090611e40565b6109f56119ae565b606580546001600160a01b0319169055610866816119d5565b6040516001600160a01b03808516602483015283166044820152606481018290526117369085906323b872dd60e01b90608401611523565b50505050565b60fb546040516341976e0960e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260009283929116906341976e0990602401602060405180830381865afa1580156117aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ce9190611ce6565b905060008360018111156117e4576117e4611e2a565b03611836577f0000000000000000000000000000000000000000000000000000000000000000811061084f577f000000000000000000000000000000000000000000000000000000000000000061146a565b7f0000000000000000000000000000000000000000000000000000000000000000811161084f577f000000000000000000000000000000000000000000000000000000000000000061146a565b60006118d8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a279092919063ffffffff16565b90508051600014806118f95750808060200190518101906118f99190611cff565b61155a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a90565b600054610100900460ff1661197f5760405162461bcd60e51b8152600401610a9090611e40565b6109f5611a36565b600054610100900460ff1661085d5760405162461bcd60e51b8152600401610a9090611e40565b600054610100900460ff1661155f5760405162461bcd60e51b8152600401610a9090611e40565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606108c08484600085611a66565b600054610100900460ff16611a5d5760405162461bcd60e51b8152600401610a9090611e40565b6109f5336116e5565b606082471015611ac75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610a90565b600080866001600160a01b03168587604051611ae39190611e8b565b60006040518083038185875af1925050503d8060008114611b20576040519150601f19603f3d011682016040523d82523d6000602084013e611b25565b606091505b5091509150611b3687838387611b41565b979650505050505050565b60608315611bb0578251600003611ba9576001600160a01b0385163b611ba95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a90565b50816108c0565b6108c08383815115611bc55781518083602001fd5b8060405162461bcd60e51b8152600401610a909190611ea7565b80356001600160a01b0381168114611bf657600080fd5b919050565b60008060408385031215611c0e57600080fd5b611c1783611bdf565b946020939093013593505050565b600060208284031215611c3757600080fd5b61146a82611bdf565b600060208284031215611c5257600080fd5b5035919050565b60008060008060008060c08789031215611c7257600080fd5b611c7b87611bdf565b9550611c8960208801611bdf565b9450611c9760408801611bdf565b9350606087013592506080870135915060a087013590509295509295509295565b634e487b7160e01b600052601160045260246000fd5b60008219821115611ce157611ce1611cb8565b500190565b600060208284031215611cf857600080fd5b5051919050565b600060208284031215611d1157600080fd5b8151801515811461146a57600080fd5b600082821015611d3357611d33611cb8565b500390565b60005b83811015611d53578181015183820152602001611d3b565b838111156117365750506000910152565b60008151808452611d7c816020860160208601611d38565b601f01601f19169290920160200192915050565b6001600160a01b03831681526040602082018190526000906108c090830184611d64565b6001600160a01b03848116825283166020820152606060408201819052600090611de090830184611d64565b95945050505050565b6000816000190483118215151615611e0357611e03611cb8565b500290565b600082611e2557634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052602160045260246000fd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008251611e9d818460208701611d38565b9190910192915050565b60208152600061146a6020830184611d6456fea2646970667358221220776bae9a01444556f49e135e272e6d666dc0b437dde23f690af77c95ce44ac9b64736f6c634300080d0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101e55760003560e01c80637adbf9731161010f578063b187bd26116100a2578063e2608fba11610071578063e2608fba146103f6578063e30c397814610409578063f23c0f401461041a578063f2fde38b1461042957600080fd5b8063b187bd26146103ab578063b4a0bdf3146103c9578063d97c057d146103da578063dd081268146103e357600080fd5b80638ec2b239116100de5780638ec2b2391461033757806398f44cd11461035e578063a52f540c14610385578063a589e98a1461039857600080fd5b80637adbf973146102f85780637dc0d1d01461030b5780638456cb591461031e5780638da5cb5b1461032657600080fd5b806342e8a97211610187578063715018a611610156578063715018a6146101f2578063728cdbca146102d4578063769a48d9146102e757806379ba5097146102f057600080fd5b806342e8a9721461025c57806355725d411461026f578063572ca9e714610282578063586f9933146102a957600080fd5b80630e32cb86116101c35780630e32cb8614610223578063126082cf14610236578063187e28bd1461023f57806340a1dd461461025257600080fd5b8063046f7da2146101ea5780630696819f146101f45780630d35d2ed14610210575b600080fd5b6101f261043c565b005b6101fd60fe5481565b6040519081526020015b60405180910390f35b6101fd61021e366004611bfb565b6104c1565b6101f2610231366004611c25565b610855565b6101fd61271081565b6101fd61024d366004611c40565b610869565b6101fd6101005481565b6101f261026a366004611c40565b6108c8565b6101f261027d366004611c40565b610963565b6101fd7f000000000000000000000000000000000000000000000000000000000000000081565b60fc546102bc906001600160a01b031681565b6040516001600160a01b039091168152602001610207565b6101f26102e2366004611c59565b6109f7565b6101fd60fd5481565b6101f2610ba7565b6101f2610306366004611c25565b610c1e565b60fb546102bc906001600160a01b031681565b6101f2610cac565b6033546001600160a01b03166102bc565b6102bc7f000000000000000000000000000000000000000000000000000000000000000081565b6102bc7f000000000000000000000000000000000000000000000000000000000000000081565b6101f2610393366004611c25565b610d34565b6101f26103a6366004611c40565b610dcd565b610101546103b99060ff1681565b6040519015158152602001610207565b6097546001600160a01b03166102bc565b6101fd60ff5481565b6101fd6103f1366004611bfb565b610e42565b6101fd610404366004611c40565b61122a565b6065546001600160a01b03166102bc565b6101fd670de0b6b3a764000081565b6101f2610437366004611c25565b611292565b61046560405180604001604052806008815260200167726573756d65282960c01b815250611303565b6101015460ff1661048957604051636cd6020160e01b815260040160405180910390fd5b610101805460ff1916905560405133907f108589e68122bb4da8e5020c44387cab025243d0894392e275459641a90181a290600090a2565b6101015460009060ff16156104e9576040516313d0ff5960e31b815260040160405180910390fd5b6104f16113a1565b6104fa836113fa565b61050382611421565b60fb5460405163b62cad6960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301529091169063b62cad6990602401600060405180830381600087803b15801561056a57600080fd5b505af115801561057e573d6000803e3d6000fd5b50505050600061058f836001611442565b9050600061059e826001611471565b90506105aa8183611cce565b6040516370a0823160e01b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a08231906024016020604051808303816000875af1158015610610573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106349190611ce6565b1015610656576040516001629d12e360e01b0319815260040160405180910390fd5b8161010054101561067a5760405163a5047e9560e01b815260040160405180910390fd5b61010080548390039055801561074b5760fc546040516323b872dd60e01b81523360048201526001600160a01b039182166024820152604481018390526000917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af1158015610705573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107299190611cff565b9050806107495760405163aba1276560e01b815260040160405180910390fd5b505b604051632770a7eb60e21b8152336004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639dc29fac90604401600060405180830381600087803b1580156107b357600080fd5b505af11580156107c7573d6000803e3d6000fd5b506108019250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016905086866114f7565b60408051838152602081018690529081018290527f031e3397b091e3298ff850e89e965fe3543a0c64eb93659927433b06545f3f629060600160405180910390a150905061084f600160c955565b92915050565b61085d611566565b610866816115c0565b50565b600061087482611421565b6000610881836001611442565b90506000610890826001611471565b9050816101005410156108b65760405163a5047e9560e01b815260040160405180910390fd5b6108c08183611cce565b949350505050565b6108fb604051806040016040528060128152602001717365744665654f75742875696e743235362960701b815250611303565b612710811061091d576040516358d620b360e01b815260040160405180910390fd5b60fe80549082905560408051828152602081018490527fdc61767cf6b8f2d5ec16cd975db6d3a79fc69dc428b04c93e8db271de5e43b9f91015b60405180910390a15050565b61099560405180604001604052806011815260200170736574466565496e2875696e743235362960781b815250611303565b61271081106109b7576040516358d620b360e01b815260040160405180910390fd5b60fd80549082905560408051828152602081018490527fb76804f9786a4411a614b09a8211b2fd86f1f5b7a5e4410f35aa1578aac64e049101610957565b565b600054610100900460ff1615808015610a175750600054600160ff909116105b80610a315750303b158015610a31575060005460ff166001145b610a995760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610abc576000805461ff0019166101001790555b610ac5876113fa565b610ace866113fa565b610ad7856113fa565b610ae08761167e565b610ae86116b6565b61271084101580610afb57506127108310155b15610b19576040516358d620b360e01b815260040160405180910390fd5b60fd84905560fe83905560ff82905560fc80546001600160a01b038089166001600160a01b03199283161790925560fb8054928816929091169190911790558015610b9e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b60655433906001600160a01b03168114610c155760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401610a90565b610866816116e5565b610c51604051806040016040528060128152602001717365744f7261636c6528616464726573732960701b815250611303565b610c5a816113fa565b60fb80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f05cd89403c6bdeac21c2ff33de395121a31fa1bc2bf3adf4825f1f86e79969dd90600090a35050565b610cd4604051806040016040528060078152602001667061757365282960c81b815250611303565b6101015460ff1615610cf957604051631785c68160e01b815260040160405180910390fd5b610101805460ff1916600117905560405133907fb7aabc84a8f1fe9971d4bfffb4bb336af2c63e547360dd116940dc70da8159e190600090a2565b610d726040518060400160405280601981526020017f73657456656e7573547265617375727928616464726573732900000000000000815250611303565b610d7b816113fa565b60fc80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f35655f8f1a1f8b7ff254ff70c675c0a26ddcb3da6cb6decd491ecdee167e220b90600090a35050565b610e04604051806040016040528060168152602001757365745641494d696e744361702875696e743235362960501b815250611303565b60ff80549082905560408051828152602081018490527f0f43249751c1ca8dedff5711840ef91871f6fc2ce9b3891c1f33f4163ba1a9a39101610957565b6101015460009060ff1615610e6a576040516313d0ff5960e31b815260040160405180910390fd5b610e726113a1565b610e7b836113fa565b610e8482611421565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610eeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0f9190611ce6565b9050610f466001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330866116fe565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610fad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd19190611ce6565b90506000610fdf8383611d21565b60fb5460405163b62cad6960e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015292935091169063b62cad6990602401600060405180830381600087803b15801561104857600080fd5b505af115801561105c573d6000803e3d6000fd5b50505050600061106d826000611442565b9050600061107c826000611471565b9050600061108a8284611d21565b905060ff54836101005461109e9190611cce565b11156110bd576040516313d3ad1560e31b815260040160405180910390fd5b6101008054840190556040516340c10f1960e01b81526001600160a01b038a81166004830152602482018390527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b15801561113057600080fd5b505af1158015611144573d6000803e3d6000fd5b50505050816000146111d85760fc546040516340c10f1960e01b81526001600160a01b039182166004820152602481018490527f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b1580156111bf57600080fd5b505af11580156111d3573d6000803e3d6000fd5b505050505b60408051858152602081018390529081018390527f018e5c6d7bd9e0cafe3512ff02488f4c0ce3524a684e1097aab74666bf4fd00f9060600160405180910390a19550505050505061084f600160c955565b600061123582611421565b6000611242836000611442565b90506000611251826000611471565b9050600061125f8284611d21565b905060ff5483610100546112739190611cce565b11156108c0576040516313d3ad1560e31b815260040160405180910390fd5b61129a611566565b606580546001600160a01b0383166001600160a01b031990911681179091556112cb6033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6097546040516318c5e8ab60e01b81526000916001600160a01b0316906318c5e8ab906113369033908690600401611d90565b602060405180830381865afa158015611353573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113779190611cff565b90508061139d57333083604051634a3fa29360e01b8152600401610a9093929190611db4565b5050565b600260c954036113f35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a90565b600260c955565b6001600160a01b0381166108665760405163d92e233d60e01b815260040160405180910390fd5b8060000361086657604051631f2a200560e01b815260040160405180910390fd5b6000670de0b6b3a76400006114568361173c565b6114609085611de9565b61146a9190611e08565b9392505050565b6000808083600181111561148757611487611e2a565b03611495575060fd5461149a565b5060fe545b806000036114ac57600091505061084f565b6127106114b98286611de9565b10156114d85760405163617ab12d60e11b815260040160405180910390fd5b6127106114e58286611de9565b6114ef9190611e08565b91505061084f565b6040516001600160a01b03831660248201526044810182905261155a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611883565b505050565b600160c955565b6033546001600160a01b031633146109f55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a90565b6001600160a01b0381166116245760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e61676572206164604482015264647265737360d81b6064820152608401610a90565b609780546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa09101610957565b600054610100900460ff166116a55760405162461bcd60e51b8152600401610a9090611e40565b6116ad611958565b61086681611987565b600054610100900460ff166116dd5760405162461bcd60e51b8152600401610a9090611e40565b6109f56119ae565b606580546001600160a01b0319169055610866816119d5565b6040516001600160a01b03808516602483015283166044820152606481018290526117369085906323b872dd60e01b90608401611523565b50505050565b60fb546040516341976e0960e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260009283929116906341976e0990602401602060405180830381865afa1580156117aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ce9190611ce6565b905060008360018111156117e4576117e4611e2a565b03611836577f0000000000000000000000000000000000000000000000000000000000000000811061084f577f000000000000000000000000000000000000000000000000000000000000000061146a565b7f0000000000000000000000000000000000000000000000000000000000000000811161084f577f000000000000000000000000000000000000000000000000000000000000000061146a565b60006118d8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a279092919063ffffffff16565b90508051600014806118f95750808060200190518101906118f99190611cff565b61155a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a90565b600054610100900460ff1661197f5760405162461bcd60e51b8152600401610a9090611e40565b6109f5611a36565b600054610100900460ff1661085d5760405162461bcd60e51b8152600401610a9090611e40565b600054610100900460ff1661155f5760405162461bcd60e51b8152600401610a9090611e40565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606108c08484600085611a66565b600054610100900460ff16611a5d5760405162461bcd60e51b8152600401610a9090611e40565b6109f5336116e5565b606082471015611ac75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610a90565b600080866001600160a01b03168587604051611ae39190611e8b565b60006040518083038185875af1925050503d8060008114611b20576040519150601f19603f3d011682016040523d82523d6000602084013e611b25565b606091505b5091509150611b3687838387611b41565b979650505050505050565b60608315611bb0578251600003611ba9576001600160a01b0385163b611ba95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a90565b50816108c0565b6108c08383815115611bc55781518083602001fd5b8060405162461bcd60e51b8152600401610a909190611ea7565b80356001600160a01b0381168114611bf657600080fd5b919050565b60008060408385031215611c0e57600080fd5b611c1783611bdf565b946020939093013593505050565b600060208284031215611c3757600080fd5b61146a82611bdf565b600060208284031215611c5257600080fd5b5035919050565b60008060008060008060c08789031215611c7257600080fd5b611c7b87611bdf565b9550611c8960208801611bdf565b9450611c9760408801611bdf565b9350606087013592506080870135915060a087013590509295509295509295565b634e487b7160e01b600052601160045260246000fd5b60008219821115611ce157611ce1611cb8565b500190565b600060208284031215611cf857600080fd5b5051919050565b600060208284031215611d1157600080fd5b8151801515811461146a57600080fd5b600082821015611d3357611d33611cb8565b500390565b60005b83811015611d53578181015183820152602001611d3b565b838111156117365750506000910152565b60008151808452611d7c816020860160208601611d38565b601f01601f19169290920160200192915050565b6001600160a01b03831681526040602082018190526000906108c090830184611d64565b6001600160a01b03848116825283166020820152606060408201819052600090611de090830184611d64565b95945050505050565b6000816000190483118215151615611e0357611e03611cb8565b500290565b600082611e2557634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052602160045260246000fd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008251611e9d818460208701611d38565b9190910192915050565b60208152600061146a6020830184611d6456fea2646970667358221220776bae9a01444556f49e135e272e6d666dc0b437dde23f690af77c95ce44ac9b64736f6c634300080d0033", "devdoc": { "author": "Venus Protocol", "kind": "dev", @@ -726,28 +823,46 @@ }, "initialize(address,address,address,uint256,uint256,uint256)": { "params": { - "accessControlManager_": "The address of the AccessControlManager contract", - "comptroller_": "The address of the Comptroller contract", - "feeIn_": "The percentage of fees to be applied to a stablecoin -> VAI swap", - "feeOut_": "The percentage of fees to be applied to a VAI -> stablecoin swap", - "vaiMintCap_": "The cap for the total amount of VAI that can be minted", - "venusTreasury_": "The address where fees will be sent" + "accessControlManager_": "The address of the AccessControlManager contract.", + "feeIn_": "The percentage of fees to be applied to a stablecoin -> VAI swap.", + "feeOut_": "The percentage of fees to be applied to a VAI -> stablecoin swap.", + "oracleAddress_": "The address of the ResilientOracle contract.", + "vaiMintCap_": "The cap for the total amount of VAI that can be minted.", + "venusTreasury_": "The address where fees will be sent." } }, "owner()": { "details": "Returns the address of the current owner." }, "pause()": { - "details": "Reverts if the contract is already paused" + "details": "Reverts if the contract is already paused." }, "pendingOwner()": { "details": "Returns the address of the pending owner." }, + "previewSwapStableForVAI(uint256)": { + "details": "This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.", + "params": { + "stableTknAmount": "The amount of stable tokens provided for the swap." + }, + "returns": { + "_0": "The amount of VAI that would be sent to the receiver." + } + }, + "previewSwapVAIForStable(uint256)": { + "details": "This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.", + "params": { + "stableTknAmount": "The amount of stable tokens to be received after the swap." + }, + "returns": { + "_0": "The amount of VAI that would be taken from the user." + } + }, "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + "details": "Disabling renounceOwnership function." }, "resume()": { - "details": "Reverts if the contract is not paused" + "details": "Reverts if the contract is not paused." }, "setAccessControlManager(address)": { "custom:access": "Only Governance", @@ -757,34 +872,34 @@ "accessControlManager_": "The new address of the AccessControlManager" } }, - "setComptroller(address)": { - "details": "Reverts if the new address is zero or the oracle address returned from Comptroller is zero", + "setFeeIn(uint256)": { + "details": "Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).", "params": { - "comptroller_": "The new address of the Comptroller contract" + "feeIn_": "The new fee percentage for incoming swaps." } }, - "setFeeIn(uint256)": { - "details": "Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR)", + "setFeeOut(uint256)": { + "details": "Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).", "params": { - "feeIn_": "The new fee percentage for incoming swaps" + "feeOut_": "The new fee percentage for outgoing swaps." } }, - "setFeeOut(uint256)": { - "details": "Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR)", + "setOracle(address)": { + "details": "Reverts if the new address is zero.", "params": { - "feeOut_": "The new fee percentage for outgoing swaps" + "oracleAddress_": "The new address of the ResilientOracle contract." } }, - "setVaiMintCap(uint256)": { - "details": "Set the maximum amount of VAI that can be minted through this contract", + "setVAIMintCap(uint256)": { + "details": "Set the maximum amount of VAI that can be minted through this contract.", "params": { - "vaiMintCap_": "The new maximum amount of VAI that can be minted" + "vaiMintCap_": "The new maximum amount of VAI that can be minted." } }, "setVenusTreasury(address)": { - "details": "Reverts if the new address is zero", + "details": "Reverts if the new address is zero.", "params": { - "venusTreasury_": "The new address of the Venus Treasury contract" + "venusTreasury_": "The new address of the Venus Treasury contract." } }, "swapStableForVAI(address,uint256)": { @@ -792,95 +907,215 @@ "params": { "receiver": "The address that will receive the VAI tokens.", "stableTknAmount": "The amount of stable tokens to be swapped." + }, + "returns": { + "_0": "Amount of VAI minted to the sender." } }, "swapVAIForStable(address,uint256)": { "params": { - "receiver": "The address where the stablecoin will be sent", - "stableTknAmount": "The amount of stable tokens to receive" + "receiver": "The address where the stablecoin will be sent.", + "stableTknAmount": "The amount of stable tokens to receive." + }, + "returns": { + "_0": "The amount of VAI received and burnt from the sender." } }, "transferOwnership(address)": { "details": "Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner." } }, - "title": "Peg Stability Contract", + "stateVariables": { + "ONE_DOLLAR": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable", + "details": "Our oracle is returning amount depending on the number of decimals of the stable token. (36 - asset_decimals) E.g. 8 decimal asset = 1e28." + }, + "STABLE_TOKEN_ADDRESS": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable" + }, + "VAI": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable" + } + }, + "title": "Peg Stability Contract.", "version": 1 }, "userdoc": { "errors": { + "AlreadyPaused()": [ + { + "notice": "thrown when attempted to pause an already paused contract" + } + ], + "AmountTooSmall()": [ + { + "notice": "thrown when fee calculation will result in rounding down to 0 due to stable token amount being a too small number" + } + ], + "InvalidFee()": [ + { + "notice": "thrown when fee is >= 100%" + } + ], + "NotEnoughVAI()": [ + { + "notice": "thrown when the user doesn't have enough VAI balance to provide for the amount of stable tokens he wishes to get" + } + ], + "NotPaused()": [ + { + "notice": "thrown when attempted to resume the contract if it is already resumed" + } + ], + "Paused()": [ + { + "notice": "thrown when contract is in paused state" + } + ], + "TooManyDecimals()": [ + { + "notice": "thrown when stable token has more than 18 decimals" + } + ], "Unauthorized(address,address,string)": [ { "notice": "Thrown when the action is prohibited by AccessControlManager" } + ], + "VAIMintCapReached()": [ + { + "notice": "thrown when VAI to be minted will go beyond the mintCap threshold" + } + ], + "VAIMintedUnderflow()": [ + { + "notice": "thrown when the amount of VAI to be burnt exceeds the vaiMinted amount" + } + ], + "VAITransferFail()": [ + { + "notice": "thrown when the VAI transfer to treasury fails" + } + ], + "ZeroAddress()": [ + { + "notice": "thrown when a zero address is passed as a function parameter" + } + ], + "ZeroAmount()": [ + { + "notice": "thrown when a zero amount is passed as stable token amount parameter" + } ] }, "events": { - "ComptrollerChanged(address,address)": { - "notice": "Event emitted when comptroller state var is modified" - }, "FeeInChanged(uint256,uint256)": { - "notice": "Event emitted when feeIn state var is modified" + "notice": "Event emitted when feeIn state var is modified." }, "FeeOutChanged(uint256,uint256)": { - "notice": "Event emitted when feeOut state var is modified" + "notice": "Event emitted when feeOut state var is modified." }, "NewAccessControlManager(address,address)": { "notice": "Emitted when access control manager contract address is changed" }, + "OracleChanged(address,address)": { + "notice": "Event emitted when oracle state var is modified." + }, "PSMPaused(address)": { - "notice": "Event emitted when contract is paused" + "notice": "Event emitted when contract is paused." }, "PSMResumed(address)": { - "notice": "Event emitted when the contract is resumed after pause" + "notice": "Event emitted when the contract is resumed after pause." }, "StableForVAISwapped(uint256,uint256,uint256)": { - "notice": "Event emitted when stable token is swapped for VAI" + "notice": "Event emitted when stable token is swapped for VAI." }, - "VaiForStableSwapped(uint256,uint256,uint256)": { - "notice": "Event emitted when stable token is swapped for VAI" + "VAIForStableSwapped(uint256,uint256,uint256)": { + "notice": "Event emitted when stable token is swapped for VAI." }, - "VaiMintCapChanged(uint256,uint256)": { - "notice": "Event emitted when vaiMintCap state var is modified" + "VAIMintCapChanged(uint256,uint256)": { + "notice": "Event emitted when vaiMintCap state var is modified." }, "VenusTreasuryChanged(address,address)": { - "notice": "Event emitted when venusTreasury state var is modified" + "notice": "Event emitted when venusTreasury state var is modified." } }, "kind": "user", "methods": { + "BASIS_POINTS_DIVISOR()": { + "notice": "The divisor used to convert fees to basis points." + }, + "MANTISSA_ONE()": { + "notice": "The mantissa value representing 1 (used for calculations)." + }, + "ONE_DOLLAR()": { + "notice": "The value representing one dollar in the stable token." + }, + "STABLE_TOKEN_ADDRESS()": { + "notice": "The address of the stable token contract." + }, + "VAI()": { + "notice": "VAI token contract." + }, "accessControlManager()": { "notice": "Returns the address of the access control manager contract" }, + "feeIn()": { + "notice": "The incoming stableCoin fee. (Fee for swapStableForVAI)." + }, + "feeOut()": { + "notice": "The outgoing stableCoin fee. (Fee for swapVAIForStable)." + }, "initialize(address,address,address,uint256,uint256,uint256)": { - "notice": "Initializes the contract via Proxy Contract with the required parameters" + "notice": "Initializes the contract via Proxy Contract with the required parameters." + }, + "isPaused()": { + "notice": "A flag indicating whether the contract is currently paused or not." + }, + "oracle()": { + "notice": "The address of ResilientOracle contract wrapped in its interface." }, "pause()": { - "notice": "Pause the PSM contract" + "notice": "Pause the PSM contract." + }, + "previewSwapStableForVAI(uint256)": { + "notice": "Calculates the amount of VAI that would be sent to the receiver." + }, + "previewSwapVAIForStable(uint256)": { + "notice": "Calculates the amount of VAI that would be burnt from the user." }, "resume()": { - "notice": "Resume the PSM contract" + "notice": "Resume the PSM contract." }, "setAccessControlManager(address)": { "notice": "Sets the address of AccessControlManager" }, - "setComptroller(address)": { - "notice": "Set the address of the Comptroller contract from which we obtain the oracle address" - }, "setFeeIn(uint256)": { - "notice": "Set the fee percentage for incoming swaps" + "notice": "Set the fee percentage for incoming swaps." }, "setFeeOut(uint256)": { - "notice": "Set the fee percentage for outgoing swaps" + "notice": "Set the fee percentage for outgoing swaps." + }, + "setOracle(address)": { + "notice": "Set the address of the ResilientOracle contract." }, "setVenusTreasury(address)": { - "notice": "Set the address of the Venus Treasury contract" + "notice": "Set the address of the Venus Treasury contract." }, "swapStableForVAI(address,uint256)": { "notice": "Swaps stable tokens for VAI with fees." }, "swapVAIForStable(address,uint256)": { - "notice": "Swaps VAI for a stable token" + "notice": "Swaps VAI for a stable token." + }, + "vaiMintCap()": { + "notice": "The maximum amount of VAI that can be minted through this contract." + }, + "vaiMinted()": { + "notice": "The total amount of VAI minted through this contract." + }, + "venusTreasury()": { + "notice": "The address of the Venus Treasury contract." } }, "notice": "Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.", @@ -905,7 +1140,7 @@ "type": "t_bool" }, { - "astId": 1199, + "astId": 1376, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "__gap", "offset": 0, @@ -945,15 +1180,15 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 1287, + "astId": 1464, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "_accessControlManager", "offset": 0, "slot": "151", - "type": "t_contract(IAccessControlManagerV8)1471" + "type": "t_contract(IAccessControlManagerV8)1648" }, { - "astId": 1292, + "astId": 1469, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "__gap", "offset": 0, @@ -969,7 +1204,7 @@ "type": "t_uint256" }, { - "astId": 478, + "astId": 489, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "__gap", "offset": 0, @@ -977,15 +1212,15 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 1564, + "astId": 1780, "contract": "contracts/PegStability/PegStability.sol:PegStability", - "label": "comptroller", + "label": "oracle", "offset": 0, "slot": "251", - "type": "t_address" + "type": "t_contract(ResilientOracleInterface)1678" }, { - "astId": 1566, + "astId": 1783, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "venusTreasury", "offset": 0, @@ -993,7 +1228,7 @@ "type": "t_address" }, { - "astId": 1568, + "astId": 1786, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "feeIn", "offset": 0, @@ -1001,7 +1236,7 @@ "type": "t_uint256" }, { - "astId": 1570, + "astId": 1789, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "feeOut", "offset": 0, @@ -1009,7 +1244,7 @@ "type": "t_uint256" }, { - "astId": 1572, + "astId": 1792, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "vaiMintCap", "offset": 0, @@ -1017,7 +1252,7 @@ "type": "t_uint256" }, { - "astId": 1574, + "astId": 1795, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "vaiMinted", "offset": 0, @@ -1025,7 +1260,7 @@ "type": "t_uint256" }, { - "astId": 1576, + "astId": 1798, "contract": "contracts/PegStability/PegStability.sol:PegStability", "label": "isPaused", "offset": 0, @@ -1056,11 +1291,16 @@ "label": "bool", "numberOfBytes": "1" }, - "t_contract(IAccessControlManagerV8)1471": { + "t_contract(IAccessControlManagerV8)1648": { "encoding": "inplace", "label": "contract IAccessControlManagerV8", "numberOfBytes": "20" }, + "t_contract(ResilientOracleInterface)1678": { + "encoding": "inplace", + "label": "contract ResilientOracleInterface", + "numberOfBytes": "20" + }, "t_uint256": { "encoding": "inplace", "label": "uint256", diff --git a/deployments/bsctestnet/PegStability_USDT_Proxy.json b/deployments/bsctestnet/PegStability_USDT_Proxy.json index 4cba95ae4..3afba2d09 100644 --- a/deployments/bsctestnet/PegStability_USDT_Proxy.json +++ b/deployments/bsctestnet/PegStability_USDT_Proxy.json @@ -1,5 +1,5 @@ { - "address": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", + "address": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", "abi": [ { "inputs": [ @@ -146,84 +146,84 @@ "type": "receive" } ], - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", "receipt": { "to": null, - "from": "0xFEA1c651A47FE29dB9b1bf3cC1f224d8D9CFF68C", - "contractAddress": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", - "transactionIndex": 10, - "gasUsed": "907219", - "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000000000000000000000000000000000000000000000000000200000000000000008000000000000000000000000000000002040001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000400000000000000800000000000000000000000000024000000000000000010040000000000040401000000000000000020000000020000000000010000000000000000000800000000000000000100000000", - "blockHash": "0xeec7469873a8faf83d5a6981e12f4e2eec12704dcf7086a0fddd84bcc8f1239f", - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", + "from": "0x8BDA9f9E1fEF0DFd404Fef338D9fE4c543d172e1", + "contractAddress": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", + "transactionIndex": 0, + "gasUsed": "912188", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000000000000000000000040000000000000000800000000002000000000000000008000010000000000000000000000000002000001040400000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000080000000000080000000000000800000000000000000000010000000000400000004000000800000000000000000000000000020000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000800000000000000000000000000", + "blockHash": "0xfd6ae513584f44db7bf9add95b28841640721a6902c07934cc11654c36812776", + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", "logs": [ { - "transactionIndex": 10, - "blockNumber": 30883315, - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", - "address": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", + "transactionIndex": 0, + "blockNumber": 32091799, + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", + "address": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", "topics": [ "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000c319b8207a9fb2797710bb79b4ab8933f90da9b3" + "0x000000000000000000000000dda903294fb71141302ad3bf2af37dd6cbd5dbbf" ], "data": "0x", - "logIndex": 45, - "blockHash": "0xeec7469873a8faf83d5a6981e12f4e2eec12704dcf7086a0fddd84bcc8f1239f" + "logIndex": 0, + "blockHash": "0xfd6ae513584f44db7bf9add95b28841640721a6902c07934cc11654c36812776" }, { - "transactionIndex": 10, - "blockNumber": 30883315, - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", - "address": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", + "transactionIndex": 0, + "blockNumber": 32091799, + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", + "address": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000fea1c651a47fe29db9b1bf3cc1f224d8d9cff68c" + "0x0000000000000000000000008bda9f9e1fef0dfd404fef338d9fe4c543d172e1" ], "data": "0x", - "logIndex": 46, - "blockHash": "0xeec7469873a8faf83d5a6981e12f4e2eec12704dcf7086a0fddd84bcc8f1239f" + "logIndex": 1, + "blockHash": "0xfd6ae513584f44db7bf9add95b28841640721a6902c07934cc11654c36812776" }, { - "transactionIndex": 10, - "blockNumber": 30883315, - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", - "address": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", + "transactionIndex": 0, + "blockNumber": 32091799, + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", + "address": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045f8a08f534f34a97187626e05d4b6648eeaa9aa", - "logIndex": 47, - "blockHash": "0xeec7469873a8faf83d5a6981e12f4e2eec12704dcf7086a0fddd84bcc8f1239f" + "logIndex": 2, + "blockHash": "0xfd6ae513584f44db7bf9add95b28841640721a6902c07934cc11654c36812776" }, { - "transactionIndex": 10, - "blockNumber": 30883315, - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", - "address": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", + "transactionIndex": 0, + "blockNumber": 32091799, + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", + "address": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 48, - "blockHash": "0xeec7469873a8faf83d5a6981e12f4e2eec12704dcf7086a0fddd84bcc8f1239f" + "logIndex": 3, + "blockHash": "0xfd6ae513584f44db7bf9add95b28841640721a6902c07934cc11654c36812776" }, { - "transactionIndex": 10, - "blockNumber": 30883315, - "transactionHash": "0x1084ef1e56d20b4055e9fb1b6f9082cd54d97aa7b68b12a83579936a121b2e99", - "address": "0x2822E0Ac03e64F7BA26e0aCb79EC0B6336e9CA2A", + "transactionIndex": 0, + "blockNumber": 32091799, + "transactionHash": "0x112bf2e85a863436d9b12587ef20284720784f864281ee667ab2549ef7482086", + "address": "0xB21E69eef4Bc1D64903fa28D9b32491B1c0786F1", "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000007877ffd62649b6a1557b55d4c20fcbab17344c91", - "logIndex": 49, - "blockHash": "0xeec7469873a8faf83d5a6981e12f4e2eec12704dcf7086a0fddd84bcc8f1239f" + "logIndex": 4, + "blockHash": "0xfd6ae513584f44db7bf9add95b28841640721a6902c07934cc11654c36812776" } ], - "blockNumber": 30883315, - "cumulativeGasUsed": "2792437", + "blockNumber": 32091799, + "cumulativeGasUsed": "912188", "status": 1, "byzantium": true }, "args": [ - "0xC319b8207a9FB2797710BB79B4aB8933f90dA9B3", + "0xDDa903294fB71141302aD3Bf2AF37dD6Cbd5DBbF", "0x7877fFd62649b6A1557B55D4c20fcBaB17344C91", - "0x728cdbca00000000000000000000000045f8a08f534f34a97187626e05d4b6648eeaa9aa000000000000000000000000fea1c651a47fe29db9b1bf3cc1f224d8d9cff68c00000000000000000000000094d1820b2d1c7c7452a163983dc888cec546b77d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000422ca8b0a00a425000000" + "0x728cdbca00000000000000000000000045f8a08f534f34a97187626e05d4b6648eeaa9aa000000000000000000000000fea1c651a47fe29db9b1bf3cc1f224d8d9cff68c0000000000000000000000003cd69251d04a28d887ac14cbe2e14c52f3d578230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000422ca8b0a00a425000000" ], "numDeployments": 1, "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", diff --git a/deployments/bsctestnet/solcInputs/ad861ed5d4e7191c78cab74f6cb7beec.json b/deployments/bsctestnet/solcInputs/ad861ed5d4e7191c78cab74f6cb7beec.json new file mode 100644 index 000000000..b6602b96e --- /dev/null +++ b/deployments/bsctestnet/solcInputs/ad861ed5d4e7191c78cab74f6cb7beec.json @@ -0,0 +1,78 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./OwnableUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership} and {acceptOwnership}.\n *\n * This module is used through inheritance. It will make available all functions\n * from parent (Ownable).\n */\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\n function __Ownable2Step_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable2Step_init_unchained() internal onlyInitializing {\n }\n address private _pendingOwner;\n\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Returns the address of the pending owner.\n */\n function pendingOwner() public view virtual returns (address) {\n return _pendingOwner;\n }\n\n /**\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual override onlyOwner {\n _pendingOwner = newOwner;\n emit OwnershipTransferStarted(owner(), newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual override {\n delete _pendingOwner;\n super._transferOwnership(newOwner);\n }\n\n /**\n * @dev The new owner accepts the ownership transfer.\n */\n function acceptOwnership() public virtual {\n address sender = _msgSender();\n require(pendingOwner() == sender, \"Ownable2Step: caller is not the new owner\");\n _transferOwnership(sender);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20PermitUpgradeable {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\nimport \"../extensions/IERC20PermitUpgradeable.sol\";\nimport \"../../../utils/AddressUpgradeable.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20Upgradeable {\n using AddressUpgradeable for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to\n * 0 before setting it to a non-zero value.\n */\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20PermitUpgradeable token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\n\nimport \"./IAccessControlManagerV8.sol\";\n\n/**\n * @title Venus Access Control Contract.\n * @dev The AccessControlledV8 contract is a wrapper around the OpenZeppelin AccessControl contract\n * It provides a standardized way to control access to methods within the Venus Smart Contract Ecosystem.\n * The contract allows the owner to set an AccessControlManager contract address.\n * It can restrict method calls based on the sender's role and the method's signature.\n */\n\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\n /// @notice Access control manager contract\n IAccessControlManagerV8 private _accessControlManager;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n\n /// @notice Emitted when access control manager contract address is changed\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\n\n /// @notice Thrown when the action is prohibited by AccessControlManager\n error Unauthorized(address sender, address calledContract, string methodSignature);\n\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\n __Ownable2Step_init();\n __AccessControlled_init_unchained(accessControlManager_);\n }\n\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Sets the address of AccessControlManager\n * @dev Admin function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n * @custom:event Emits NewAccessControlManager event\n * @custom:access Only Governance\n */\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Returns the address of the access control manager contract\n */\n function accessControlManager() external view returns (IAccessControlManagerV8) {\n return _accessControlManager;\n }\n\n /**\n * @dev Internal function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n */\n function _setAccessControlManager(address accessControlManager_) internal {\n require(address(accessControlManager_) != address(0), \"invalid acess control manager address\");\n address oldAccessControlManager = address(_accessControlManager);\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\n }\n\n /**\n * @notice Reverts if the call is not allowed by AccessControlManager\n * @param signature Method signature\n */\n function _checkAccessAllowed(string memory signature) internal view {\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\n\n if (!isAllowedToCall) {\n revert Unauthorized(msg.sender, address(this), signature);\n }\n }\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts/access/IAccessControl.sol\";\n\ninterface IAccessControlManagerV8 is IAccessControl {\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\n\n function revokeCallPermission(\n address contractAddress,\n string calldata functionSig,\n address accountToRevoke\n ) external;\n\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\n\n function hasPermission(\n address account,\n address contractAddress,\n string calldata functionSig\n ) external view returns (bool);\n}\n" + }, + "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\ninterface OracleInterface {\n function getPrice(address asset) external view returns (uint256);\n}\n\ninterface ResilientOracleInterface is OracleInterface {\n function updatePrice(address vToken) external;\n\n function updateAssetPrice(address asset) external;\n\n function getUnderlyingPrice(address vToken) external view returns (uint256);\n}\n\ninterface TwapInterface is OracleInterface {\n function updateTwap(address asset) external returns (uint256);\n}\n\ninterface BoundValidatorInterface {\n function validatePriceWithAnchorPrice(\n address asset,\n uint256 reporterPrice,\n uint256 anchorPrice\n ) external view returns (bool);\n}\n" + }, + "contracts/PegStability/IVAI.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\ninterface IVAI {\n function balanceOf(address usr) external returns (uint256);\n\n function transferFrom(address src, address dst, uint amount) external returns (bool);\n\n function mint(address usr, uint wad) external;\n\n function burn(address usr, uint wad) external;\n}\n" + }, + "contracts/PegStability/PegStability.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\";\nimport \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { ResilientOracleInterface } from \"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\";\nimport { IVAI } from \"./IVAI.sol\";\n\n/**\n * @title Peg Stability Contract.\n * @notice Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.\n * @author Venus Protocol\n */\ncontract PegStability is AccessControlledV8, ReentrancyGuardUpgradeable {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n // Helper enum for calculation of the fee.\n enum FeeDirection {\n IN,\n OUT\n }\n\n /// @notice The divisor used to convert fees to basis points.\n uint256 public constant BASIS_POINTS_DIVISOR = 10000;\n\n /// @notice The mantissa value representing 1 (used for calculations).\n uint256 public constant MANTISSA_ONE = 1e18;\n\n /// @notice The value representing one dollar in the stable token.\n /// @dev Our oracle is returning amount depending on the number of decimals of the stable token. (36 - asset_decimals) E.g. 8 decimal asset = 1e28.\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n uint256 public immutable ONE_DOLLAR;\n\n /// @notice VAI token contract.\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n IVAI public immutable VAI;\n\n /// @notice The address of the stable token contract.\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable STABLE_TOKEN_ADDRESS;\n\n /// @notice The address of ResilientOracle contract wrapped in its interface.\n ResilientOracleInterface public oracle;\n\n /// @notice The address of the Venus Treasury contract.\n address public venusTreasury;\n\n /// @notice The incoming stableCoin fee. (Fee for swapStableForVAI).\n uint256 public feeIn;\n\n /// @notice The outgoing stableCoin fee. (Fee for swapVAIForStable).\n uint256 public feeOut;\n\n /// @notice The maximum amount of VAI that can be minted through this contract.\n uint256 public vaiMintCap;\n\n /// @notice The total amount of VAI minted through this contract.\n uint256 public vaiMinted;\n\n /// @notice A flag indicating whether the contract is currently paused or not.\n bool public isPaused;\n\n /// @notice Event emitted when contract is paused.\n event PSMPaused(address indexed admin);\n\n /// @notice Event emitted when the contract is resumed after pause.\n event PSMResumed(address indexed admin);\n\n /// @notice Event emitted when feeIn state var is modified.\n event FeeInChanged(uint256 oldFeeIn, uint256 newFeeIn);\n\n /// @notice Event emitted when feeOut state var is modified.\n event FeeOutChanged(uint256 oldFeeOut, uint256 newFeeOut);\n\n /// @notice Event emitted when vaiMintCap state var is modified.\n event VAIMintCapChanged(uint256 oldCap, uint256 newCap);\n\n /// @notice Event emitted when venusTreasury state var is modified.\n event VenusTreasuryChanged(address indexed oldTreasury, address indexed newTreasury);\n\n /// @notice Event emitted when oracle state var is modified.\n event OracleChanged(address indexed oldOracle, address indexed newOracle);\n\n /// @notice Event emitted when stable token is swapped for VAI.\n event StableForVAISwapped(uint256 stableIn, uint256 vaiOut, uint256 fee);\n\n /// @notice Event emitted when stable token is swapped for VAI.\n event VAIForStableSwapped(uint256 vaiBurnt, uint256 stableOut, uint256 vaiFee);\n\n /// @notice thrown when contract is in paused state\n error Paused();\n\n /// @notice thrown when attempted to pause an already paused contract\n error AlreadyPaused();\n\n /// @notice thrown when attempted to resume the contract if it is already resumed\n error NotPaused();\n\n /// @notice thrown when stable token has more than 18 decimals\n error TooManyDecimals();\n\n /// @notice thrown when fee is >= 100%\n error InvalidFee();\n\n /// @notice thrown when a zero address is passed as a function parameter\n error ZeroAddress();\n\n /// @notice thrown when a zero amount is passed as stable token amount parameter\n error ZeroAmount();\n\n /// @notice thrown when the user doesn't have enough VAI balance to provide for the amount of stable tokens he wishes to get\n error NotEnoughVAI();\n\n /// @notice thrown when the amount of VAI to be burnt exceeds the vaiMinted amount\n error VAIMintedUnderflow();\n\n /// @notice thrown when the VAI transfer to treasury fails\n error VAITransferFail();\n\n /// @notice thrown when VAI to be minted will go beyond the mintCap threshold\n error VAIMintCapReached();\n /// @notice thrown when fee calculation will result in rounding down to 0 due to stable token amount being a too small number\n error AmountTooSmall();\n\n /**\n * @dev Prevents functions to execute when contract is paused.\n */\n modifier isActive() {\n if (isPaused) revert Paused();\n _;\n }\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address stableTokenAddress_, address vaiAddress_) {\n _ensureNonzeroAddress(stableTokenAddress_);\n _ensureNonzeroAddress(vaiAddress_);\n\n uint256 decimals_ = IERC20MetadataUpgradeable(stableTokenAddress_).decimals();\n\n if (decimals_ > 18) {\n revert TooManyDecimals();\n }\n\n ONE_DOLLAR = 10 ** (36 - decimals_); // 1$ scaled to the decimals returned by our Oracle\n STABLE_TOKEN_ADDRESS = stableTokenAddress_;\n VAI = IVAI(vaiAddress_);\n _disableInitializers();\n }\n\n /**\n * @notice Initializes the contract via Proxy Contract with the required parameters.\n * @param accessControlManager_ The address of the AccessControlManager contract.\n * @param venusTreasury_ The address where fees will be sent.\n * @param oracleAddress_ The address of the ResilientOracle contract.\n * @param feeIn_ The percentage of fees to be applied to a stablecoin -> VAI swap.\n * @param feeOut_ The percentage of fees to be applied to a VAI -> stablecoin swap.\n * @param vaiMintCap_ The cap for the total amount of VAI that can be minted.\n */\n function initialize(\n address accessControlManager_,\n address venusTreasury_,\n address oracleAddress_,\n uint256 feeIn_,\n uint256 feeOut_,\n uint256 vaiMintCap_\n ) external initializer {\n _ensureNonzeroAddress(accessControlManager_);\n _ensureNonzeroAddress(venusTreasury_);\n _ensureNonzeroAddress(oracleAddress_);\n __AccessControlled_init(accessControlManager_);\n __ReentrancyGuard_init();\n\n if (feeIn_ >= BASIS_POINTS_DIVISOR || feeOut_ >= BASIS_POINTS_DIVISOR) {\n revert InvalidFee();\n }\n\n feeIn = feeIn_;\n feeOut = feeOut_;\n vaiMintCap = vaiMintCap_;\n venusTreasury = venusTreasury_;\n oracle = ResilientOracleInterface(oracleAddress_);\n }\n\n /*** Swap Functions ***/\n\n /**\n * @notice Swaps VAI for a stable token.\n * @param receiver The address where the stablecoin will be sent.\n * @param stableTknAmount The amount of stable tokens to receive.\n * @return The amount of VAI received and burnt from the sender.\n */\n // @custom:event Emits VAIForStableSwapped event.\n function swapVAIForStable(\n address receiver,\n uint256 stableTknAmount\n ) external isActive nonReentrant returns (uint256) {\n _ensureNonzeroAddress(receiver);\n _ensureNonzeroAmount(stableTknAmount);\n\n // update oracle price and calculate USD value of the stable token amount scaled in 18 decimals\n oracle.updateAssetPrice(STABLE_TOKEN_ADDRESS);\n uint256 stableTknAmountUSD = _previewTokenUSDAmount(stableTknAmount, FeeDirection.OUT);\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.OUT);\n\n if (VAI.balanceOf(msg.sender) < stableTknAmountUSD + fee) {\n revert NotEnoughVAI();\n }\n if (vaiMinted < stableTknAmountUSD) {\n revert VAIMintedUnderflow();\n }\n\n unchecked {\n vaiMinted -= stableTknAmountUSD;\n }\n\n if (fee != 0) {\n bool success = VAI.transferFrom(msg.sender, venusTreasury, fee);\n if (!success) {\n revert VAITransferFail();\n }\n }\n\n VAI.burn(msg.sender, stableTknAmountUSD);\n IERC20Upgradeable(STABLE_TOKEN_ADDRESS).safeTransfer(receiver, stableTknAmount);\n emit VAIForStableSwapped(stableTknAmountUSD, stableTknAmount, fee);\n return stableTknAmountUSD;\n }\n\n /**\n * @notice Swaps stable tokens for VAI with fees.\n * @dev This function adds support to fee-on-transfer tokens. The actualTransferAmt is calculated, by recording token balance state before and after the transfer.\n * @param receiver The address that will receive the VAI tokens.\n * @param stableTknAmount The amount of stable tokens to be swapped.\n * @return Amount of VAI minted to the sender.\n */\n // @custom:event Emits StableForVAISwapped event.\n function swapStableForVAI(\n address receiver,\n uint256 stableTknAmount\n ) external isActive nonReentrant returns (uint256) {\n _ensureNonzeroAddress(receiver);\n _ensureNonzeroAmount(stableTknAmount);\n // transfer IN, supporting fee-on-transfer tokens\n uint256 balanceBefore = IERC20Upgradeable(STABLE_TOKEN_ADDRESS).balanceOf(address(this));\n IERC20Upgradeable(STABLE_TOKEN_ADDRESS).safeTransferFrom(msg.sender, address(this), stableTknAmount);\n uint256 balanceAfter = IERC20Upgradeable(STABLE_TOKEN_ADDRESS).balanceOf(address(this));\n\n //calculate actual transfered amount (in case of fee-on-transfer tokens)\n uint256 actualTransferAmt = balanceAfter - balanceBefore;\n\n // update oracle price and calculate USD value of the stable token amount scaled in 18 decimals\n oracle.updateAssetPrice(STABLE_TOKEN_ADDRESS);\n uint256 actualTransferAmtInUSD = _previewTokenUSDAmount(actualTransferAmt, FeeDirection.IN);\n\n //calculate feeIn\n uint256 fee = _calculateFee(actualTransferAmtInUSD, FeeDirection.IN);\n uint256 vaiToMint = actualTransferAmtInUSD - fee;\n\n if (vaiMinted + actualTransferAmtInUSD > vaiMintCap) {\n revert VAIMintCapReached();\n }\n unchecked {\n vaiMinted += actualTransferAmtInUSD;\n }\n\n // mint VAI to receiver\n VAI.mint(receiver, vaiToMint);\n\n // mint VAI fee to venus treasury\n if (fee != 0) {\n VAI.mint(venusTreasury, fee);\n }\n\n emit StableForVAISwapped(actualTransferAmt, vaiToMint, fee);\n return vaiToMint;\n }\n\n /*** Admin Functions ***/\n\n /**\n * @notice Pause the PSM contract.\n * @dev Reverts if the contract is already paused.\n */\n // @custom:event Emits PSMPaused event.\n function pause() external {\n _checkAccessAllowed(\"pause()\");\n if (isPaused) {\n revert AlreadyPaused();\n }\n isPaused = true;\n emit PSMPaused(msg.sender);\n }\n\n /**\n * @notice Resume the PSM contract.\n * @dev Reverts if the contract is not paused.\n */\n // @custom:event Emits PSMResumed event.\n function resume() external {\n _checkAccessAllowed(\"resume()\");\n if (!isPaused) {\n revert NotPaused();\n }\n isPaused = false;\n emit PSMResumed(msg.sender);\n }\n\n /**\n * @notice Set the fee percentage for incoming swaps.\n * @dev Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).\n * @param feeIn_ The new fee percentage for incoming swaps.\n */\n // @custom:event Emits FeeInChanged event.\n function setFeeIn(uint256 feeIn_) external {\n _checkAccessAllowed(\"setFeeIn(uint256)\");\n // feeIn = 10000 = 100%\n if (feeIn_ >= BASIS_POINTS_DIVISOR) {\n revert InvalidFee();\n }\n uint256 oldFeeIn = feeIn;\n feeIn = feeIn_;\n emit FeeInChanged(oldFeeIn, feeIn_);\n }\n\n /**\n * @notice Set the fee percentage for outgoing swaps.\n * @dev Reverts if the new fee percentage is invalid (greater than or equal to BASIS_POINTS_DIVISOR).\n * @param feeOut_ The new fee percentage for outgoing swaps.\n */\n // @custom:event Emits FeeOutChanged event.\n function setFeeOut(uint256 feeOut_) external {\n _checkAccessAllowed(\"setFeeOut(uint256)\");\n // feeOut = 10000 = 100%\n if (feeOut_ >= BASIS_POINTS_DIVISOR) {\n revert InvalidFee();\n }\n uint256 oldFeeOut = feeOut;\n feeOut = feeOut_;\n emit FeeOutChanged(oldFeeOut, feeOut_);\n }\n\n /**\n * @dev Set the maximum amount of VAI that can be minted through this contract.\n * @param vaiMintCap_ The new maximum amount of VAI that can be minted.\n */\n // @custom:event Emits VAIMintCapChanged event.\n function setVAIMintCap(uint256 vaiMintCap_) external {\n _checkAccessAllowed(\"setVAIMintCap(uint256)\");\n uint256 oldVAIMintCap = vaiMintCap;\n vaiMintCap = vaiMintCap_;\n emit VAIMintCapChanged(oldVAIMintCap, vaiMintCap_);\n }\n\n /**\n * @notice Set the address of the Venus Treasury contract.\n * @dev Reverts if the new address is zero.\n * @param venusTreasury_ The new address of the Venus Treasury contract.\n */\n // @custom:event Emits VenusTreasuryChanged event.\n function setVenusTreasury(address venusTreasury_) external {\n _checkAccessAllowed(\"setVenusTreasury(address)\");\n _ensureNonzeroAddress(venusTreasury_);\n address oldTreasuryAddress = venusTreasury;\n venusTreasury = venusTreasury_;\n emit VenusTreasuryChanged(oldTreasuryAddress, venusTreasury_);\n }\n\n /**\n * @notice Set the address of the ResilientOracle contract.\n * @dev Reverts if the new address is zero.\n * @param oracleAddress_ The new address of the ResilientOracle contract.\n */\n // @custom:event Emits OracleChanged event.\n function setOracle(address oracleAddress_) external {\n _checkAccessAllowed(\"setOracle(address)\");\n _ensureNonzeroAddress(oracleAddress_);\n address oldOracleAddress = address(oracle);\n oracle = ResilientOracleInterface(oracleAddress_);\n emit OracleChanged(oldOracleAddress, oracleAddress_);\n }\n\n /**\n * @dev Disabling renounceOwnership function.\n */\n function renounceOwnership() public override {}\n\n /*** Helper Functions ***/\n\n /**\n * @notice Calculates the amount of VAI that would be burnt from the user.\n * @dev This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.\n * @param stableTknAmount The amount of stable tokens to be received after the swap.\n * @return The amount of VAI that would be taken from the user.\n */\n function previewSwapVAIForStable(uint256 stableTknAmount) external view returns (uint256) {\n _ensureNonzeroAmount(stableTknAmount);\n uint256 stableTknAmountUSD = _previewTokenUSDAmount(stableTknAmount, FeeDirection.OUT);\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.OUT);\n\n if (vaiMinted < stableTknAmountUSD) {\n revert VAIMintedUnderflow();\n }\n\n return stableTknAmountUSD + fee;\n }\n\n /**\n * @notice Calculates the amount of VAI that would be sent to the receiver.\n * @dev This calculation might be off with a bit, if the price of the oracle for this asset is not updated in the block this function is invoked.\n * @param stableTknAmount The amount of stable tokens provided for the swap.\n * @return The amount of VAI that would be sent to the receiver.\n */\n function previewSwapStableForVAI(uint256 stableTknAmount) external view returns (uint256) {\n _ensureNonzeroAmount(stableTknAmount);\n uint256 stableTknAmountUSD = _previewTokenUSDAmount(stableTknAmount, FeeDirection.IN);\n\n //calculate feeIn\n uint256 fee = _calculateFee(stableTknAmountUSD, FeeDirection.IN);\n uint256 vaiToMint = stableTknAmountUSD - fee;\n\n if (vaiMinted + stableTknAmountUSD > vaiMintCap) {\n revert VAIMintCapReached();\n }\n\n return vaiToMint;\n }\n\n /**\n * @dev Calculates the USD value of the given amount of stable tokens depending on the swap direction.\n * @param amount The amount of stable tokens.\n * @param direction The direction of the swap.\n * @return The USD value of the given amount of stable tokens scaled by 1e18 taking into account the direction of the swap\n */\n function _previewTokenUSDAmount(uint256 amount, FeeDirection direction) internal view returns (uint256) {\n return (amount * _getPriceInUSD(direction)) / MANTISSA_ONE;\n }\n\n /**\n * @notice Get the price of stable token in USD.\n * @dev This function returns either min(1$,oraclePrice) or max(1$,oraclePrice) with a decimal scale (36 - asset_decimals). E.g. for 8 decimal token 1$ will be 1e28.\n * @param direction The direction of the swap: FeeDirection.IN or FeeDirection.OUT.\n * @return The price in USD, adjusted based on the selected direction.\n */\n function _getPriceInUSD(FeeDirection direction) internal view returns (uint256) {\n // get price with a scale = (36 - asset_decimals)\n uint256 price = oracle.getPrice(STABLE_TOKEN_ADDRESS);\n\n if (direction == FeeDirection.IN) {\n // MIN(1, price)\n return price < ONE_DOLLAR ? price : ONE_DOLLAR;\n } else {\n // MAX(1, price)\n return price > ONE_DOLLAR ? price : ONE_DOLLAR;\n }\n }\n\n /**\n * @notice Calculate the fee amount based on the input amount and fee percentage.\n * @dev Reverts if the fee percentage calculation results in rounding down to 0.\n * @param amount The input amount to calculate the fee from.\n * @param direction The direction of the fee: FeeDirection.IN or FeeDirection.OUT.\n * @return The fee amount.\n */\n function _calculateFee(uint256 amount, FeeDirection direction) internal view returns (uint256) {\n uint256 feePercent;\n if (direction == FeeDirection.IN) {\n feePercent = feeIn;\n } else {\n feePercent = feeOut;\n }\n if (feePercent == 0) {\n return 0;\n } else {\n // checking if the percent calculation will result in rounding down to 0\n if (amount * feePercent < BASIS_POINTS_DIVISOR) {\n revert AmountTooSmall();\n }\n return (amount * feePercent) / BASIS_POINTS_DIVISOR;\n }\n }\n\n /**\n * @notice Checks that the address is not the zero address.\n * @param someone The address to check.\n */\n function _ensureNonzeroAddress(address someone) private pure {\n if (someone == address(0)) revert ZeroAddress();\n }\n\n /**\n * @notice Checks that the amount passed as stable tokens is bigger than zero\n * @param amount The amount to validate\n */\n function _ensureNonzeroAmount(uint256 amount) private pure {\n if (amount == 0) revert ZeroAmount();\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "storageLayout", + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "evm.gasEstimates" + ], + "": ["ast"] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} diff --git a/hardhat.config.ts b/hardhat.config.ts index e75140586..30a078725 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -11,7 +11,6 @@ import fs from "fs"; import "hardhat-deploy"; import { HardhatUserConfig, task } from "hardhat/config"; import "solidity-docgen"; -import "solidity-docgen"; require("hardhat-contract-sizer"); require("dotenv").config(); diff --git a/networks/testnet.json b/networks/testnet.json index 2e3426853..4b4df4b60 100644 --- a/networks/testnet.json +++ b/networks/testnet.json @@ -1,6 +1,6 @@ { "Contracts": { - "VenusLens": "0x4C97B56d596d5cCc11727c0AD7d171E7F0d5134e", + "VenusLens": "0x11c8dC3DcA87E8205ec01e6d79Be9442d31701d3", "SnapshotLens": "0x61610DeC84448Ed17A2a0317667a99ca0CC6f697", "WhitepaperInterestRateModel": "0xdE9beC5102ee897a2c934321309517dD6c0106F4", "Comptroller": "0xfd301ad2503b25a7670a45b11a043c20b04ee896", diff --git a/package.json b/package.json index 9df9de00c..6c04dec88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@venusprotocol/venus-protocol", - "version": "3.0.0-dev.14", + "version": "3.0.0-dev.19", "description": "The Venus Money Market", "repository": "git@github.com:VenusProtocol/venus-protocol.git", "author": "Venus", @@ -11,6 +11,7 @@ "files": [ "artifacts", "networks", + "deploy", "dist", "contracts", "deployments" diff --git a/yarn.lock b/yarn.lock index b0a712521..cd9a3dccb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -45,12 +45,12 @@ __metadata: linkType: hard "@aws-sdk/types@npm:^3.1.0": - version: 3.369.0 - resolution: "@aws-sdk/types@npm:3.369.0" + version: 3.398.0 + resolution: "@aws-sdk/types@npm:3.398.0" dependencies: - "@smithy/types": 1.1.0 + "@smithy/types": ^2.2.2 tslib: ^2.5.0 - checksum: 41da67a3b9c1a09b641c0dcb81cdfd4bd441c8b91ec1e31fdc453314391785d6f7c48ac3629ce80258533d63cc621982b01b0985ce9dd8c25abb732b43fd8a9a + checksum: b0c3531336e3dc0a3e2524199026a2366a29a4eee07195bffd6a9d48c778924183ac9894029b1053d0f744121cec3b7d397828f2065acf37eea79d3106af1273 languageName: node linkType: hard @@ -63,19 +63,20 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.16.7, @babel/code-frame@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/code-frame@npm:7.22.5" +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.16.7, @babel/code-frame@npm:^7.22.10, @babel/code-frame@npm:^7.22.5": + version: 7.22.10 + resolution: "@babel/code-frame@npm:7.22.10" dependencies: - "@babel/highlight": ^7.22.5 - checksum: cfe804f518f53faaf9a1d3e0f9f74127ab9a004912c3a16fda07fb6a633393ecb9918a053cb71804204c1b7ec3d49e1699604715e2cfb0c9f7bc4933d324ebb6 + "@babel/highlight": ^7.22.10 + chalk: ^2.4.2 + checksum: 89a06534ad19759da6203a71bad120b1d7b2ddc016c8e07d4c56b35dea25e7396c6da60a754e8532a86733092b131ae7f661dbe6ba5d165ea777555daa2ed3c9 languageName: node linkType: hard -"@babel/compat-data@npm:^7.22.6": - version: 7.22.6 - resolution: "@babel/compat-data@npm:7.22.6" - checksum: b88631143a2ebdb75e5bac47984e950983294f1739c2133f32569c6f2fcee85f83634bb6cf4378afb44fa8eb7877d11e48811d1e6a52afa161f82276ffdc3fb4 +"@babel/compat-data@npm:^7.22.9": + version: 7.22.9 + resolution: "@babel/compat-data@npm:7.22.9" + checksum: bed77d9044ce948b4327b30dd0de0779fa9f3a7ed1f2d31638714ed00229fa71fc4d1617ae0eb1fad419338d3658d0e9a5a083297451e09e73e078d0347ff808 languageName: node linkType: hard @@ -113,30 +114,28 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.17.3, @babel/generator@npm:^7.17.7, @babel/generator@npm:^7.22.7": - version: 7.22.7 - resolution: "@babel/generator@npm:7.22.7" +"@babel/generator@npm:^7.17.3, @babel/generator@npm:^7.17.7, @babel/generator@npm:^7.22.10": + version: 7.22.10 + resolution: "@babel/generator@npm:7.22.10" dependencies: - "@babel/types": ^7.22.5 + "@babel/types": ^7.22.10 "@jridgewell/gen-mapping": ^0.3.2 "@jridgewell/trace-mapping": ^0.3.17 jsesc: ^2.5.1 - checksum: cee15558888bdf5564e19cfaf95101b2910fa425f30cc1a25ac9b8621bd62b63544eb1b36ad89c80b5e41915699219f78712cab128d1f7e3da6a21fbf4143927 + checksum: 59a79730abdff9070692834bd3af179e7a9413fa2ff7f83dff3eb888765aeaeb2bfc7b0238a49613ed56e1af05956eff303cc139f2407eda8df974813e486074 languageName: node linkType: hard "@babel/helper-compilation-targets@npm:^7.17.7": - version: 7.22.6 - resolution: "@babel/helper-compilation-targets@npm:7.22.6" + version: 7.22.10 + resolution: "@babel/helper-compilation-targets@npm:7.22.10" dependencies: - "@babel/compat-data": ^7.22.6 + "@babel/compat-data": ^7.22.9 "@babel/helper-validator-option": ^7.22.5 - "@nicolo-ribaudo/semver-v6": ^6.3.3 browserslist: ^4.21.9 lru-cache: ^5.1.1 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: c7788c48099c4f0edf2adeb367a941a930d39ed7453140ceb10d7114c4091922adf56d3cdd832050fd4501f25e872886390629042ddd365d3bce2ecad69ed394 + semver: ^6.3.1 + checksum: f6f1896816392bcff671bbe6e277307729aee53befb4a66ea126e2a91eda78d819a70d06fa384c74ef46c1595544b94dca50bef6c78438d9ffd31776dafbd435 languageName: node linkType: hard @@ -176,18 +175,17 @@ __metadata: linkType: hard "@babel/helper-module-transforms@npm:^7.17.7": - version: 7.22.5 - resolution: "@babel/helper-module-transforms@npm:7.22.5" + version: 7.22.9 + resolution: "@babel/helper-module-transforms@npm:7.22.9" dependencies: "@babel/helper-environment-visitor": ^7.22.5 "@babel/helper-module-imports": ^7.22.5 "@babel/helper-simple-access": ^7.22.5 - "@babel/helper-split-export-declaration": ^7.22.5 + "@babel/helper-split-export-declaration": ^7.22.6 "@babel/helper-validator-identifier": ^7.22.5 - "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.5 - "@babel/types": ^7.22.5 - checksum: 8985dc0d971fd17c467e8b84fe0f50f3dd8610e33b6c86e5b3ca8e8859f9448bcc5c84e08a2a14285ef388351c0484797081c8f05a03770bf44fc27bf4900e68 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 2751f77660518cf4ff027514d6f4794f04598c6393be7b04b8e46c6e21606e11c19f3f57ab6129a9c21bacdf8b3ffe3af87bb401d972f34af2d0ffde02ac3001 languageName: node linkType: hard @@ -200,7 +198,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-split-export-declaration@npm:^7.16.7, @babel/helper-split-export-declaration@npm:^7.22.5, @babel/helper-split-export-declaration@npm:^7.22.6": +"@babel/helper-split-export-declaration@npm:^7.16.7, @babel/helper-split-export-declaration@npm:^7.22.6": version: 7.22.6 resolution: "@babel/helper-split-export-declaration@npm:7.22.6" dependencies: @@ -231,24 +229,24 @@ __metadata: linkType: hard "@babel/helpers@npm:^7.17.8": - version: 7.22.6 - resolution: "@babel/helpers@npm:7.22.6" + version: 7.22.11 + resolution: "@babel/helpers@npm:7.22.11" dependencies: "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.6 - "@babel/types": ^7.22.5 - checksum: 5c1f33241fe7bf7709868c2105134a0a86dca26a0fbd508af10a89312b1f77ca38ebae43e50be3b208613c5eacca1559618af4ca236f0abc55d294800faeff30 + "@babel/traverse": ^7.22.11 + "@babel/types": ^7.22.11 + checksum: 93186544228b5e371486466ec3b86a77cce91beeff24a5670ca8ec46d50328f7700dab82d532351286e9d68624dc51d6d71589b051dd9535e44be077a43ec013 languageName: node linkType: hard -"@babel/highlight@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/highlight@npm:7.22.5" +"@babel/highlight@npm:^7.22.10": + version: 7.22.10 + resolution: "@babel/highlight@npm:7.22.10" dependencies: "@babel/helper-validator-identifier": ^7.22.5 - chalk: ^2.0.0 + chalk: ^2.4.2 js-tokens: ^4.0.0 - checksum: f61ae6de6ee0ea8d9b5bcf2a532faec5ab0a1dc0f7c640e5047fc61630a0edb88b18d8c92eb06566d30da7a27db841aca11820ecd3ebe9ce514c9350fbed39c4 + checksum: f714a1e1a72dd9d72f6383f4f30fd342e21a8df32d984a4ea8f5eab691bb6ba6db2f8823d4b4cf135d98869e7a98925b81306aa32ee3c429f8cfa52c75889e1b languageName: node linkType: hard @@ -261,12 +259,12 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.17.3, @babel/parser@npm:^7.17.8, @babel/parser@npm:^7.20.15, @babel/parser@npm:^7.21.3, @babel/parser@npm:^7.22.5, @babel/parser@npm:^7.22.7": - version: 7.22.7 - resolution: "@babel/parser@npm:7.22.7" +"@babel/parser@npm:^7.17.3, @babel/parser@npm:^7.17.8, @babel/parser@npm:^7.20.15, @babel/parser@npm:^7.21.3, @babel/parser@npm:^7.22.11, @babel/parser@npm:^7.22.5": + version: 7.22.11 + resolution: "@babel/parser@npm:7.22.11" bin: parser: ./bin/babel-parser.js - checksum: 02209ddbd445831ee8bf966fdf7c29d189ed4b14343a68eb2479d940e7e3846340d7cc6bd654a5f3d87d19dc84f49f50a58cf9363bee249dc5409ff3ba3dab54 + checksum: 332079ed09794d3685343e9fc39c6a12dcb6ea589119f2135952cdef2424296786bb609a33f6dfa9be271797bbf8339f1865118418ea50b32a0c701734c96664 languageName: node linkType: hard @@ -299,21 +297,21 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.17.3, @babel/traverse@npm:^7.22.5, @babel/traverse@npm:^7.22.6": - version: 7.22.8 - resolution: "@babel/traverse@npm:7.22.8" +"@babel/traverse@npm:^7.17.3, @babel/traverse@npm:^7.22.11": + version: 7.22.11 + resolution: "@babel/traverse@npm:7.22.11" dependencies: - "@babel/code-frame": ^7.22.5 - "@babel/generator": ^7.22.7 + "@babel/code-frame": ^7.22.10 + "@babel/generator": ^7.22.10 "@babel/helper-environment-visitor": ^7.22.5 "@babel/helper-function-name": ^7.22.5 "@babel/helper-hoist-variables": ^7.22.5 "@babel/helper-split-export-declaration": ^7.22.6 - "@babel/parser": ^7.22.7 - "@babel/types": ^7.22.5 + "@babel/parser": ^7.22.11 + "@babel/types": ^7.22.11 debug: ^4.1.0 globals: ^11.1.0 - checksum: a381369bc3eedfd13ed5fef7b884657f1c29024ea7388198149f0edc34bd69ce3966e9f40188d15f56490a5e12ba250ccc485f2882b53d41b054fccefb233e33 + checksum: 4ad62d548ca8b95dbf45bae16cc167428f174f3c837d55a5878b1f17bdbc8b384d6df741dc7c461b62c04d881cf25644d3ab885909ba46e3ac43224e2b15b504 languageName: node linkType: hard @@ -327,14 +325,14 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.17.0, @babel/types@npm:^7.22.5, @babel/types@npm:^7.8.3": - version: 7.22.5 - resolution: "@babel/types@npm:7.22.5" +"@babel/types@npm:^7.17.0, @babel/types@npm:^7.22.10, @babel/types@npm:^7.22.11, @babel/types@npm:^7.22.5, @babel/types@npm:^7.8.3": + version: 7.22.11 + resolution: "@babel/types@npm:7.22.11" dependencies: "@babel/helper-string-parser": ^7.22.5 "@babel/helper-validator-identifier": ^7.22.5 to-fast-properties: ^2.0.0 - checksum: c13a9c1dc7d2d1a241a2f8363540cb9af1d66e978e8984b400a20c4f38ba38ca29f06e26a0f2d49a70bad9e57615dac09c35accfddf1bb90d23cd3e0a0bab892 + checksum: 431a6446896adb62c876d0fe75263835735d3c974aae05356a87eb55f087c20a777028cf08eadcace7993e058bbafe3b21ce2119363222c6cef9eedd7a204810 languageName: node linkType: hard @@ -403,12 +401,12 @@ __metadata: linkType: hard "@commitlint/cli@npm:^17.0.3": - version: 17.6.6 - resolution: "@commitlint/cli@npm:17.6.6" + version: 17.7.1 + resolution: "@commitlint/cli@npm:17.7.1" dependencies: "@commitlint/format": ^17.4.4 - "@commitlint/lint": ^17.6.6 - "@commitlint/load": ^17.5.0 + "@commitlint/lint": ^17.7.0 + "@commitlint/load": ^17.7.1 "@commitlint/read": ^17.5.1 "@commitlint/types": ^17.4.4 execa: ^5.0.0 @@ -418,32 +416,32 @@ __metadata: yargs: ^17.0.0 bin: commitlint: cli.js - checksum: 91c2d06bc181cb286634d963e28c71739642a94252dcf2bcd800dd3ac1d8708d8ccd195aa513a65df00fcde281a128ed763ac51f640771a11140930c5f259df8 + checksum: 2500a50514ab0629d3661d74e6f759f0b9b56c1992fbc101bb78a67033c6ed02a6dad3ae728f91f1f9b3034ae17e3808835957f885ab7129a421085d31f6cb23 languageName: node linkType: hard "@commitlint/config-conventional@npm:^17.0.3": - version: 17.6.6 - resolution: "@commitlint/config-conventional@npm:17.6.6" + version: 17.7.0 + resolution: "@commitlint/config-conventional@npm:17.7.0" dependencies: - conventional-changelog-conventionalcommits: ^5.0.0 - checksum: 0f649a2cbe684aa18555cb0027c21f58d74216dbe0a850be041af50f1db04e447b7d90995bee54c61059d735b398de61ac7ecbfd312d14480aac3a3f8c62dd66 + conventional-changelog-conventionalcommits: ^6.1.0 + checksum: 932cf35c12855e360c750bc19ffedc0925f8658f316aaacdf5441ce775712934386643a9ac418f18e24e5bb1bf71ed721b8ae452a13d04908b0e55cd3d2d988f languageName: node linkType: hard -"@commitlint/config-validator@npm:^17.4.4": - version: 17.4.4 - resolution: "@commitlint/config-validator@npm:17.4.4" +"@commitlint/config-validator@npm:^17.6.7": + version: 17.6.7 + resolution: "@commitlint/config-validator@npm:17.6.7" dependencies: "@commitlint/types": ^17.4.4 ajv: ^8.11.0 - checksum: 71ee818608ed5c74832cdd63531c0f61b21758fba9f8b876205485ece4f047c9582bc3f323a20a5de700e3451296614d15448437270a82194eff7d71317b47ff + checksum: e13e512ce9dc788f7ce1c84faf4d2e2d4d3b7c4dc18a7982ecbfc33faa5fe977793efdb868e228061d34ea8825cbbed5fc9e8e69fd5e4f0c0c08f60e21a9214e languageName: node linkType: hard -"@commitlint/ensure@npm:^17.4.4": - version: 17.4.4 - resolution: "@commitlint/ensure@npm:17.4.4" +"@commitlint/ensure@npm:^17.6.7": + version: 17.6.7 + resolution: "@commitlint/ensure@npm:17.6.7" dependencies: "@commitlint/types": ^17.4.4 lodash.camelcase: ^4.3.0 @@ -451,7 +449,7 @@ __metadata: lodash.snakecase: ^4.1.1 lodash.startcase: ^4.4.0 lodash.upperfirst: ^4.3.1 - checksum: c21c189f22d8d3265e93256d101b72ef7cbdf8660438081799b9a4a8bd47d33133f250bbed858ab9bcc0d249d1c95ac58eddd9e5b46314d64ff049d0479d0d71 + checksum: 1ffdce807dbb303e8fa215511a965375abeea2702f64b4f1c4d7823f1e231cb343e82c97633d12d3c89b4f71d2eaf28169db08b4f1d3b052c26c942f4b9d9380 languageName: node linkType: hard @@ -472,37 +470,37 @@ __metadata: languageName: node linkType: hard -"@commitlint/is-ignored@npm:^17.6.6": - version: 17.6.6 - resolution: "@commitlint/is-ignored@npm:17.6.6" +"@commitlint/is-ignored@npm:^17.7.0": + version: 17.7.0 + resolution: "@commitlint/is-ignored@npm:17.7.0" dependencies: "@commitlint/types": ^17.4.4 - semver: 7.5.2 - checksum: ff5f8816765b3f2e9f16de32b1166dd099ab23793212bf4092203441fe3d9f282c80ed96cca5cd42b0ea96d899f8989bdaa6604a3f02bf4bd36b8c7c123968df + semver: 7.5.4 + checksum: aa0b695d6e7bee5e732f96a2ff383347ff476eb48f9d3b4ed75b098cafa27e56da15563833d3cf4e1268fc26819180cd8b5bdc322b087073a63bc94f699944b2 languageName: node linkType: hard -"@commitlint/lint@npm:^17.6.6": - version: 17.6.6 - resolution: "@commitlint/lint@npm:17.6.6" +"@commitlint/lint@npm:^17.7.0": + version: 17.7.0 + resolution: "@commitlint/lint@npm:17.7.0" dependencies: - "@commitlint/is-ignored": ^17.6.6 - "@commitlint/parse": ^17.6.5 - "@commitlint/rules": ^17.6.5 + "@commitlint/is-ignored": ^17.7.0 + "@commitlint/parse": ^17.7.0 + "@commitlint/rules": ^17.7.0 "@commitlint/types": ^17.4.4 - checksum: 8601cbfe037edd4aff38cf3929444e748499558dfb01a12f1e6067fb4496926711936cbd389cf792f5e3ea6b6900c6967ca5b56dc0555d75c71340ceddc6d076 + checksum: 72765e0f2c6b78faa1c7ceb1050ef624d505deb0f95c5ac2ce1959c3ee8c2ce579d4f5aaf9434adf244727a97653be4d7fbc0d75cda2d8915e563ebeb7b886ae languageName: node linkType: hard -"@commitlint/load@npm:^17.5.0": - version: 17.5.0 - resolution: "@commitlint/load@npm:17.5.0" +"@commitlint/load@npm:^17.7.1": + version: 17.7.1 + resolution: "@commitlint/load@npm:17.7.1" dependencies: - "@commitlint/config-validator": ^17.4.4 + "@commitlint/config-validator": ^17.6.7 "@commitlint/execute-rule": ^17.4.0 - "@commitlint/resolve-extends": ^17.4.4 + "@commitlint/resolve-extends": ^17.6.7 "@commitlint/types": ^17.4.4 - "@types/node": "*" + "@types/node": 20.4.7 chalk: ^4.1.0 cosmiconfig: ^8.0.0 cosmiconfig-typescript-loader: ^4.0.0 @@ -512,7 +510,7 @@ __metadata: resolve-from: ^5.0.0 ts-node: ^10.8.1 typescript: ^4.6.4 || ^5.0.0 - checksum: c039114b0ad67bb9d8b05ec635d847bd5ab760528f0fb203411f433585bdab5472f4f5c7856dfc417cf64c05576f54c1afc4997a813f529304e0156bfc1d6cc8 + checksum: 8d0e56b49a0e4dec7e8e28a2c6bc7ce985e6b8e10274aa20d0e3f6c2465fc9082d18f91bbe5c336594ebabcc4dc9668fdeaa039ef5bbfaf26ca0be423461ef61 languageName: node linkType: hard @@ -523,14 +521,14 @@ __metadata: languageName: node linkType: hard -"@commitlint/parse@npm:^17.6.5": - version: 17.6.5 - resolution: "@commitlint/parse@npm:17.6.5" +"@commitlint/parse@npm:^17.7.0": + version: 17.7.0 + resolution: "@commitlint/parse@npm:17.7.0" dependencies: "@commitlint/types": ^17.4.4 - conventional-changelog-angular: ^5.0.11 - conventional-commits-parser: ^3.2.2 - checksum: 579dd7b25d2b5a73817318259f4ce1191657fad8736047bcd84e2709bbe9bcb7458cbe66b6dc785e372c1c73a4563050027b94746ad0df16a89d90960a685517 + conventional-changelog-angular: ^6.0.0 + conventional-commits-parser: ^4.0.0 + checksum: d70d53932576fa30c078099fe9ab00190298ed6aec696648633ab16eb80386e0c1b407c44eb7c548b598573c260ed1bfa890dd8134166d28811f66ed436efbea languageName: node linkType: hard @@ -547,30 +545,30 @@ __metadata: languageName: node linkType: hard -"@commitlint/resolve-extends@npm:^17.4.4": - version: 17.4.4 - resolution: "@commitlint/resolve-extends@npm:17.4.4" +"@commitlint/resolve-extends@npm:^17.6.7": + version: 17.6.7 + resolution: "@commitlint/resolve-extends@npm:17.6.7" dependencies: - "@commitlint/config-validator": ^17.4.4 + "@commitlint/config-validator": ^17.6.7 "@commitlint/types": ^17.4.4 import-fresh: ^3.0.0 lodash.mergewith: ^4.6.2 resolve-from: ^5.0.0 resolve-global: ^1.0.0 - checksum: d7bf1ff1ad3db8750421b252d79cf7b96cf07d72cad8cc3f73c1363a8e68c0afde611d38ae6f213bbb54e3248160c6b9425578f3d0f8f790e84aea811d748b3e + checksum: 3717b4ccef6e46136f8d4a4b8d78d57184b4331401db07e27f89acb049a3903035bb2b0dbd4c07e3cdcc402cbe693b365c244a0da3df47e0f74cbf3ba76be9ec languageName: node linkType: hard -"@commitlint/rules@npm:^17.6.5": - version: 17.6.5 - resolution: "@commitlint/rules@npm:17.6.5" +"@commitlint/rules@npm:^17.7.0": + version: 17.7.0 + resolution: "@commitlint/rules@npm:17.7.0" dependencies: - "@commitlint/ensure": ^17.4.4 + "@commitlint/ensure": ^17.6.7 "@commitlint/message": ^17.4.2 "@commitlint/to-lines": ^17.4.0 "@commitlint/types": ^17.4.4 execa: ^5.0.0 - checksum: 7f62c594153df5daf15bf66254f8abd72f14f3f0e7bac91d0fc8229c357616a9d852b2dd050a15b3de83366a732a3363ec405d453d48b81cbaeccdd7013cb59f + checksum: bc6af55cb8fab82baac450f87e02fa51d91f44855aadced92d74d05f9af99ccfd90b08c67355b53ca6b4b45f386854bcf52e1a4e5bc003665f4873e785eb7c70 languageName: node linkType: hard @@ -642,16 +640,16 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.4.0": - version: 4.5.1 - resolution: "@eslint-community/regexpp@npm:4.5.1" - checksum: 6d901166d64998d591fab4db1c2f872981ccd5f6fe066a1ad0a93d4e11855ecae6bfb76660869a469563e8882d4307228cebd41142adb409d182f2966771e57e +"@eslint-community/regexpp@npm:^4.4.0, @eslint-community/regexpp@npm:^4.6.1": + version: 4.8.0 + resolution: "@eslint-community/regexpp@npm:4.8.0" + checksum: 601e6d033d556e98e8c929905bef335f20d7389762812df4d0f709d9b4d2631610dda975fb272e23b5b68e24a163b3851b114c8080a0a19fb4c141a1eff6305b languageName: node linkType: hard -"@eslint/eslintrc@npm:^2.1.0": - version: 2.1.0 - resolution: "@eslint/eslintrc@npm:2.1.0" +"@eslint/eslintrc@npm:^2.1.2": + version: 2.1.2 + resolution: "@eslint/eslintrc@npm:2.1.2" dependencies: ajv: ^6.12.4 debug: ^4.3.2 @@ -662,14 +660,14 @@ __metadata: js-yaml: ^4.1.0 minimatch: ^3.1.2 strip-json-comments: ^3.1.1 - checksum: d5ed0adbe23f6571d8c9bb0ca6edf7618dc6aed4046aa56df7139f65ae7b578874e0d9c796df784c25bda648ceb754b6320277d828c8b004876d7443b8dc018c + checksum: bc742a1e3b361f06fedb4afb6bf32cbd27171292ef7924f61c62f2aed73048367bcc7ac68f98c06d4245cd3fabc43270f844e3c1699936d4734b3ac5398814a7 languageName: node linkType: hard -"@eslint/js@npm:8.44.0": - version: 8.44.0 - resolution: "@eslint/js@npm:8.44.0" - checksum: fc539583226a28f5677356e9f00d2789c34253f076643d2e32888250e509a4e13aafe0880cb2425139051de0f3a48d25bfc5afa96b7304f203b706c17340e3cf +"@eslint/js@npm:8.48.0": + version: 8.48.0 + resolution: "@eslint/js@npm:8.48.0" + checksum: b2755f9c0ee810c886eba3c50dcacb184ba5a5cd1cbc01988ee506ad7340653cae0bd55f1d95c64b56dfc6d25c2caa7825335ffd2c50165bae9996fe0f396851 languageName: node linkType: hard @@ -730,6 +728,15 @@ __metadata: languageName: node linkType: hard +"@ethereumjs/rlp@npm:^4.0.1": + version: 4.0.1 + resolution: "@ethereumjs/rlp@npm:4.0.1" + bin: + rlp: bin/rlp + checksum: 30db19c78faa2b6ff27275ab767646929207bb207f903f09eb3e4c273ce2738b45f3c82169ddacd67468b4f063d8d96035f2bf36f02b6b7e4d928eefe2e3ecbc + languageName: node + linkType: hard + "@ethereumjs/tx@npm:3.3.2": version: 3.3.2 resolution: "@ethereumjs/tx@npm:3.3.2" @@ -750,6 +757,17 @@ __metadata: languageName: node linkType: hard +"@ethereumjs/util@npm:^8.1.0": + version: 8.1.0 + resolution: "@ethereumjs/util@npm:8.1.0" + dependencies: + "@ethereumjs/rlp": ^4.0.1 + ethereum-cryptography: ^2.0.0 + micro-ftch: ^0.3.1 + checksum: 9ae5dee8f12b0faf81cd83f06a41560e79b0ba96a48262771d897a510ecae605eb6d84f687da001ab8ccffd50f612ae50f988ef76e6312c752897f462f3ac08d + languageName: node + linkType: hard + "@ethersproject/abi@npm:5.7.0, @ethersproject/abi@npm:^5.0.0-beta.146, @ethersproject/abi@npm:^5.1.2, @ethersproject/abi@npm:^5.6.3, @ethersproject/abi@npm:^5.6.4, @ethersproject/abi@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/abi@npm:5.7.0" @@ -1216,14 +1234,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/resolve-uri@npm:3.1.0": - version: 3.1.0 - resolution: "@jridgewell/resolve-uri@npm:3.1.0" - checksum: b5ceaaf9a110fcb2780d1d8f8d4a0bfd216702f31c988d8042e5f8fbe353c55d9b0f55a1733afdc64806f8e79c485d2464680ac48a0d9fcadb9548ee6b81d267 - languageName: node - linkType: hard - -"@jridgewell/resolve-uri@npm:^3.0.3": +"@jridgewell/resolve-uri@npm:^3.0.3, @jridgewell/resolve-uri@npm:^3.1.0": version: 3.1.1 resolution: "@jridgewell/resolve-uri@npm:3.1.1" checksum: f5b441fe7900eab4f9155b3b93f9800a916257f4e8563afbcd3b5a5337b55e52bd8ae6735453b1b745457d9f6cdb16d74cd6220bbdd98cf153239e13f6cbb653 @@ -1237,14 +1248,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:1.4.14": - version: 1.4.14 - resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" - checksum: 61100637b6d173d3ba786a5dff019e1a74b1f394f323c1fee337ff390239f053b87266c7a948777f4b1ee68c01a8ad0ab61e5ff4abb5a012a0b091bec391ab97 - languageName: node - linkType: hard - -"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.15": +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15": version: 1.4.15 resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 @@ -1262,12 +1266,12 @@ __metadata: linkType: hard "@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.9": - version: 0.3.18 - resolution: "@jridgewell/trace-mapping@npm:0.3.18" + version: 0.3.19 + resolution: "@jridgewell/trace-mapping@npm:0.3.19" dependencies: - "@jridgewell/resolve-uri": 3.1.0 - "@jridgewell/sourcemap-codec": 1.4.14 - checksum: 0572669f855260808c16fe8f78f5f1b4356463b11d3f2c7c0b5580c8ba1cbf4ae53efe9f627595830856e57dbac2325ac17eb0c3dd0ec42102e6f227cc289c02 + "@jridgewell/resolve-uri": ^3.1.0 + "@jridgewell/sourcemap-codec": ^1.4.14 + checksum: 956a6f0f6fec060fb48c6bf1f5ec2064e13cd38c8be3873877d4b92b4a27ba58289a34071752671262a3e3c202abcc3fa2aac64d8447b4b0fa1ba3c9047f1c20 languageName: node linkType: hard @@ -1284,12 +1288,12 @@ __metadata: languageName: node linkType: hard -"@nicolo-ribaudo/semver-v6@npm:^6.3.3": - version: 6.3.3 - resolution: "@nicolo-ribaudo/semver-v6@npm:6.3.3" - bin: - semver: bin/semver.js - checksum: 8290855b1591477d2298364541fda64fafd4acc110b387067a71c9b05f4105c0a4ac079857ae9cd107c42ee884e8724a406b5116f069575e02d7ab87a35a5272 +"@noble/curves@npm:1.1.0, @noble/curves@npm:~1.1.0": + version: 1.1.0 + resolution: "@noble/curves@npm:1.1.0" + dependencies: + "@noble/hashes": 1.3.1 + checksum: 2658cdd3f84f71079b4e3516c47559d22cf4b55c23ac8ee9d2b1f8e5b72916d9689e59820e0f9d9cb4a46a8423af5b56dc6bb7782405c88be06a015180508db5 languageName: node linkType: hard @@ -1300,6 +1304,20 @@ __metadata: languageName: node linkType: hard +"@noble/hashes@npm:1.3.1": + version: 1.3.1 + resolution: "@noble/hashes@npm:1.3.1" + checksum: 7fdefc0f7a0c1ec27acc6ff88841793e3f93ec4ce6b8a6a12bfc0dd70ae6b7c4c82fe305fdfeda1735d5ad4a9eebe761e6693b3d355689c559e91242f4bc95b1 + languageName: node + linkType: hard + +"@noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.1": + version: 1.3.2 + resolution: "@noble/hashes@npm:1.3.2" + checksum: fe23536b436539d13f90e4b9be843cc63b1b17666a07634a2b1259dded6f490be3d050249e6af98076ea8f2ea0d56f578773c2197f2aa0eeaa5fba5bc18ba474 + languageName: node + linkType: hard + "@noble/secp256k1@npm:1.7.1, @noble/secp256k1@npm:~1.7.0": version: 1.7.1 resolution: "@noble/secp256k1@npm:1.7.1" @@ -2179,9 +2197,9 @@ __metadata: linkType: hard "@openzeppelin/contracts-upgradeable@npm:^4.6.0, @openzeppelin/contracts-upgradeable@npm:^4.7.3, @openzeppelin/contracts-upgradeable@npm:^4.8.0": - version: 4.9.2 - resolution: "@openzeppelin/contracts-upgradeable@npm:4.9.2" - checksum: 88df083e886006b9fac61848edf224a725b99e1b8a302173165a857e3bbc1d00d61cb9c71590b37d955b179fe23652fc157347a086dbaad8f66ce8470603f151 + version: 4.9.3 + resolution: "@openzeppelin/contracts-upgradeable@npm:4.9.3" + checksum: bda0240b1d44c913ec5a4e109c622f216c2bbd7b468d210822f75782a5f7fe0609d08bf03b78b253333625e99e507cf2f75212f1de3b274bd9fc64ae967aeec3 languageName: node linkType: hard @@ -2193,22 +2211,22 @@ __metadata: linkType: hard "@openzeppelin/contracts@npm:^4.3.3, @openzeppelin/contracts@npm:^4.6.0, @openzeppelin/contracts@npm:^4.8.3": - version: 4.9.2 - resolution: "@openzeppelin/contracts@npm:4.9.2" - checksum: 0538b18fe222e5414a5a539c240b155e0bef2a23c5182fb8e137d71a0c390fe899160f2d55701f75b127f54cc61aee4375370acc832475f19829368ac65c1fc6 + version: 4.9.3 + resolution: "@openzeppelin/contracts@npm:4.9.3" + checksum: 4932063e733b35fa7669b9fe2053f69b062366c5c208b0c6cfa1ac451712100c78acff98120c3a4b88d94154c802be05d160d71f37e7d74cadbe150964458838 languageName: node linkType: hard "@openzeppelin/defender-base-client@npm:^1.46.0": - version: 1.46.0 - resolution: "@openzeppelin/defender-base-client@npm:1.46.0" + version: 1.48.0 + resolution: "@openzeppelin/defender-base-client@npm:1.48.0" dependencies: amazon-cognito-identity-js: ^6.0.1 async-retry: ^1.3.3 - axios: ^0.21.2 + axios: ^1.4.0 lodash: ^4.17.19 node-fetch: ^2.6.0 - checksum: 3d9284913989429432be0b769df693909ea2df648d9d0a5a0f6ce1ed70b042c74a2bcabfc266efecad4e3ed74b08a9a78d87c338bfcdd739cc00cd2e432486ac + checksum: 7391ac924b48d0ec38853f2d85aef837edbe7b8caf7afb32e6914e2a68ec40a0377bdd0cd60b52d35edaf6b4d7d57ebd4d34805adb410a9d5051f71d2c329455 languageName: node linkType: hard @@ -2250,20 +2268,20 @@ __metadata: linkType: hard "@openzeppelin/upgrades-core@npm:^1.27.0": - version: 1.27.2 - resolution: "@openzeppelin/upgrades-core@npm:1.27.2" + version: 1.28.0 + resolution: "@openzeppelin/upgrades-core@npm:1.28.0" dependencies: - cbor: ^8.0.0 + cbor: ^9.0.0 chalk: ^4.1.0 compare-versions: ^6.0.0 debug: ^4.1.1 ethereumjs-util: ^7.0.3 minimist: ^1.2.7 proper-lockfile: ^4.1.1 - solidity-ast: ^0.4.15 + solidity-ast: ^0.4.26 bin: openzeppelin-upgrades-core: dist/cli/cli.js - checksum: e3fc342bb4d1042c3fff33814d08125d88dd0ac1791ae94530a09d8f2a91cf44c6a1350345bb7c887dcd91ed67a5fca748448e1932273502d53a89b3dff36ea2 + checksum: 9da2e057bc16375a5eab7e65a4b13f478ab964e7f96b3d5480f798b241bb8a3590e16339fe23cde08d5ffdb01964be6a829f50a9baee85783f18cb5fb8a41421 languageName: node linkType: hard @@ -2302,9 +2320,9 @@ __metadata: linkType: hard "@scure/base@npm:~1.1.0": - version: 1.1.1 - resolution: "@scure/base@npm:1.1.1" - checksum: b4fc810b492693e7e8d0107313ac74c3646970c198bbe26d7332820886fa4f09441991023ec9aa3a2a51246b74409ab5ebae2e8ef148bbc253da79ac49130309 + version: 1.1.2 + resolution: "@scure/base@npm:1.1.2" + checksum: f666b09dbd62ecb5fe6d0e7a629c8a86a972a47dc4f4555ebbbd7b09782b10a5f894fed9c3b8c74fd683b1588c064df079a44e9f695c075ccd98c30a8d3e91f7 languageName: node linkType: hard @@ -2319,6 +2337,17 @@ __metadata: languageName: node linkType: hard +"@scure/bip32@npm:1.3.1": + version: 1.3.1 + resolution: "@scure/bip32@npm:1.3.1" + dependencies: + "@noble/curves": ~1.1.0 + "@noble/hashes": ~1.3.1 + "@scure/base": ~1.1.0 + checksum: 394d65f77a40651eba21a5096da0f4233c3b50d422864751d373fcf142eeedb94a1149f9ab1dbb078086dab2d0bc27e2b1afec8321bf22d4403c7df2fea5bfe2 + languageName: node + linkType: hard + "@scure/bip39@npm:1.1.1": version: 1.1.1 resolution: "@scure/bip39@npm:1.1.1" @@ -2329,6 +2358,16 @@ __metadata: languageName: node linkType: hard +"@scure/bip39@npm:1.2.1": + version: 1.2.1 + resolution: "@scure/bip39@npm:1.2.1" + dependencies: + "@noble/hashes": ~1.3.0 + "@scure/base": ~1.1.0 + checksum: c5bd6f1328fdbeae2dcdd891825b1610225310e5e62a4942714db51066866e4f7bef242c7b06a1b9dcc8043a4a13412cf5c5df76d3b10aa9e36b82e9b6e3eeaa + languageName: node + linkType: hard + "@semantic-release/changelog@npm:^6.0.1": version: 6.0.3 resolution: "@semantic-release/changelog@npm:6.0.3" @@ -2551,12 +2590,12 @@ __metadata: languageName: node linkType: hard -"@smithy/types@npm:1.1.0": - version: 1.1.0 - resolution: "@smithy/types@npm:1.1.0" +"@smithy/types@npm:^2.2.2": + version: 2.2.2 + resolution: "@smithy/types@npm:2.2.2" dependencies: tslib: ^2.5.0 - checksum: 8c0589fa973e5c71cf776c28c43aba04ee07139578fd0174aac0d74c3688e3ffa7075cecd65b223b2a155ad711808b1e4ad58a084ba9f24fcb49679272018387 + checksum: 2799a14620da60efb2a0aba1bf9adc553a5446dc447b9ee1d7a95410233a70dff2b5e563fecf84388137dabbe662c6bf3a2247ca20a1f266c1256f82e0f25fcf languageName: node linkType: hard @@ -2579,11 +2618,11 @@ __metadata: linkType: hard "@solidity-parser/parser@npm:^0.16.0": - version: 0.16.0 - resolution: "@solidity-parser/parser@npm:0.16.0" + version: 0.16.1 + resolution: "@solidity-parser/parser@npm:0.16.1" dependencies: antlr4ts: ^0.5.0-alpha.4 - checksum: 6ccbdab334331a58fde2a739cff76d5a99d836186b7899e8e027266f2af2a4bddc77c9c2abd01307cea6c470345d48edc470049e9672143b73f4aff3c8976183 + checksum: d9e2f7042434fb850a97a2c3679f5fbf4997c7845278d0a436b3de30169e6758fe3818191694ece36dc39a40f55ae0384c4ae0ae912790b5b0806728a50466c2 languageName: node linkType: hard @@ -2647,13 +2686,13 @@ __metadata: linkType: hard "@truffle/interface-adapter@npm:^0.5.25": - version: 0.5.34 - resolution: "@truffle/interface-adapter@npm:0.5.34" + version: 0.5.35 + resolution: "@truffle/interface-adapter@npm:0.5.35" dependencies: bn.js: ^5.1.3 ethers: ^4.0.32 web3: 1.10.0 - checksum: cc68f288c796086bffcbe7cb21d2c6d6d0ea38f763d9120e6d3b0dea73129f0ab8504da935104f9be0504da0d825fa21c96d82c539efbdb45ad070c0601dcf83 + checksum: 9b58701d48b91178ab0ceff6970ba6cc109c08782e553a65ebfb30b29406f4363344576d0696f3e83e508110c78c34caf27ef6708817c334899c98c1f8369a07 languageName: node linkType: hard @@ -2862,9 +2901,16 @@ __metadata: linkType: hard "@types/node@npm:*": - version: 20.4.1 - resolution: "@types/node@npm:20.4.1" - checksum: 22cbcc792f2eb636fe4188778ed0f32658ab872aa7fcb9847b3fa289a42b14b9f5e30c6faec50ef3c7adbc6c2a246926e5858136bb8b10c035a3fcaa6afbeed2 + version: 20.5.7 + resolution: "@types/node@npm:20.5.7" + checksum: fc284c8e16ddc04569730d58e87eae349eb1c3dd9020cb79a1862d9d9add6f04e7367a236f3252db8db2572f90278e250f4cd43d27d264972b54394eaba1ed76 + languageName: node + linkType: hard + +"@types/node@npm:20.4.7": + version: 20.4.7 + resolution: "@types/node@npm:20.4.7" + checksum: a40d7003f66b56220a2028179e49f950b46fa6dbf860a4a6ecbd6ba7976f05b2f0b31ced39689ec88a7d9e32d07e088c6a06d270b99d5bc13a28291ac2f30ca7 languageName: node linkType: hard @@ -2883,9 +2929,9 @@ __metadata: linkType: hard "@types/node@npm:^18.7.1": - version: 18.16.19 - resolution: "@types/node@npm:18.16.19" - checksum: 63c31f09616508aa7135380a4c79470a897b75f9ff3a70eb069e534dfabdec3f32fb0f9df5939127f1086614d980ddea0fa5e8cc29a49103c4f74cd687618aaf + version: 18.17.12 + resolution: "@types/node@npm:18.17.12" + checksum: 79f8bcca3067a3c529f30e172df8d14f25ab9e4cd6a05ed897a924ab1dec774e8ea172ef5c4a67ffec433d423a0c81778f17db22606d574bc83871b60aab298e languageName: node linkType: hard @@ -3273,7 +3319,7 @@ __metadata: languageName: node linkType: hard -"JSONStream@npm:^1.0.4": +"JSONStream@npm:^1.0.4, JSONStream@npm:^1.3.5": version: 1.3.5 resolution: "JSONStream@npm:1.3.5" dependencies: @@ -3299,15 +3345,6 @@ __metadata: languageName: node linkType: hard -"abort-controller@npm:^3.0.0": - version: 3.0.0 - resolution: "abort-controller@npm:3.0.0" - dependencies: - event-target-shim: ^5.0.0 - checksum: 170bdba9b47b7e65906a28c8ce4f38a7a369d78e2271706f020849c1bfe0ee2067d4261df8bbb66eb84f79208fd5b710df759d64191db58cfba7ce8ef9c54b75 - languageName: node - linkType: hard - "abortcontroller-polyfill@npm:^1.7.3": version: 1.7.5 resolution: "abortcontroller-polyfill@npm:1.7.5" @@ -3405,13 +3442,11 @@ __metadata: linkType: hard "agentkeepalive@npm:^4.2.1": - version: 4.3.0 - resolution: "agentkeepalive@npm:4.3.0" + version: 4.5.0 + resolution: "agentkeepalive@npm:4.5.0" dependencies: - debug: ^4.1.0 - depd: ^2.0.0 humanize-ms: ^1.2.1 - checksum: 982453aa44c11a06826c836025e5162c846e1200adb56f2d075400da7d32d87021b3b0a58768d949d824811f5654223d5a8a3dad120921a2439625eb847c6260 + checksum: 13278cd5b125e51eddd5079f04d6fe0914ac1b8b91c1f3db2c1822f99ac1a7457869068997784342fe455d59daaff22e14fb7b8c3da4e741896e7e31faf92481 languageName: node linkType: hard @@ -3425,7 +3460,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.10.0, ajv@npm:^6.12.3, ajv@npm:^6.12.4, ajv@npm:^6.12.6": +"ajv@npm:^6.12.3, ajv@npm:^6.12.4, ajv@npm:^6.12.6": version: 6.12.6 resolution: "ajv@npm:6.12.6" dependencies: @@ -3450,15 +3485,15 @@ __metadata: linkType: hard "amazon-cognito-identity-js@npm:^6.0.1": - version: 6.3.1 - resolution: "amazon-cognito-identity-js@npm:6.3.1" + version: 6.3.5 + resolution: "amazon-cognito-identity-js@npm:6.3.5" dependencies: "@aws-crypto/sha256-js": 1.2.2 buffer: 4.9.2 fast-base64-decode: ^1.0.0 isomorphic-unfetch: ^3.0.0 js-cookie: ^2.2.1 - checksum: a38d1c809417d2894613a2fba896434cad3514ed2a16ec6be8084b14788440a4829b50c0dd0ecae3c878ff76bcd1f8df1a862b545eeeb0ca219c6e28cdf598fc + checksum: d1c2030d482004a82d58e3977e418da268ea34a3418e136dece50714d719ac6b62b0f19214f41b5660797e01e730b0fb2fa7f8cf3c21bc5710da11b89e0f8851 languageName: node linkType: hard @@ -3700,6 +3735,19 @@ __metadata: languageName: node linkType: hard +"array.prototype.findlast@npm:^1.2.2": + version: 1.2.2 + resolution: "array.prototype.findlast@npm:1.2.2" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + es-shim-unscopables: ^1.0.0 + get-intrinsic: ^1.1.3 + checksum: 4be14199176d26f48a5dec87c2e0545acf829f7557357238679acf2b7ae6fa5bf7dde7e9dfe9ce2ccc9e8691a9c99adc623bbe312ba476a5935497f3d7c5cd29 + languageName: node + linkType: hard + "array.prototype.reduce@npm:^1.0.5": version: 1.0.5 resolution: "array.prototype.reduce@npm:1.0.5" @@ -3713,6 +3761,20 @@ __metadata: languageName: node linkType: hard +"arraybuffer.prototype.slice@npm:^1.0.1": + version: 1.0.1 + resolution: "arraybuffer.prototype.slice@npm:1.0.1" + dependencies: + array-buffer-byte-length: ^1.0.0 + call-bind: ^1.0.2 + define-properties: ^1.2.0 + get-intrinsic: ^1.2.1 + is-array-buffer: ^3.0.2 + is-shared-array-buffer: ^1.0.2 + checksum: e3e9b2a3e988ebfeddce4c7e8f69df730c9e48cb04b0d40ff0874ce3d86b3d1339dd520ffde5e39c02610bc172ecfbd4bc93324b1cabd9554c44a56b131ce0ce + languageName: node + linkType: hard + "arrify@npm:^1.0.1": version: 1.0.1 resolution: "arrify@npm:1.0.1" @@ -3861,6 +3923,17 @@ __metadata: languageName: node linkType: hard +"axios@npm:^1.4.0": + version: 1.5.0 + resolution: "axios@npm:1.5.0" + dependencies: + follow-redirects: ^1.15.0 + form-data: ^4.0.0 + proxy-from-env: ^1.1.0 + checksum: e7405a5dbbea97760d0e6cd58fecba311b0401ddb4a8efbc4108f5537da9b3f278bde566deb777935a960beec4fa18e7b8353881f2f465e4f2c0e949fead35be + languageName: node + linkType: hard + "balanced-match@npm:^1.0.0": version: 1.0.2 resolution: "balanced-match@npm:1.0.2" @@ -3915,9 +3988,9 @@ __metadata: linkType: hard "bignumber.js@npm:^9.0.0": - version: 9.1.1 - resolution: "bignumber.js@npm:9.1.1" - checksum: ad243b7e2f9120b112d670bb3d674128f0bd2ca1745b0a6c9df0433bd2c0252c43e6315d944c2ac07b4c639e7496b425e46842773cf89c6a2dcd4f31e5c4b11e + version: 9.1.2 + resolution: "bignumber.js@npm:9.1.2" + checksum: 582c03af77ec9cb0ebd682a373ee6c66475db94a4325f92299621d544aa4bd45cb45fd60001610e94aef8ae98a0905fa538241d9638d4422d57abbeeac6fadaf languageName: node linkType: hard @@ -4143,16 +4216,16 @@ __metadata: linkType: hard "browserslist@npm:^4.21.9": - version: 4.21.9 - resolution: "browserslist@npm:4.21.9" + version: 4.21.10 + resolution: "browserslist@npm:4.21.10" dependencies: - caniuse-lite: ^1.0.30001503 - electron-to-chromium: ^1.4.431 - node-releases: ^2.0.12 + caniuse-lite: ^1.0.30001517 + electron-to-chromium: ^1.4.477 + node-releases: ^2.0.13 update-browserslist-db: ^1.0.11 bin: browserslist: cli.js - checksum: 80d3820584e211484ad1b1a5cfdeca1dd00442f47be87e117e1dda34b628c87e18b81ae7986fa5977b3e6a03154f6d13cd763baa6b8bf5dd9dd19f4926603698 + checksum: 1e27c0f111a35d1dd0e8fc2c61781b0daefabc2c9471b0b10537ce54843014bceb2a1ce4571af1a82b2bf1e6e6e05d38865916689a158f03bc2c7a4ec2577db8 languageName: node linkType: hard @@ -4297,14 +4370,14 @@ __metadata: linkType: hard "cacache@npm:^17.0.0": - version: 17.1.3 - resolution: "cacache@npm:17.1.3" + version: 17.1.4 + resolution: "cacache@npm:17.1.4" dependencies: "@npmcli/fs": ^3.1.0 fs-minipass: ^3.0.0 glob: ^10.2.2 lru-cache: ^7.7.1 - minipass: ^5.0.0 + minipass: ^7.0.3 minipass-collect: ^1.0.2 minipass-flush: ^1.0.5 minipass-pipeline: ^1.2.4 @@ -4312,7 +4385,7 @@ __metadata: ssri: ^10.0.0 tar: ^6.1.11 unique-filename: ^3.0.0 - checksum: 385756781e1e21af089160d89d7462b7ed9883c978e848c7075b90b73cb823680e66092d61513050164588387d2ca87dd6d910e28d64bc13a9ac82cd8580c796 + checksum: b7751df756656954a51201335addced8f63fc53266fa56392c9f5ae83c8d27debffb4458ac2d168a744a4517ec3f2163af05c20097f93d17bdc2dc8a385e14a6 languageName: node linkType: hard @@ -4402,10 +4475,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001503": - version: 1.0.30001515 - resolution: "caniuse-lite@npm:1.0.30001515" - checksum: ec5d51785aea6af5cf62ca9d35821d36ab7fa0f85e3e7f752d532025ad59e07131fa3cb3a0a6c486b5ac8620c8c3440e761dc5b38c990d49c17655906f216123 +"caniuse-lite@npm:^1.0.30001517": + version: 1.0.30001524 + resolution: "caniuse-lite@npm:1.0.30001524" + checksum: 35d662a62f5e6be3c2d2141f1f30b3428ec72c5756cbd9fc723e33606846f28a515fd30f1e8b56e506c63fe0755f6eb7e3548dc6eefd53c5591b1a3bd28fee98 languageName: node linkType: hard @@ -4442,7 +4515,7 @@ __metadata: languageName: node linkType: hard -"cbor@npm:^8.0.0, cbor@npm:^8.1.0": +"cbor@npm:^8.1.0": version: 8.1.0 resolution: "cbor@npm:8.1.0" dependencies: @@ -4451,6 +4524,15 @@ __metadata: languageName: node linkType: hard +"cbor@npm:^9.0.0": + version: 9.0.1 + resolution: "cbor@npm:9.0.1" + dependencies: + nofilter: ^3.1.0 + checksum: 42333ac3d42cc3f6fcc7a529e68417a2dd8099eda43ca4be1304cdc5bc7494efe058e2db8a3d3b46ae60d69c7331ea813c22dbd019c4ac592d23e599d72bbcc9 + languageName: node + linkType: hard + "chai-as-promised@npm:^7.1.1": version: 7.1.1 resolution: "chai-as-promised@npm:7.1.1" @@ -4463,8 +4545,8 @@ __metadata: linkType: hard "chai@npm:^4.3.4, chai@npm:^4.3.6": - version: 4.3.7 - resolution: "chai@npm:4.3.7" + version: 4.3.8 + resolution: "chai@npm:4.3.8" dependencies: assertion-error: ^1.1.0 check-error: ^1.0.2 @@ -4473,11 +4555,11 @@ __metadata: loupe: ^2.3.1 pathval: ^1.1.1 type-detect: ^4.0.5 - checksum: 0bba7d267848015246a66995f044ce3f0ebc35e530da3cbdf171db744e14cbe301ab913a8d07caf7952b430257ccbb1a4a983c570a7c5748dc537897e5131f7c + checksum: 29e0984ed13308319cadc35437c8ef0a3e271544d226c991bf7e3b6d771bf89707321669e11d05e362bc0ad0bd26585079b989d1032f3c106e3bb95d7f079cce languageName: node linkType: hard -"chalk@npm:^2.0.0, chalk@npm:^2.3.2, chalk@npm:^2.4.2": +"chalk@npm:^2.3.2, chalk@npm:^2.4.2": version: 2.4.2 resolution: "chalk@npm:2.4.2" dependencies: @@ -4863,9 +4945,9 @@ __metadata: linkType: hard "compare-versions@npm:^6.0.0": - version: 6.0.0 - resolution: "compare-versions@npm:6.0.0" - checksum: bf2fa355b2139cbdb0576f2f0328c112dd3c2eb808eff8b70b808b3ed05f8a40b8317c323ff4797a6a5a7ab32d508876749584c626ee5840dc0119361afffc4d + version: 6.1.0 + resolution: "compare-versions@npm:6.1.0" + checksum: d4e2a45706a023d8d0b6680338b66b79e20bd02d1947f0ac6531dab634cbed89fa373b3f03d503c5e489761194258d6e1bae67a07f88b1efc61648454f2d47e7 languageName: node linkType: hard @@ -4932,7 +5014,7 @@ __metadata: languageName: node linkType: hard -"conventional-changelog-angular@npm:^5.0.0, conventional-changelog-angular@npm:^5.0.11": +"conventional-changelog-angular@npm:^5.0.0": version: 5.0.13 resolution: "conventional-changelog-angular@npm:5.0.13" dependencies: @@ -4942,14 +5024,21 @@ __metadata: languageName: node linkType: hard -"conventional-changelog-conventionalcommits@npm:^5.0.0": - version: 5.0.0 - resolution: "conventional-changelog-conventionalcommits@npm:5.0.0" +"conventional-changelog-angular@npm:^6.0.0": + version: 6.0.0 + resolution: "conventional-changelog-angular@npm:6.0.0" dependencies: compare-func: ^2.0.0 - lodash: ^4.17.15 - q: ^1.5.1 - checksum: b67d12e4e0fdde5baa32c3d77af472de38646a18657b26f5543eecce041a318103092fbfcef247e2319a16957c9ac78c6ea78acc11a5db6acf74be79a28c561f + checksum: ddc59ead53a45b817d83208200967f5340866782b8362d5e2e34105fdfa3d3a31585ebbdec7750bdb9de53da869f847e8ca96634a9801f51e27ecf4e7ffe2bad + languageName: node + linkType: hard + +"conventional-changelog-conventionalcommits@npm:^6.1.0": + version: 6.1.0 + resolution: "conventional-changelog-conventionalcommits@npm:6.1.0" + dependencies: + compare-func: ^2.0.0 + checksum: 4383a35cdf72f5964e194a1146e7f78276e301f73bd993b71627bb93586b6470d411b9613507ceb37e0fed0b023199c95e941541fa47172b4e6a7916fc3a53ff languageName: node linkType: hard @@ -4982,7 +5071,7 @@ __metadata: languageName: node linkType: hard -"conventional-commits-parser@npm:^3.2.2, conventional-commits-parser@npm:^3.2.3": +"conventional-commits-parser@npm:^3.2.3": version: 3.2.4 resolution: "conventional-commits-parser@npm:3.2.4" dependencies: @@ -4998,6 +5087,20 @@ __metadata: languageName: node linkType: hard +"conventional-commits-parser@npm:^4.0.0": + version: 4.0.0 + resolution: "conventional-commits-parser@npm:4.0.0" + dependencies: + JSONStream: ^1.3.5 + is-text-path: ^1.0.1 + meow: ^8.1.2 + split2: ^3.2.2 + bin: + conventional-commits-parser: cli.js + checksum: 12d95b5ba8e0710a6d3cd2e01f01dd7818fdf0bb2b33f4b75444e2c9aee49598776b0706a528ed49e83aec5f1896c32cbc7f8e6589f61a15187293707448f928 + languageName: node + linkType: hard + "convert-source-map@npm:^1.7.0": version: 1.9.0 resolution: "convert-source-map@npm:1.9.0" @@ -5058,14 +5161,14 @@ __metadata: linkType: hard "cosmiconfig-typescript-loader@npm:^4.0.0": - version: 4.3.0 - resolution: "cosmiconfig-typescript-loader@npm:4.3.0" + version: 4.4.0 + resolution: "cosmiconfig-typescript-loader@npm:4.4.0" peerDependencies: "@types/node": "*" cosmiconfig: ">=7" ts-node: ">=10" - typescript: ">=3" - checksum: ea61dfd8e112cf2bb18df0ef89280bd3ae3dd5b997b4a9fc22bbabdc02513aadfbc6d4e15e922b6a9a5d987e9dad42286fa38caf77a9b8dcdbe7d4ce1c9db4fb + typescript: ">=4" + checksum: d6ba546de333f9440226ab2384a7b5355d8d2e278a9ca9d838664181bc27719764af10c69eec6f07189e63121e6d654235c374bd7dc455ac8dfdef3aad6657fd languageName: node linkType: hard @@ -5421,7 +5524,7 @@ __metadata: languageName: node linkType: hard -"depd@npm:2.0.0, depd@npm:^2.0.0": +"depd@npm:2.0.0": version: 2.0.0 resolution: "depd@npm:2.0.0" checksum: abbe19c768c97ee2eed6282d8ce3031126662252c58d711f646921c9623f9052e3e1906443066beec1095832f534e57c523b7333f8e7e0d93051ab6baef5ab3a @@ -5595,10 +5698,10 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.4.431": - version: 1.4.455 - resolution: "electron-to-chromium@npm:1.4.455" - checksum: 404901e75cd98dd9adf1ad30d25b17a529d8c26b0f3a30d523632546f98bc0fa58367ae75c7f7f1b0b94c1f6e1e43de6659ec026db861d55534e947897558ae4 +"electron-to-chromium@npm:^1.4.477": + version: 1.4.503 + resolution: "electron-to-chromium@npm:1.4.503" + checksum: 77198f5d4365931fb6f18670f1cc2bc6833516dfe935e69209da45ba06fd9e3bb02678216ab8c1cf7b047655559b7d591d922d9a781a1f91c7f5a32d5f51f778 languageName: node linkType: hard @@ -5671,11 +5774,12 @@ __metadata: linkType: hard "enquirer@npm:^2.3.0, enquirer@npm:^2.3.6": - version: 2.3.6 - resolution: "enquirer@npm:2.3.6" + version: 2.4.1 + resolution: "enquirer@npm:2.4.1" dependencies: ansi-colors: ^4.1.1 - checksum: 1c0911e14a6f8d26721c91e01db06092a5f7675159f0261d69c403396a385afd13dd76825e7678f66daffa930cfaa8d45f506fb35f818a2788463d022af1b884 + strip-ansi: ^6.0.1 + checksum: f080f11a74209647dbf347a7c6a83c8a47ae1ebf1e75073a808bc1088eb780aa54075bfecd1bcdb3e3c724520edb8e6ee05da031529436b421b71066fcc48cb5 languageName: node linkType: hard @@ -5714,16 +5818,17 @@ __metadata: linkType: hard "es-abstract@npm:^1.19.0, es-abstract@npm:^1.20.4, es-abstract@npm:^1.21.2": - version: 1.21.2 - resolution: "es-abstract@npm:1.21.2" + version: 1.22.1 + resolution: "es-abstract@npm:1.22.1" dependencies: array-buffer-byte-length: ^1.0.0 + arraybuffer.prototype.slice: ^1.0.1 available-typed-arrays: ^1.0.5 call-bind: ^1.0.2 es-set-tostringtag: ^2.0.1 es-to-primitive: ^1.2.1 function.prototype.name: ^1.1.5 - get-intrinsic: ^1.2.0 + get-intrinsic: ^1.2.1 get-symbol-description: ^1.0.0 globalthis: ^1.0.3 gopd: ^1.0.1 @@ -5743,15 +5848,19 @@ __metadata: object-inspect: ^1.12.3 object-keys: ^1.1.1 object.assign: ^4.1.4 - regexp.prototype.flags: ^1.4.3 + regexp.prototype.flags: ^1.5.0 + safe-array-concat: ^1.0.0 safe-regex-test: ^1.0.0 string.prototype.trim: ^1.2.7 string.prototype.trimend: ^1.0.6 string.prototype.trimstart: ^1.0.6 + typed-array-buffer: ^1.0.0 + typed-array-byte-length: ^1.0.0 + typed-array-byte-offset: ^1.0.0 typed-array-length: ^1.0.4 unbox-primitive: ^1.0.2 - which-typed-array: ^1.1.9 - checksum: 037f55ee5e1cdf2e5edbab5524095a4f97144d95b94ea29e3611b77d852fd8c8a40e7ae7101fa6a759a9b9b1405f188c3c70928f2d3cd88d543a07fc0d5ad41a + which-typed-array: ^1.1.10 + checksum: 614e2c1c3717cb8d30b6128ef12ea110e06fd7d75ad77091ca1c5dbfb00da130e62e4bbbbbdda190eada098a22b27fe0f99ae5a1171dac2c8663b1e8be8a3a9b languageName: node linkType: hard @@ -5773,6 +5882,15 @@ __metadata: languageName: node linkType: hard +"es-shim-unscopables@npm:^1.0.0": + version: 1.0.0 + resolution: "es-shim-unscopables@npm:1.0.0" + dependencies: + has: ^1.0.3 + checksum: 83e95cadbb6ee44d3644dfad60dcad7929edbc42c85e66c3e99aefd68a3a5c5665f2686885cddb47dfeabfd77bd5ea5a7060f2092a955a729bbd8834f0d86fa1 + languageName: node + linkType: hard + "es-to-primitive@npm:^1.2.1": version: 1.2.1 resolution: "es-to-primitive@npm:1.2.1" @@ -5871,23 +5989,23 @@ __metadata: linkType: hard "eslint-config-prettier@npm:^8.5.0": - version: 8.8.0 - resolution: "eslint-config-prettier@npm:8.8.0" + version: 8.10.0 + resolution: "eslint-config-prettier@npm:8.10.0" peerDependencies: eslint: ">=7.0.0" bin: eslint-config-prettier: bin/cli.js - checksum: 1e94c3882c4d5e41e1dcfa2c368dbccbfe3134f6ac7d40101644d3bfbe3eb2f2ffac757f3145910b5eacf20c0e85e02b91293d3126d770cbf3dc390b3564681c + checksum: 153266badd477e49b0759816246b2132f1dbdb6c7f313ca60a9af5822fd1071c2bc5684a3720d78b725452bbac04bb130878b2513aea5e72b1b792de5a69fec8 languageName: node linkType: hard "eslint-plugin-jest@npm:^27.1.2": - version: 27.2.2 - resolution: "eslint-plugin-jest@npm:27.2.2" + version: 27.2.3 + resolution: "eslint-plugin-jest@npm:27.2.3" dependencies: "@typescript-eslint/utils": ^5.10.0 peerDependencies: - "@typescript-eslint/eslint-plugin": ^5.0.0 + "@typescript-eslint/eslint-plugin": ^5.0.0 || ^6.0.0 eslint: ^7.0.0 || ^8.0.0 jest: "*" peerDependenciesMeta: @@ -5895,7 +6013,7 @@ __metadata: optional: true jest: optional: true - checksum: 98b63252d985f5dedf36ce9587dd4a0d24daf71ca8a997258343402c0d33ddd5070502378dafd9ac7fc0ef2e0d557b5c77f18e09ad73c71a52de8061db88293f + checksum: 4c7e07f52f17749ac6fd0ff5fcd5ce30b88983ba31eeee322e4d48859f55eaa112f06172e586ad2031c00ff28bb2dfdc3d35c83895251b9c0e860fa47dfc5ff4 languageName: node linkType: hard @@ -5909,43 +6027,43 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^7.2.0": - version: 7.2.0 - resolution: "eslint-scope@npm:7.2.0" +"eslint-scope@npm:^7.2.2": + version: 7.2.2 + resolution: "eslint-scope@npm:7.2.2" dependencies: esrecurse: ^4.3.0 estraverse: ^5.2.0 - checksum: 64591a2d8b244ade9c690b59ef238a11d5c721a98bcee9e9f445454f442d03d3e04eda88e95a4daec558220a99fa384309d9faae3d459bd40e7a81b4063980ae + checksum: ec97dbf5fb04b94e8f4c5a91a7f0a6dd3c55e46bfc7bbcd0e3138c3a76977570e02ed89a1810c778dcd72072ff0e9621ba1379b4babe53921d71e2e4486fda3e languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1": - version: 3.4.1 - resolution: "eslint-visitor-keys@npm:3.4.1" - checksum: f05121d868202736b97de7d750847a328fcfa8593b031c95ea89425333db59676ac087fa905eba438d0a3c5769632f828187e0c1a0d271832a2153c1d3661c2c +"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": + version: 3.4.3 + resolution: "eslint-visitor-keys@npm:3.4.3" + checksum: 36e9ef87fca698b6fd7ca5ca35d7b2b6eeaaf106572e2f7fd31c12d3bfdaccdb587bba6d3621067e5aece31c8c3a348b93922ab8f7b2cbc6aaab5e1d89040c60 languageName: node linkType: hard "eslint@npm:^8.25.0": - version: 8.44.0 - resolution: "eslint@npm:8.44.0" + version: 8.48.0 + resolution: "eslint@npm:8.48.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 - "@eslint-community/regexpp": ^4.4.0 - "@eslint/eslintrc": ^2.1.0 - "@eslint/js": 8.44.0 + "@eslint-community/regexpp": ^4.6.1 + "@eslint/eslintrc": ^2.1.2 + "@eslint/js": 8.48.0 "@humanwhocodes/config-array": ^0.11.10 "@humanwhocodes/module-importer": ^1.0.1 "@nodelib/fs.walk": ^1.2.8 - ajv: ^6.10.0 + ajv: ^6.12.4 chalk: ^4.0.0 cross-spawn: ^7.0.2 debug: ^4.3.2 doctrine: ^3.0.0 escape-string-regexp: ^4.0.0 - eslint-scope: ^7.2.0 - eslint-visitor-keys: ^3.4.1 - espree: ^9.6.0 + eslint-scope: ^7.2.2 + eslint-visitor-keys: ^3.4.3 + espree: ^9.6.1 esquery: ^1.4.2 esutils: ^2.0.2 fast-deep-equal: ^3.1.3 @@ -5955,7 +6073,6 @@ __metadata: globals: ^13.19.0 graphemer: ^1.4.0 ignore: ^5.2.0 - import-fresh: ^3.0.0 imurmurhash: ^0.1.4 is-glob: ^4.0.0 is-path-inside: ^3.0.3 @@ -5967,22 +6084,21 @@ __metadata: natural-compare: ^1.4.0 optionator: ^0.9.3 strip-ansi: ^6.0.1 - strip-json-comments: ^3.1.0 text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: d06309ce4aafb9d27d558c8e5e5aa5cba3bbec3ce8ceccbc7d4b7a35f2b67fd40189159155553270e2e6febeb69bd8a3b60d6241c8f5ddc2ef1702ccbd328501 + checksum: f20b359a4f8123fec5c033577368cc020d42978b1b45303974acd8da7a27063168ee3fe297ab5b35327162f6a93154063e3ce6577102f70f9809aff793db9bd0 languageName: node linkType: hard -"espree@npm:^9.6.0": - version: 9.6.0 - resolution: "espree@npm:9.6.0" +"espree@npm:^9.6.0, espree@npm:^9.6.1": + version: 9.6.1 + resolution: "espree@npm:9.6.1" dependencies: acorn: ^8.9.0 acorn-jsx: ^5.3.2 eslint-visitor-keys: ^3.4.1 - checksum: 1287979510efb052a6a97c73067ea5d0a40701b29adde87bbe2d3eb1667e39ca55e8129e20e2517fed3da570150e7ef470585228459a8f3e3755f45007a1c662 + checksum: eb8c149c7a2a77b3f33a5af80c10875c3abd65450f60b8af6db1bfcfa8f101e21c1e56a561c6dc13b848e18148d43469e7cd208506238554fb5395a9ea5a1ab9 languageName: node linkType: hard @@ -6173,6 +6289,18 @@ __metadata: languageName: node linkType: hard +"ethereum-cryptography@npm:^2.0.0, ethereum-cryptography@npm:^2.1.2": + version: 2.1.2 + resolution: "ethereum-cryptography@npm:2.1.2" + dependencies: + "@noble/curves": 1.1.0 + "@noble/hashes": 1.3.1 + "@scure/bip32": 1.3.1 + "@scure/bip39": 1.2.1 + checksum: 2e8f7b8cc90232ae838ab6a8167708e8362621404d26e79b5d9e762c7b53d699f7520aff358d9254de658fcd54d2d0af168ff909943259ed27dc4cef2736410c + languageName: node + linkType: hard + "ethereumjs-abi@npm:^0.6.8": version: 0.6.8 resolution: "ethereumjs-abi@npm:0.6.8" @@ -6286,13 +6414,6 @@ __metadata: languageName: node linkType: hard -"event-target-shim@npm:^5.0.0": - version: 5.0.1 - resolution: "event-target-shim@npm:5.0.1" - checksum: 1ffe3bb22a6d51bdeb6bf6f7cf97d2ff4a74b017ad12284cc9e6a279e727dc30a5de6bb613e5596ff4dc3e517841339ad09a7eec44266eccb1aa201a30448166 - languageName: node - linkType: hard - "eventemitter3@npm:4.0.4": version: 4.0.4 resolution: "eventemitter3@npm:4.0.4" @@ -6426,15 +6547,15 @@ __metadata: linkType: hard "fast-glob@npm:^3.0.3, fast-glob@npm:^3.2.9": - version: 3.3.0 - resolution: "fast-glob@npm:3.3.0" + version: 3.3.1 + resolution: "fast-glob@npm:3.3.1" dependencies: "@nodelib/fs.stat": ^2.0.2 "@nodelib/fs.walk": ^1.2.3 glob-parent: ^5.1.2 merge2: ^1.3.0 micromatch: ^4.0.4 - checksum: 20df62be28eb5426fe8e40e0d05601a63b1daceb7c3d87534afcad91bdcf1e4b1743cf2d5247d6e225b120b46df0b9053a032b2691ba34ee121e033acd81f547 + checksum: b6f3add6403e02cf3a798bfbb1183d0f6da2afd368f27456010c0bc1f9640aea308243d4cb2c0ab142f618276e65ecb8be1661d7c62a7b4e5ba774b9ce5432e5 languageName: node linkType: hard @@ -6576,12 +6697,13 @@ __metadata: linkType: hard "flat-cache@npm:^3.0.4": - version: 3.0.4 - resolution: "flat-cache@npm:3.0.4" + version: 3.1.0 + resolution: "flat-cache@npm:3.1.0" dependencies: - flatted: ^3.1.0 + flatted: ^3.2.7 + keyv: ^4.5.3 rimraf: ^3.0.2 - checksum: 4fdd10ecbcbf7d520f9040dd1340eb5dfe951e6f0ecf2252edeec03ee68d989ec8b9a20f4434270e71bcfd57800dc09b3344fca3966b2eb8f613072c7d9a2365 + checksum: 99312601d5b90f44aef403f17f056dc09be7e437703740b166cdc9386d99e681f74e6b6e8bd7d010bda66904ea643c9527276b1b80308a2119741d94108a4d8f languageName: node linkType: hard @@ -6605,7 +6727,7 @@ __metadata: languageName: node linkType: hard -"flatted@npm:^3.1.0": +"flatted@npm:^3.2.7": version: 3.2.7 resolution: "flatted@npm:3.2.7" checksum: 427633049d55bdb80201c68f7eb1cbd533e03eac541f97d3aecab8c5526f12a20ccecaeede08b57503e772c769e7f8680b37e8d482d1e5f8d7e2194687f9ea35 @@ -6621,7 +6743,7 @@ __metadata: languageName: node linkType: hard -"follow-redirects@npm:^1.12.1, follow-redirects@npm:^1.14.0": +"follow-redirects@npm:^1.12.1, follow-redirects@npm:^1.14.0, follow-redirects@npm:^1.15.0": version: 1.15.2 resolution: "follow-redirects@npm:1.15.2" peerDependenciesMeta: @@ -6841,11 +6963,11 @@ __metadata: linkType: hard "fs-minipass@npm:^3.0.0": - version: 3.0.2 - resolution: "fs-minipass@npm:3.0.2" + version: 3.0.3 + resolution: "fs-minipass@npm:3.0.3" dependencies: - minipass: ^5.0.0 - checksum: e9cc0e1f2d01c6f6f62f567aee59530aba65c6c7b2ae88c5027bc34c711ebcfcfaefd0caf254afa6adfe7d1fba16bc2537508a6235196bac7276747d078aef0a + minipass: ^7.0.3 + checksum: 8722a41109130851d979222d3ec88aabaceeaaf8f57b2a8f744ef8bd2d1ce95453b04a61daa0078822bc5cd21e008814f06fe6586f56fef511e71b8d2394d802 languageName: node linkType: hard @@ -6874,11 +6996,11 @@ __metadata: linkType: hard "fsevents@npm:~2.3.2": - version: 2.3.2 - resolution: "fsevents@npm:2.3.2" + version: 2.3.3 + resolution: "fsevents@npm:2.3.3" dependencies: node-gyp: latest - checksum: 97ade64e75091afee5265e6956cb72ba34db7819b4c3e94c431d4be2b19b8bb7a2d4116da417950c3425f17c8fe693d25e20212cac583ac1521ad066b77ae31f + checksum: 11e6ea6fea15e42461fc55b4b0e4a0a3c654faa567f1877dbd353f39156f69def97a69936d1746619d656c4b93de2238bf731f6085a03a50cabf287c9d024317 conditions: os=darwin languageName: node linkType: hard @@ -6893,8 +7015,8 @@ __metadata: linkType: hard "fsevents@patch:fsevents@~2.3.2#~builtin": - version: 2.3.2 - resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=18f3a7" + version: 2.3.3 + resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=18f3a7" dependencies: node-gyp: latest conditions: os=darwin @@ -6971,7 +7093,7 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0": +"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0, get-intrinsic@npm:^1.2.1": version: 1.2.1 resolution: "get-intrinsic@npm:1.2.1" dependencies: @@ -7237,11 +7359,11 @@ __metadata: linkType: hard "globals@npm:^13.19.0": - version: 13.20.0 - resolution: "globals@npm:13.20.0" + version: 13.21.0 + resolution: "globals@npm:13.21.0" dependencies: type-fest: ^0.20.2 - checksum: ad1ecf914bd051325faad281d02ea2c0b1df5d01bd94d368dcc5513340eac41d14b3c61af325768e3c7f8d44576e72780ec0b6f2d366121f8eec6e03c3a3b97a + checksum: 86c92ca8a04efd864c10852cd9abb1ebe6d447dcc72936783e66eaba1087d7dba5c9c3421a48d6ca722c319378754dbcc3f3f732dbe47592d7de908edf58a773 languageName: node linkType: hard @@ -7381,11 +7503,11 @@ __metadata: linkType: hard "handlebars@npm:^4.0.1, handlebars@npm:^4.7.7": - version: 4.7.7 - resolution: "handlebars@npm:4.7.7" + version: 4.7.8 + resolution: "handlebars@npm:4.7.8" dependencies: minimist: ^1.2.5 - neo-async: ^2.6.0 + neo-async: ^2.6.2 source-map: ^0.6.1 uglify-js: ^3.1.4 wordwrap: ^1.0.0 @@ -7394,7 +7516,7 @@ __metadata: optional: true bin: handlebars: bin/handlebars - checksum: 1e79a43f5e18d15742977cb987923eab3e2a8f44f2d9d340982bcb69e1735ed049226e534d7c1074eaddaf37e4fb4f471a8adb71cddd5bc8cf3f894241df5cee + checksum: 00e68bb5c183fd7b8b63322e6234b5ac8fbb960d712cb3f25587d559c2951d9642df83c04a1172c918c41bcfc81bfbd7a7718bbce93b893e0135fc99edea93ff languageName: node linkType: hard @@ -7446,8 +7568,8 @@ __metadata: linkType: hard "hardhat-deploy@npm:^0.11.14": - version: 0.11.34 - resolution: "hardhat-deploy@npm:0.11.34" + version: 0.11.37 + resolution: "hardhat-deploy@npm:0.11.37" dependencies: "@ethersproject/abi": ^5.7.0 "@ethersproject/abstract-signer": ^5.7.0 @@ -7473,7 +7595,7 @@ __metadata: murmur-128: ^0.2.1 qs: ^6.9.4 zksync-web3: ^0.14.3 - checksum: 3c4bcd657a80e4f22c1f8bcee021e5277060849ce4180cbc721e0c2d625f2f98de8ebbfad23875d32eeaf06d88bdba06cb43ab29359cb9531e8bb7851a98ead1 + checksum: c338289849f26530296be648c7bfc2d4673d0786855ed256ee9cc864f40b94125cfa36808bedfbae4f2bad7adc38def7547bbeb3b84cbfb0aeabae04de5238fd languageName: node linkType: hard @@ -7557,8 +7679,8 @@ __metadata: linkType: hard "hardhat@npm:^2.16.1": - version: 2.16.1 - resolution: "hardhat@npm:2.16.1" + version: 2.17.1 + resolution: "hardhat@npm:2.17.1" dependencies: "@ethersproject/abi": ^5.1.2 "@metamask/eth-sig-util": ^4.0.0 @@ -7576,7 +7698,6 @@ __metadata: "@sentry/node": ^5.18.1 "@types/bn.js": ^5.1.0 "@types/lru-cache": ^5.1.0 - abort-controller: ^3.0.0 adm-zip: ^0.4.16 aggregate-error: ^3.0.0 ansi-escapes: ^4.3.0 @@ -7619,7 +7740,7 @@ __metadata: optional: true bin: hardhat: internal/cli/bootstrap.js - checksum: 32508ab6463efd796e8805150c182a9b974fcec8e4ab362a95f8bab2b4baf24c4feb48bbee1f3a7165a934f5257e1d3fcfea5764f261404aec23a88066341e48 + checksum: 4986fd535d82e6c6c9e50627daf95b68b97c850dd57fb5b31ac62945c6bcecd2e48e3dbce1d3dec324a01bf903c9cd13c095cc68c3a68cf586880b4b05125254 languageName: node linkType: hard @@ -7978,9 +8099,9 @@ __metadata: linkType: hard "immutable@npm:^4.0.0-rc.12": - version: 4.3.0 - resolution: "immutable@npm:4.3.0" - checksum: bbd7ea99e2752e053323543d6ff1cc71a4b4614fa6121f321ca766db2bd2092f3f1e0a90784c5431350b7344a4f792fa002eac227062d59b9377b6c09063b58b + version: 4.3.4 + resolution: "immutable@npm:4.3.4" + checksum: de3edd964c394bab83432429d3fb0b4816b42f56050f2ca913ba520bd3068ec3e504230d0800332d3abc478616e8f55d3787424a90d0952e6aba864524f1afc3 languageName: node linkType: hard @@ -8212,12 +8333,12 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.12.0, is-core-module@npm:^2.5.0, is-core-module@npm:^2.8.1": - version: 2.12.1 - resolution: "is-core-module@npm:2.12.1" +"is-core-module@npm:^2.13.0, is-core-module@npm:^2.5.0, is-core-module@npm:^2.8.1": + version: 2.13.0 + resolution: "is-core-module@npm:2.13.0" dependencies: has: ^1.0.3 - checksum: f04ea30533b5e62764e7b2e049d3157dc0abd95ef44275b32489ea2081176ac9746ffb1cdb107445cf1ff0e0dfcad522726ca27c27ece64dadf3795428b8e468 + checksum: 053ab101fb390bfeb2333360fd131387bed54e476b26860dc7f5a700bbf34a0ec4454f7c8c4d43e8a0030957e4b3db6e16d35e1890ea6fb654c833095e040355 languageName: node linkType: hard @@ -8409,15 +8530,11 @@ __metadata: linkType: hard "is-typed-array@npm:^1.1.10, is-typed-array@npm:^1.1.3, is-typed-array@npm:^1.1.9": - version: 1.1.10 - resolution: "is-typed-array@npm:1.1.10" + version: 1.1.12 + resolution: "is-typed-array@npm:1.1.12" dependencies: - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 - for-each: ^0.3.3 - gopd: ^1.0.1 - has-tostringtag: ^1.0.0 - checksum: aac6ecb59d4c56a1cdeb69b1f129154ef462bbffe434cb8a8235ca89b42f258b7ae94073c41b3cb7bce37f6a1733ad4499f07882d5d5093a7ba84dfc4ebb8017 + which-typed-array: ^1.1.11 + checksum: 4c89c4a3be07186caddadf92197b17fda663a9d259ea0d44a85f171558270d36059d1c386d34a12cba22dfade5aba497ce22778e866adc9406098c8fc4771796 languageName: node linkType: hard @@ -8496,15 +8613,15 @@ __metadata: linkType: hard "jackspeak@npm:^2.0.3": - version: 2.2.1 - resolution: "jackspeak@npm:2.2.1" + version: 2.3.0 + resolution: "jackspeak@npm:2.3.0" dependencies: "@isaacs/cliui": ^8.0.2 "@pkgjs/parseargs": ^0.11.0 dependenciesMeta: "@pkgjs/parseargs": optional: true - checksum: e29291c0d0f280a063fa18fbd1e891ab8c2d7519fd34052c0ebde38538a15c603140d60c2c7f432375ff7ee4c5f1c10daa8b2ae19a97c3d4affe308c8360c1df + checksum: 71bf716f4b5793226d4aeb9761ebf2605ee093b59f91a61451d57d998dd64bbf2b54323fb749b8b2ae8b6d8a463de4f6e3fedab50108671f247bbc80195a6306 languageName: node linkType: hard @@ -8530,9 +8647,9 @@ __metadata: linkType: hard "js-sdsl@npm:^4.1.4": - version: 4.4.1 - resolution: "js-sdsl@npm:4.4.1" - checksum: ba445b53531f2f353f8f66ed8c7edc7942c9bac68707161aa70528fa8ee9a89805d170cff171aa40bdac1aed5dfe97dce6f929e6f759a487ed619387a5ea1365 + version: 4.4.2 + resolution: "js-sdsl@npm:4.4.2" + checksum: ba705adc1788bf3c6f6c8e5077824f2bb4f0acab5a984420ce5cc492c7fff3daddc26335ad2c9a67d4f5e3241ec790f9e5b72a625adcf20cf321d2fd85e62b8b languageName: node linkType: hard @@ -8785,12 +8902,12 @@ __metadata: languageName: node linkType: hard -"keyv@npm:^4.0.0": - version: 4.5.2 - resolution: "keyv@npm:4.5.2" +"keyv@npm:^4.0.0, keyv@npm:^4.5.3": + version: 4.5.3 + resolution: "keyv@npm:4.5.3" dependencies: json-buffer: 3.0.1 - checksum: 13ad58303acd2261c0d4831b4658451603fd159e61daea2121fcb15feb623e75ee328cded0572da9ca76b7b3ceaf8e614f1806c6b3af5db73c9c35a345259651 + checksum: 3ffb4d5b72b6b4b4af443bbb75ca2526b23c750fccb5ac4c267c6116888b4b65681015c2833cb20d26cf3e6e32dac6b988c77f7f022e1a571b7d90f1442257da languageName: node linkType: hard @@ -9260,9 +9377,9 @@ __metadata: linkType: hard "lru-cache@npm:^9.1.1 || ^10.0.0": - version: 10.0.0 - resolution: "lru-cache@npm:10.0.0" - checksum: 18f101675fe283bc09cda0ef1e3cc83781aeb8373b439f086f758d1d91b28730950db785999cd060d3c825a8571c03073e8c14512b6655af2188d623031baf50 + version: 10.0.1 + resolution: "lru-cache@npm:10.0.1" + checksum: 06f8d0e1ceabd76bb6f644a26dbb0b4c471b79c7b514c13c6856113879b3bf369eb7b497dad4ff2b7e2636db202412394865b33c332100876d838ad1372f0181 languageName: node linkType: hard @@ -9274,11 +9391,11 @@ __metadata: linkType: hard "magic-string@npm:^0.30.0": - version: 0.30.1 - resolution: "magic-string@npm:0.30.1" + version: 0.30.3 + resolution: "magic-string@npm:0.30.3" dependencies: "@jridgewell/sourcemap-codec": ^1.4.15 - checksum: 7bc7e4493e32a77068f3753bf8652d4ab44142122eb7fb9fa871af83bef2cd2c57518a6769701cd5d0379bd624a13bc8c72ca25ac5655b27e5a61adf1fd38db2 + checksum: a5a9ddf9bd3bf49a2de1048bf358464f1bda7b3cc1311550f4a0ba8f81a4070e25445d53a5ee28850161336f1bff3cf28aa3320c6b4aeff45ce3e689f300b2f3 languageName: node linkType: hard @@ -9432,7 +9549,7 @@ __metadata: languageName: node linkType: hard -"meow@npm:^8.0.0": +"meow@npm:^8.0.0, meow@npm:^8.1.2": version: 8.1.2 resolution: "meow@npm:8.1.2" dependencies: @@ -9479,6 +9596,13 @@ __metadata: languageName: node linkType: hard +"micro-ftch@npm:^0.3.1": + version: 0.3.1 + resolution: "micro-ftch@npm:0.3.1" + checksum: 0e496547253a36e98a83fb00c628c53c3fb540fa5aaeaf718438873785afd193244988c09d219bb1802984ff227d04938d9571ef90fe82b48bd282262586aaff + languageName: node + linkType: hard + "micromatch@npm:^4.0.0, micromatch@npm:^4.0.2, micromatch@npm:^4.0.4": version: 4.0.5 resolution: "micromatch@npm:4.0.5" @@ -9674,17 +9798,17 @@ __metadata: linkType: hard "minipass-fetch@npm:^3.0.0": - version: 3.0.3 - resolution: "minipass-fetch@npm:3.0.3" + version: 3.0.4 + resolution: "minipass-fetch@npm:3.0.4" dependencies: encoding: ^0.1.13 - minipass: ^5.0.0 + minipass: ^7.0.3 minipass-sized: ^1.0.3 minizlib: ^2.1.2 dependenciesMeta: encoding: optional: true - checksum: af5ab2552a16fcf505d35fd7ffb84b57f4a0eeb269e6e1d9a2a75824dda48b36e527083250b7cca4a4def21d9544e2ade441e4730e233c0bc2133f6abda31e18 + checksum: af7aad15d5c128ab1ebe52e043bdf7d62c3c6f0cecb9285b40d7b395e1375b45dcdfd40e63e93d26a0e8249c9efd5c325c65575aceee192883970ff8cb11364a languageName: node linkType: hard @@ -9751,10 +9875,10 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0": - version: 7.0.2 - resolution: "minipass@npm:7.0.2" - checksum: 46776de732eb7cef2c7404a15fb28c41f5c54a22be50d47b03c605bf21f5c18d61a173c0a20b49a97e7a65f78d887245066410642551e45fffe04e9ac9e325bc +"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.3": + version: 7.0.3 + resolution: "minipass@npm:7.0.3" + checksum: 6f1614f5b5b55568a46bca5fec0e7c46dac027691db27d0e1923a8192866903144cd962ac772c0e9f89b608ea818b702709c042bce98e190d258847d85461531 languageName: node linkType: hard @@ -10090,7 +10214,7 @@ __metadata: languageName: node linkType: hard -"neo-async@npm:^2.6.0": +"neo-async@npm:^2.6.2": version: 2.6.2 resolution: "neo-async@npm:2.6.2" checksum: deac9f8d00eda7b2e5cd1b2549e26e10a0faa70adaa6fdadca701cc55f49ee9018e427f424bac0c790b7c7e2d3068db97f3093f1093975f2acb8f8818b936ed9 @@ -10140,8 +10264,8 @@ __metadata: linkType: hard "node-fetch@npm:^2.6.0, node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.12, node-fetch@npm:^2.6.7": - version: 2.6.12 - resolution: "node-fetch@npm:2.6.12" + version: 2.7.0 + resolution: "node-fetch@npm:2.7.0" dependencies: whatwg-url: ^5.0.0 peerDependencies: @@ -10149,18 +10273,18 @@ __metadata: peerDependenciesMeta: encoding: optional: true - checksum: 3bc1655203d47ee8e313c0d96664b9673a3d4dd8002740318e9d27d14ef306693a4b2ef8d6525775056fd912a19e23f3ac0d7111ad8925877b7567b29a625592 + checksum: d76d2f5edb451a3f05b15115ec89fc6be39de37c6089f1b6368df03b91e1633fd379a7e01b7ab05089a25034b2023d959b47e59759cb38d88341b2459e89d6e5 languageName: node linkType: hard "node-gyp-build@npm:^4.2.0, node-gyp-build@npm:^4.3.0": - version: 4.6.0 - resolution: "node-gyp-build@npm:4.6.0" + version: 4.6.1 + resolution: "node-gyp-build@npm:4.6.1" bin: node-gyp-build: bin.js node-gyp-build-optional: optional.js node-gyp-build-test: build-test.js - checksum: 25d78c5ef1f8c24291f4a370c47ba52fcea14f39272041a90a7894cd50d766f7c8cb8fb06c0f42bf6f69b204b49d9be3c8fc344aac09714d5bdb95965499eb15 + checksum: c3676d337b36803bc7792e35bf7fdcda7cdcb7e289b8f9855a5535702a82498eb976842fefcf487258c58005ca32ce3d537fbed91280b04409161dcd7232a882 languageName: node linkType: hard @@ -10185,7 +10309,7 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.12": +"node-releases@npm:^2.0.13": version: 2.0.13 resolution: "node-releases@npm:2.0.13" checksum: 17ec8f315dba62710cae71a8dad3cd0288ba943d2ece43504b3b1aa8625bf138637798ab470b1d9035b0545996f63000a8a926e0f6d35d0996424f8b6d36dda3 @@ -11065,13 +11189,13 @@ __metadata: linkType: hard "postcss@npm:^8.1.10": - version: 8.4.25 - resolution: "postcss@npm:8.4.25" + version: 8.4.28 + resolution: "postcss@npm:8.4.28" dependencies: nanoid: ^3.3.6 picocolors: ^1.0.0 source-map-js: ^1.0.2 - checksum: 9ed3ab8af43ad5210c28f56f916fd9b8c9f94fbeaebbf645dcf579bc28bdd8056c2a7ecc934668d399b81fedb6128f0c4b299f931e50454964bc911c25a3a0a2 + checksum: f605c24a36f7e400bad379735fbfc893ccb8d293ad6d419bb824db77cdcb69f43d614ef35f9f7091f32ca588d130ec60dbcf53b366e6bf88a8a64bbeb3c05f6d languageName: node linkType: hard @@ -11216,6 +11340,13 @@ __metadata: languageName: node linkType: hard +"proxy-from-env@npm:^1.1.0": + version: 1.1.0 + resolution: "proxy-from-env@npm:1.1.0" + checksum: ed7fcc2ba0a33404958e34d95d18638249a68c430e30fcb6c478497d72739ba64ce9810a24f53a7d921d0c065e5b78e3822759800698167256b04659366ca4d4 + languageName: node + linkType: hard + "psl@npm:^1.1.28": version: 1.9.0 resolution: "psl@npm:1.9.0" @@ -11559,7 +11690,7 @@ __metadata: languageName: node linkType: hard -"regexp.prototype.flags@npm:^1.4.3": +"regexp.prototype.flags@npm:^1.5.0": version: 1.5.0 resolution: "regexp.prototype.flags@npm:1.5.0" dependencies: @@ -11724,15 +11855,15 @@ __metadata: linkType: hard "resolve@npm:^1.1.6, resolve@npm:^1.10.0": - version: 1.22.3 - resolution: "resolve@npm:1.22.3" + version: 1.22.4 + resolution: "resolve@npm:1.22.4" dependencies: - is-core-module: ^2.12.0 + is-core-module: ^2.13.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: fb834b81348428cb545ff1b828a72ea28feb5a97c026a1cf40aa1008352c72811ff4d4e71f2035273dc536dcfcae20c13604ba6283c612d70fa0b6e44519c374 + checksum: 23f25174c2736ce24c6d918910e0d1f89b6b38fefa07a995dff864acd7863d59a7f049e691f93b4b2ee29696303390d921552b6d1b841ed4a8101f517e1d0124 languageName: node linkType: hard @@ -11753,15 +11884,15 @@ __metadata: linkType: hard "resolve@patch:resolve@^1.1.6#~builtin, resolve@patch:resolve@^1.10.0#~builtin": - version: 1.22.3 - resolution: "resolve@patch:resolve@npm%3A1.22.3#~builtin::version=1.22.3&hash=07638b" + version: 1.22.4 + resolution: "resolve@patch:resolve@npm%3A1.22.4#~builtin::version=1.22.4&hash=07638b" dependencies: - is-core-module: ^2.12.0 + is-core-module: ^2.13.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: ad59734723b596d0891321c951592ed9015a77ce84907f89c9d9307dd0c06e11a67906a3e628c4cae143d3e44898603478af0ddeb2bba3f229a9373efe342665 + checksum: c45f2545fdc4d21883861b032789e20aa67a2f2692f68da320cc84d5724cd02f2923766c5354b3210897e88f1a7b3d6d2c7c22faeead8eed7078e4c783a444bc languageName: node linkType: hard @@ -12038,18 +12169,18 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.5.2": - version: 7.5.2 - resolution: "semver@npm:7.5.2" +"semver@npm:7.5.4, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.1.2, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.2": + version: 7.5.4 + resolution: "semver@npm:7.5.4" dependencies: lru-cache: ^6.0.0 bin: semver: bin/semver.js - checksum: 3fdf5d1e6f170fe8bcc41669e31787649af91af7f54f05c71d0865bb7aa27e8b92f68b3e6b582483e2c1c648008bc84249d2cd86301771fe5cbf7621d1fe5375 + checksum: 12d8ad952fa353b0995bf180cdac205a4068b759a140e5d3c608317098b3575ac2f1e09182206bf2eb26120e1c0ed8fb92c48c592f6099680de56bb071423ca3 languageName: node linkType: hard -"semver@npm:^6.0.0, semver@npm:^6.3.0": +"semver@npm:^6.0.0, semver@npm:^6.3.0, semver@npm:^6.3.1": version: 6.3.1 resolution: "semver@npm:6.3.1" bin: @@ -12058,17 +12189,6 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.1.2, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8": - version: 7.5.4 - resolution: "semver@npm:7.5.4" - dependencies: - lru-cache: ^6.0.0 - bin: - semver: bin/semver.js - checksum: 12d8ad952fa353b0995bf180cdac205a4068b759a140e5d3c608317098b3575ac2f1e09182206bf2eb26120e1c0ed8fb92c48c592f6099680de56bb071423ca3 - languageName: node - linkType: hard - "send@npm:0.18.0": version: 0.18.0 resolution: "send@npm:0.18.0" @@ -12222,9 +12342,9 @@ __metadata: linkType: hard "signal-exit@npm:^4.0.1": - version: 4.0.2 - resolution: "signal-exit@npm:4.0.2" - checksum: 41f5928431cc6e91087bf0343db786a6313dd7c6fd7e551dbc141c95bb5fb26663444fd9df8ea47c5d7fc202f60aa7468c3162a9365cbb0615fc5e1b1328fe31 + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549 languageName: node linkType: hard @@ -12330,8 +12450,8 @@ __metadata: linkType: hard "solhint@npm:^3.3.7": - version: 3.4.1 - resolution: "solhint@npm:3.4.1" + version: 3.6.2 + resolution: "solhint@npm:3.6.2" dependencies: "@solidity-parser/parser": ^0.16.0 ajv: ^6.12.6 @@ -12347,7 +12467,7 @@ __metadata: lodash: ^4.17.21 pluralize: ^8.0.0 prettier: ^2.8.3 - semver: ^6.3.0 + semver: ^7.5.2 strip-ansi: ^6.0.1 table: ^6.8.1 text-table: ^0.2.0 @@ -12356,14 +12476,16 @@ __metadata: optional: true bin: solhint: solhint.js - checksum: 4f81b5bac126c6b07ac36be887c0b120263b5628671d8433c5a20ed9f8168ec6224a706456f1b625c0b9e15143427d229eff497dfea94eca398b63b727c8f7bc + checksum: 96c2ab3c1444624facb45b929682c65d83019f392c7331463a45e8ed61f08122e24b6709a721b6086ddfb0d5e3c3d4281f175f74eb308415072917556bdeba22 languageName: node linkType: hard -"solidity-ast@npm:^0.4.15, solidity-ast@npm:^0.4.38": - version: 0.4.49 - resolution: "solidity-ast@npm:0.4.49" - checksum: f5b0354ddfa882346cf12d33f79c6123796a07637b248ceb9cfeec9f81540e270407f6fca660cf75666e1ba1866270319ab3fbe54b01491dbd35adffd1405243 +"solidity-ast@npm:^0.4.26, solidity-ast@npm:^0.4.38": + version: 0.4.52 + resolution: "solidity-ast@npm:0.4.52" + dependencies: + array.prototype.findlast: ^1.2.2 + checksum: 8302faaa9a510b6d9e0d64681bbfb113103035fab1680637b2455f2201fe4e3fa0db5e640bb32222013117df2cb6f770fce705e7e5ff170c9c061c27cea1dd27 languageName: node linkType: hard @@ -12403,14 +12525,14 @@ __metadata: linkType: hard "solidity-docgen@npm:^0.6.0-beta.29, solidity-docgen@npm:^0.6.0-beta.30": - version: 0.6.0-beta.35 - resolution: "solidity-docgen@npm:0.6.0-beta.35" + version: 0.6.0-beta.36 + resolution: "solidity-docgen@npm:0.6.0-beta.36" dependencies: handlebars: ^4.7.7 solidity-ast: ^0.4.38 peerDependencies: hardhat: ^2.8.0 - checksum: 5b773b8b2959109efca409ebd6eaa9eaa535989b52de7653bed75ad9195a145653c6436c258eb78cc819e220d79ecb4ed0efe9fcb8f9aed56e5b5d386149349d + checksum: 658204db9dc73904bf2e556015d36ca5d120c88b10ecd249f5822b75cb5ea259b039081018ad98d6d00423f0e7691c9a1bf515e640bb84fc51d0def9d80eca3a languageName: node linkType: hard @@ -12495,7 +12617,7 @@ __metadata: languageName: node linkType: hard -"split2@npm:^3.0.0": +"split2@npm:^3.0.0, split2@npm:^3.2.2": version: 3.2.2 resolution: "split2@npm:3.2.2" dependencies: @@ -12551,11 +12673,11 @@ __metadata: linkType: hard "ssri@npm:^10.0.0": - version: 10.0.4 - resolution: "ssri@npm:10.0.4" + version: 10.0.5 + resolution: "ssri@npm:10.0.5" dependencies: - minipass: ^5.0.0 - checksum: fb14da9f8a72b04eab163eb13a9dda11d5962cd2317f85457c4e0b575e9a6e0e3a6a87b5bf122c75cb36565830cd5f263fb457571bf6f1587eb5f95d095d6165 + minipass: ^7.0.3 + checksum: 0a31b65f21872dea1ed3f7c200d7bc1c1b91c15e419deca14f282508ba917cbb342c08a6814c7f68ca4ca4116dd1a85da2bbf39227480e50125a1ceffeecb750 languageName: node linkType: hard @@ -12791,7 +12913,7 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:3.1.1, strip-json-comments@npm:^3.1.0, strip-json-comments@npm:^3.1.1": +"strip-json-comments@npm:3.1.1, strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" checksum: 492f73e27268f9b1c122733f28ecb0e7e8d8a531a6662efbd08e22cccb3f9475e90a1b82cab06a392f6afae6d2de636f977e231296400d0ec5304ba70f166443 @@ -13192,9 +13314,9 @@ __metadata: linkType: hard "tslib@npm:^2.1.0, tslib@npm:^2.3.1, tslib@npm:^2.5.0": - version: 2.6.0 - resolution: "tslib@npm:2.6.0" - checksum: c01066038f950016a18106ddeca4649b4d76caa76ec5a31e2a26e10586a59fceb4ee45e96719bf6c715648e7c14085a81fee5c62f7e9ebee68e77a5396e5538f + version: 2.6.2 + resolution: "tslib@npm:2.6.2" + checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad languageName: node linkType: hard @@ -13321,9 +13443,9 @@ __metadata: linkType: hard "type-fest@npm:^3.0.0": - version: 3.13.0 - resolution: "type-fest@npm:3.13.0" - checksum: f7be142ae1ad0582eafd52d085350799c8cd918c15455896a06c82c147b61f8cea58892bedf1348943478e37740562219375b3b59fd855db99cd2b2766510f98 + version: 3.13.1 + resolution: "type-fest@npm:3.13.1" + checksum: c06b0901d54391dc46de3802375f5579868949d71f93b425ce564e19a428a0d411ae8d8cb0e300d330071d86152c3ea86e744c3f2860a42a79585b6ec2fdae8e languageName: node linkType: hard @@ -13352,8 +13474,8 @@ __metadata: linkType: hard "typechain@npm:^8.1.0": - version: 8.2.0 - resolution: "typechain@npm:8.2.0" + version: 8.3.1 + resolution: "typechain@npm:8.3.1" dependencies: "@types/prettier": ^2.1.1 debug: ^4.3.1 @@ -13369,7 +13491,43 @@ __metadata: typescript: ">=4.3.0" bin: typechain: dist/cli/cli.js - checksum: 8591d333fda0e31172f4d9e0a8e23c24eee446ce3719989bd48e63f84a975917bb2f853ecaf616193ad7f3964e7c42fe3b1fc5abb69f4446794f465505f6c1a7 + checksum: c1e11ab1452d0c83be0c34a8b900b156b0c6654b95f7e7bb18dd98c0decd6009ffa1316e393f4e8def187af1bea3e931a13503815cc37155c0c945b7ae5b5215 + languageName: node + linkType: hard + +"typed-array-buffer@npm:^1.0.0": + version: 1.0.0 + resolution: "typed-array-buffer@npm:1.0.0" + dependencies: + call-bind: ^1.0.2 + get-intrinsic: ^1.2.1 + is-typed-array: ^1.1.10 + checksum: 3e0281c79b2a40cd97fe715db803884301993f4e8c18e8d79d75fd18f796e8cd203310fec8c7fdb5e6c09bedf0af4f6ab8b75eb3d3a85da69328f28a80456bd3 + languageName: node + linkType: hard + +"typed-array-byte-length@npm:^1.0.0": + version: 1.0.0 + resolution: "typed-array-byte-length@npm:1.0.0" + dependencies: + call-bind: ^1.0.2 + for-each: ^0.3.3 + has-proto: ^1.0.1 + is-typed-array: ^1.1.10 + checksum: b03db16458322b263d87a702ff25388293f1356326c8a678d7515767ef563ef80e1e67ce648b821ec13178dd628eb2afdc19f97001ceae7a31acf674c849af94 + languageName: node + linkType: hard + +"typed-array-byte-offset@npm:^1.0.0": + version: 1.0.0 + resolution: "typed-array-byte-offset@npm:1.0.0" + dependencies: + available-typed-arrays: ^1.0.5 + call-bind: ^1.0.2 + for-each: ^0.3.3 + has-proto: ^1.0.1 + is-typed-array: ^1.1.10 + checksum: 04f6f02d0e9a948a95fbfe0d5a70b002191fae0b8fe0fe3130a9b2336f043daf7a3dda56a31333c35a067a97e13f539949ab261ca0f3692c41603a46a94e960b languageName: node linkType: hard @@ -13401,12 +13559,12 @@ __metadata: linkType: hard "typescript@npm:^4.6.4 || ^5.0.0": - version: 5.1.6 - resolution: "typescript@npm:5.1.6" + version: 5.2.2 + resolution: "typescript@npm:5.2.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: b2f2c35096035fe1f5facd1e38922ccb8558996331405eb00a5111cc948b2e733163cc22fab5db46992aba7dd520fff637f2c1df4996ff0e134e77d3249a7350 + checksum: 7912821dac4d962d315c36800fe387cdc0a6298dba7ec171b350b4a6e988b51d7b8f051317786db1094bd7431d526b648aba7da8236607febb26cf5b871d2d3c languageName: node linkType: hard @@ -13421,12 +13579,12 @@ __metadata: linkType: hard "typescript@patch:typescript@^4.6.4 || ^5.0.0#~builtin": - version: 5.1.6 - resolution: "typescript@patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=bda367" + version: 5.2.2 + resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=bda367" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 21e88b0a0c0226f9cb9fd25b9626fb05b4c0f3fddac521844a13e1f30beb8f14e90bd409a9ac43c812c5946d714d6e0dee12d5d02dfc1c562c5aacfa1f49b606 + checksum: 07106822b4305de3f22835cbba949a2b35451cad50888759b6818421290ff95d522b38ef7919e70fb381c5fe9c1c643d7dea22c8b31652a717ddbd57b7f4d554 languageName: node linkType: hard @@ -13483,11 +13641,11 @@ __metadata: linkType: hard "undici@npm:^5.14.0": - version: 5.22.1 - resolution: "undici@npm:5.22.1" + version: 5.23.0 + resolution: "undici@npm:5.23.0" dependencies: busboy: ^1.6.0 - checksum: 048a3365f622be44fb319316cedfaa241c59cf7f3368ae7667a12323447e1822e8cc3d00f6956c852d1478a6fde1cbbe753f49e05f2fdaed229693e716ebaf35 + checksum: 906ca4fb1d47163d2cee2ecbbc664a1d92508a2cdf1558146621109f525c983a83597910b36e6ba468240e95259be5939cea6babc99fc0c36360b16630f66784 languageName: node linkType: hard @@ -14252,7 +14410,7 @@ __metadata: languageName: node linkType: hard -"web3-utils@npm:1.10.0, web3-utils@npm:^1.3.0, web3-utils@npm:^1.7.5": +"web3-utils@npm:1.10.0": version: 1.10.0 resolution: "web3-utils@npm:1.10.0" dependencies: @@ -14282,6 +14440,22 @@ __metadata: languageName: node linkType: hard +"web3-utils@npm:^1.3.0, web3-utils@npm:^1.7.5": + version: 1.10.2 + resolution: "web3-utils@npm:1.10.2" + dependencies: + "@ethereumjs/util": ^8.1.0 + bn.js: ^5.2.1 + ethereum-bloom-filters: ^1.0.6 + ethereum-cryptography: ^2.1.2 + ethjs-unit: 0.1.6 + number-to-bn: 1.7.0 + randombytes: ^2.1.0 + utf8: 3.0.0 + checksum: a5f8db69603fdd5e984aa6407f47f7a4e0dab83af42e10de25a6d9eeaf2e7d4d18fe665b569e364b2e916233fb73b26cc70ff0d730e7909720118c4790dfb043 + languageName: node + linkType: hard + "web3@npm:1.10.0": version: 1.10.0 resolution: "web3@npm:1.10.0" @@ -14363,17 +14537,16 @@ __metadata: languageName: node linkType: hard -"which-typed-array@npm:^1.1.2, which-typed-array@npm:^1.1.9": - version: 1.1.10 - resolution: "which-typed-array@npm:1.1.10" +"which-typed-array@npm:^1.1.10, which-typed-array@npm:^1.1.11, which-typed-array@npm:^1.1.2": + version: 1.1.11 + resolution: "which-typed-array@npm:1.1.11" dependencies: available-typed-arrays: ^1.0.5 call-bind: ^1.0.2 for-each: ^0.3.3 gopd: ^1.0.1 has-tostringtag: ^1.0.0 - is-typed-array: ^1.1.10 - checksum: 149f54f5d11773ce938c60a2c36306720a1824eccb62bda0620170932c2783fa50ad0226254c5741a962e35c7ccba5f4e4c402b8618cb3b4f2cf47bf5e6ade31 + checksum: 711ffc8ef891ca6597b19539075ec3e08bb9b4c2ca1f78887e3c07a977ab91ac1421940505a197758fb5939aa9524976d0a5bbcac34d07ed6faa75cedbb17206 languageName: node linkType: hard @@ -14418,9 +14591,9 @@ __metadata: linkType: hard "word-wrap@npm:~1.2.3": - version: 1.2.3 - resolution: "word-wrap@npm:1.2.3" - checksum: 30b48f91fcf12106ed3186ae4fa86a6a1842416df425be7b60485de14bec665a54a68e4b5156647dec3a70f25e84d270ca8bc8cd23182ed095f5c7206a938c1f + version: 1.2.5 + resolution: "word-wrap@npm:1.2.5" + checksum: f93ba3586fc181f94afdaff3a6fef27920b4b6d9eaefed0f428f8e07adea2a7f54a5f2830ce59406c8416f033f86902b91eb824072354645eea687dff3691ccb languageName: node linkType: hard