From 08fde5f0e22bb08eabbd9ba80059adffa7e0cc23 Mon Sep 17 00:00:00 2001 From: wwestgarth Date: Fri, 16 Aug 2024 14:39:13 +0100 Subject: [PATCH 1/2] chore: update contracts and build them all as 0.8.13 --- ganache/prebuild | 22 - ganache/scripts/testing/test_tokens.js | 4 +- smartcontracts-base/Dockerfile | 9 +- smartcontracts-base/Makefile | 9 +- .../doc/data/files/abi/ERC20_Vesting_ABI.json | 717 ------------------ .../doc/data/files/abi/Migrations_ABI.json | 41 - .../files/abi/Vega_Staking_Bridge_ABI.json | 203 ----- .../contracts/ERC20_Vesting.sol | 386 ---------- .../contracts-solc-0.8.1/contracts/IStake.sol | 57 -- .../contracts/Migrations.sol | 19 - .../contracts/Vega_Staking_Bridge.sol | 105 --- .../migrations/2_contracts.js | 42 - .../build/doc/data/files/abi/IERC20_ABI.json | 0 .../build/doc/data/files/abi/IStake_ABI.json | 20 +- .../doc/data/files/abi/Migrations_ABI.json | 0 .../contracts/Base_Faucet_Token.sol | 6 +- .../contracts/ERC20.sol | 2 +- .../contracts/ERC20Detailed.sol | 2 +- .../contracts/ERC20_Asset_Pool.sol | 67 +- .../ERC20_Bridge_Logic_Restricted.sol | 270 +++---- .../contracts/IERC20.sol | 2 +- .../IERC20_Bridge_Logic_Restricted.sol | 130 ++-- .../contracts/IMultisigControl.sol | 38 +- .../contracts/IStake.sol | 22 + .../contracts/Killable.sol | 2 +- .../contracts/Migrations.sol | 2 +- .../contracts/MultisigControl.sol} | 102 +-- .../contracts/Ownable.sol | 2 +- .../contracts/SafeMath.sol | 2 +- .../contracts/StakingBridge.sol | 71 ++ .../migrations/1_initial_migration.js | 0 .../migrations/2_contracts.js | 88 +-- .../migrations/token_config.json | 0 .../truffle-config.js | 2 +- .../build/doc/.allmark/config | 75 -- .../build/doc/data/files/.gitkeep | 1 - .../data/files/abi/Base_Faucet_Token_ABI.json | 487 ------------ .../doc/data/files/abi/ERC20Detailed_ABI.json | 224 ------ .../build/doc/data/files/abi/ERC20_ABI.json | 316 -------- .../data/files/abi/ERC20_Asset_Pool_ABI.json | 138 ---- .../ERC20_Bridge_Logic_Restricted_ABI.json | 589 -------------- .../build/doc/data/files/abi/IERC20_ABI.json | 185 ----- .../IERC20_Bridge_Logic_Restricted_ABI.json | 539 ------------- .../data/files/abi/IMultisigControl_ABI.json | 252 ------ .../files/abi/IVega_StakingBridge_ABI.json | 20 - .../doc/data/files/abi/Killable_ABI.json | 74 -- .../data/files/abi/MultisigControl_ABI.json | 276 ------- .../build/doc/data/files/abi/Ownable_ABI.json | 72 -- .../doc/data/files/abi/SafeMath_ABI.json | 1 - .../build/doc/data/index.md | 5 - .../contracts-solc-0.8.8/contracts/IERC20.sol | 81 -- .../contracts/MultisigControl.sol | 224 ------ .../migrations/1_initial_migration.js | 5 - .../contracts-solc-0.8.8/truffle-config.js | 26 - smartcontracts-base/run | 5 +- smartcontracts-base/version.json | 2 +- 56 files changed, 453 insertions(+), 5588 deletions(-) delete mode 100644 smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/ERC20_Vesting_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/Migrations_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/Vega_Staking_Bridge_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.1/contracts/ERC20_Vesting.sol delete mode 100644 smartcontracts-base/contracts-solc-0.8.1/contracts/IStake.sol delete mode 100644 smartcontracts-base/contracts-solc-0.8.1/contracts/Migrations.sol delete mode 100644 smartcontracts-base/contracts-solc-0.8.1/contracts/Vega_Staking_Bridge.sol delete mode 100644 smartcontracts-base/contracts-solc-0.8.1/migrations/2_contracts.js rename smartcontracts-base/{contracts-solc-0.8.1 => contracts-solc-0.8.13}/build/doc/data/files/abi/IERC20_ABI.json (100%) rename smartcontracts-base/{contracts-solc-0.8.1 => contracts-solc-0.8.13}/build/doc/data/files/abi/IStake_ABI.json (87%) rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/build/doc/data/files/abi/Migrations_ABI.json (100%) rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/contracts/Base_Faucet_Token.sol (92%) rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/contracts/ERC20.sol (99%) rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/contracts/ERC20Detailed.sol (98%) rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/contracts/ERC20_Asset_Pool.sol (68%) rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/contracts/ERC20_Bridge_Logic_Restricted.sol (52%) rename smartcontracts-base/{contracts-solc-0.8.1 => contracts-solc-0.8.13}/contracts/IERC20.sol (99%) rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/contracts/IERC20_Bridge_Logic_Restricted.sol (64%) rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/contracts/IMultisigControl.sol (85%) create mode 100644 smartcontracts-base/contracts-solc-0.8.13/contracts/IStake.sol rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/contracts/Killable.sol (93%) rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/contracts/Migrations.sol (93%) rename smartcontracts-base/{contracts-solc-0.8.8/contracts/MultisigControlV2.sol => contracts-solc-0.8.13/contracts/MultisigControl.sol} (74%) rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/contracts/Ownable.sol (98%) rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/contracts/SafeMath.sol (97%) create mode 100644 smartcontracts-base/contracts-solc-0.8.13/contracts/StakingBridge.sol rename smartcontracts-base/{contracts-solc-0.8.1 => contracts-solc-0.8.13}/migrations/1_initial_migration.js (100%) rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/migrations/2_contracts.js (76%) rename smartcontracts-base/{contracts-solc-0.8.8 => contracts-solc-0.8.13}/migrations/token_config.json (100%) rename smartcontracts-base/{contracts-solc-0.8.1 => contracts-solc-0.8.13}/truffle-config.js (93%) delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/.allmark/config delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/.gitkeep delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Base_Faucet_Token_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20Detailed_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20_Asset_Pool_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20_Bridge_Logic_Restricted_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IERC20_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IERC20_Bridge_Logic_Restricted_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IMultisigControl_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IVega_StakingBridge_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Killable_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/MultisigControl_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Ownable_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/SafeMath_ABI.json delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/build/doc/data/index.md delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/contracts/IERC20.sol delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/contracts/MultisigControl.sol delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/migrations/1_initial_migration.js delete mode 100644 smartcontracts-base/contracts-solc-0.8.8/truffle-config.js diff --git a/ganache/prebuild b/ganache/prebuild index c2207d4..d6ec582 100755 --- a/ganache/prebuild +++ b/ganache/prebuild @@ -34,25 +34,3 @@ nohup \ GANACHE_HOSTNAME="127.0.0.1" \ TRUFFLE_NETWORK="development" \ GANACHE_PORT="${GANACHE_PORT}" ./run - - -sleep 5; -echo "###################################################################"; -echo "# #"; -echo "# RUNNING MIGRATIONS FOR SECONDARY GANACHE #"; -echo "# #"; -echo "###################################################################"; - -nohup \ - bash -c "node /app/dist/node/cli.js\ - --miner.blockTime 1 \ - --chain.chainId 1450 \ - --chain.networkId 1451 \ - --wallet.mnemonic \"${GANACHE_MNEMONIC}\" \ - --database.dbPath /app/ganache-db-secondary \ - -h 0.0.0.0 \ - -p \"${GANACHE_PORT_SECONDARY}\" &" \ - && GANACHE_MNEMONIC="${GANACHE_MNEMONIC}" \ - GANACHE_HOSTNAME="127.0.0.1" \ - TRUFFLE_NETWORK="secondary" \ - GANACHE_PORT="${GANACHE_PORT_SECONDARY}" ./run \ No newline at end of file diff --git a/ganache/scripts/testing/test_tokens.js b/ganache/scripts/testing/test_tokens.js index 10db9c0..84d616d 100644 --- a/ganache/scripts/testing/test_tokens.js +++ b/ganache/scripts/testing/test_tokens.js @@ -3,7 +3,7 @@ const Web3 = require("web3"); var assert = require('assert'); -let abi = require("./../../../smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Base_Faucet_Token_ABI.json"); +let abi = require("./../../../smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Base_Faucet_Token_ABI.json"); const contractOwner = { 'private': 'a37f4c2a678aefb5037bf415a826df1540b330b7e471aa54184877ba901b9ef0', 'public': '0xEe7D375bcB50C26d52E1A4a472D8822A2A22d94F' @@ -11,7 +11,7 @@ const contractOwner = { const randomAccount = '0xCcFb83E3b85e70Fd815C2C690B21E48F7170926B'; const vegaAddress = '0xFcE3C7CBba976414621887F2D762e7fB0f90b5c1'; -const tUSDCEthAddress = '0x9dFD86Aa69c1ad549568c9d51bf2dB27cbDeF2cD'; +const tUSDCEthAddress = '0x1b8a1B6CBE5c93609b46D1829Cc7f3Cb8eeE23a0'; const tBTCEthAddress = '0x67175Da1D5e966e40D11c4B2519392B2058373de'; diff --git a/smartcontracts-base/Dockerfile b/smartcontracts-base/Dockerfile index d633ad5..851d708 100644 --- a/smartcontracts-base/Dockerfile +++ b/smartcontracts-base/Dockerfile @@ -1,5 +1,4 @@ -FROM ethereum/solc:0.8.8 AS solc088 -FROM ethereum/solc:0.8.1 AS solc081 +FROM ethereum/solc:0.8.13 AS solc0813 FROM node:20.3-alpine AS builder RUN mkdir /app @@ -20,13 +19,11 @@ LABEL org.opencontainers.image.source https://github.com/vegaprotocol/devops-inf WORKDIR /app2 ENV PATH="$PATH:/app2/node_modules/.bin" -COPY --from=solc088 /usr/bin/solc /usr/bin/solc-v0.8.8 -COPY --from=solc081 /usr/bin/solc /usr/bin/solc-v0.8.1 +COPY --from=solc0813 /usr/bin/solc /usr/bin/solc-v0.8.13 COPY --from=builder /app/package*.json ./ COPY --from=builder /app/node_modules ./node_modules -ADD contracts-solc-0.8.1 ./contracts-solc-0.8.1 -ADD contracts-solc-0.8.8 ./contracts-solc-0.8.8 +ADD contracts-solc-0.8.13 ./contracts-solc-0.8.13 ADD scripts ./scripts ADD run ./run \ No newline at end of file diff --git a/smartcontracts-base/Makefile b/smartcontracts-base/Makefile index c8e2b16..d321e73 100644 --- a/smartcontracts-base/Makefile +++ b/smartcontracts-base/Makefile @@ -1,7 +1,7 @@ # Makefile #defauls -VERSION=0.8.8 +VERSION=0.8.13 .PHONY: default default: abi @@ -25,10 +25,3 @@ abi: jq --sort-keys . <"$$abifile" >"$${abifile%.abi}_ABI.json" && rm "$$abifile" ; \ done -.PHONY: abi-0.8.8 -abi-0.8.8: VERSION=0.8.8 -abi-0.8.8: abi - -.PHONY: abi-0.8.1 -abi-0.8.1: VERSION=0.8.1 -abi-0.8.1: abi \ No newline at end of file diff --git a/smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/ERC20_Vesting_ABI.json b/smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/ERC20_Vesting_ABI.json deleted file mode 100644 index 24de2c5..0000000 --- a/smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/ERC20_Vesting_ABI.json +++ /dev/null @@ -1,717 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "token_v1_address", - "type": "address" - }, - { - "internalType": "address", - "name": "token_v2_address", - "type": "address" - }, - { - "internalType": "address[]", - "name": "old_addresses", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "new_addresses", - "type": "address[]" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "new_controller", - "type": "address" - } - ], - "name": "Controller_Set", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Issuer_Permitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "issuer", - "type": "address" - } - ], - "name": "Issuer_Revoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "Stake_Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "Stake_Removed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "Stake_Transferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint8", - "name": "tranche_id", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Tranche_Balance_Added", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint8", - "name": "tranche_id", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Tranche_Balance_Removed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint8", - "name": "tranche_id", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "cliff_start", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "Tranche_Created", - "type": "event" - }, - { - "inputs": [], - "name": "accuracy_scale", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "address_migration", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "tranche_id", - "type": "uint8" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "assisted_withdraw_from_tranche", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "controller", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "cliff_start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "create_tranche", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "default_tranche_id", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint8", - "name": "tranche_id", - "type": "uint8" - } - ], - "name": "get_tranche_balance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint8", - "name": "tranche_id", - "type": "uint8" - } - ], - "name": "get_vested_for_tranche", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint8", - "name": "tranche_id", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "issue_into_tranche", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint8", - "name": "tranche_id", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "move_into_tranche", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "permit_issuer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "permitted_issuance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "remove_stake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - } - ], - "name": "revoke_issuer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "new_controller", - "type": "address" - } - ], - "name": "set_controller", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "stake_balance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "stake_tokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "staking_token", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "total_locked", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "total_staked", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tranche_count", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "name": "tranches", - "outputs": [ - { - "internalType": "uint256", - "name": "cliff_start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "user_stats", - "outputs": [ - { - "internalType": "uint256", - "name": "total_in_all_tranches", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lien", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "user_total_all_tranches", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "v1_address", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "v1_migrated", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "v2_address", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "tranche_id", - "type": "uint8" - } - ], - "name": "withdraw_from_tranche", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/Migrations_ABI.json b/smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/Migrations_ABI.json deleted file mode 100644 index 7977a69..0000000 --- a/smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/Migrations_ABI.json +++ /dev/null @@ -1,41 +0,0 @@ -[ - { - "inputs": [], - "name": "last_completed_migration", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "completed", - "type": "uint256" - } - ], - "name": "setCompleted", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/Vega_Staking_Bridge_ABI.json b/smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/Vega_Staking_Bridge_ABI.json deleted file mode 100644 index ef82f41..0000000 --- a/smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/Vega_Staking_Bridge_ABI.json +++ /dev/null @@ -1,203 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "Stake_Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "Stake_Removed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "Stake_Transferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "remove_stake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "stake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "stake_balance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "staking_token", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "total_staked", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "new_address", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "transfer_stake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.1/contracts/ERC20_Vesting.sol b/smartcontracts-base/contracts-solc-0.8.1/contracts/ERC20_Vesting.sol deleted file mode 100644 index ccc5a74..0000000 --- a/smartcontracts-base/contracts-solc-0.8.1/contracts/ERC20_Vesting.sol +++ /dev/null @@ -1,386 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.1; - -import "./IERC20.sol"; -import "./IStake.sol"; - -/// @title ERC20 Vesting -/// @author Vega Protocol -/// @notice This contract manages the vesting of the Vega V2 ERC20 token -contract ERC20_Vesting is IStake { - - event Tranche_Created(uint8 indexed tranche_id, uint256 cliff_start, uint256 duration); - event Tranche_Balance_Added(address indexed user, uint8 indexed tranche_id, uint256 amount); - event Tranche_Balance_Removed(address indexed user, uint8 indexed tranche_id, uint256 amount); - event Issuer_Permitted(address indexed issuer, uint256 amount); - event Issuer_Revoked(address indexed issuer); - event Controller_Set(address indexed new_controller); - - /// @notice controller is similar to "owner" in other contracts - address public controller; - /// @notice tranche_count starts at 1 to cause tranche 0 (perma-lock) to exist as the default tranche - uint8 public tranche_count = 1; - /// @notice user => has been migrated - mapping(address => bool) public v1_migrated; - /// @notice user => user_stat struct - mapping(address=> user_stat) public user_stats; - - /// @notice total_locked is the total amount of tokens "on" this contract that are locked into a tranche - uint256 public total_locked; - /// @notice v1_address is the address for Vega's v1 ERC20 token that has already been deployed - address public v1_address; // mainnet = 0xD249B16f61cB9489Fe0Bb046119A48025545b58a; - /// @notice v2_address is the address for Vega's v2 ERC20 token that replaces v1 - address public v2_address; - /// @notice accuracy_scale is the multiplier to assist in integer division - uint256 constant public accuracy_scale = 100000000000; - /// @notice default_tranche_id is the tranche_id for the default tranche - uint8 constant public default_tranche_id = 0; - /// @dev total_staked_tokens is the number of tokens staked across all users - uint256 total_staked_tokens; - - /****ADDRESS MIGRATION**/ - /// @notice new address => old address - mapping(address => address) public address_migration; - /*****/ - - /// @param token_v1_address Vega's already deployed v1 ERC20 token address - /// @param token_v2_address Vega's v2 ERC20 token and the token being vested here - /// @dev emits Controller_Set event - constructor(address token_v1_address, address token_v2_address, address[] memory old_addresses, address[] memory new_addresses) { - require(old_addresses.length == new_addresses.length, "array length mismatch"); - - for(uint8 map_idx = 0; map_idx < old_addresses.length; map_idx++) { - /// @dev the following line prevents double-mapping attack - require(!v1_migrated[old_addresses[map_idx]]); - v1_migrated[old_addresses[map_idx]] = true; - address_migration[new_addresses[map_idx]] = old_addresses[map_idx]; - } - - v1_address = token_v1_address; - /// @notice this initializes the total_locked with the amount of already issued v1 VEGA ERC20 tokens - total_locked = IERC20(token_v1_address).totalSupply() - IERC20(token_v1_address).balanceOf(token_v1_address); - v2_address = token_v2_address; - controller = msg.sender; - emit Controller_Set(controller); - } - - /// @notice tranche_balance has the params necessary to track what a user is owed in a single tranche - /// @param total_deposited is the total number of tokens deposited into this single tranche for a single user - /// @param total_claimed is the total number of tokens in this tranche that have been withdrawn - struct tranche_balance { - uint256 total_deposited; - uint256 total_claimed; - } - - /// @notice user_stat is a struct that holds all the details needed to handle a single user's vesting - /// @param total_in_all_tranches is the total number of tokens currently in all tranches that have been migrated to v2 - /// @param lien total amount of locked tokens that have been marked for staking - /// @param tranche_balances is a mapping of tranche_id => tranche_balance - struct user_stat { - uint256 total_in_all_tranches; - uint256 lien; - mapping (uint8 => tranche_balance) tranche_balances; - mapping(bytes32 => uint256) stake; - } - - /// @notice tranche is a struct that hold the details needed for calculating individual tranche vesting - /// @param cliff_start is a timestamp after which vesting starts - /// @param duration is the number of seconds after cliff_start until the tranche is 100% vested - struct tranche { - uint256 cliff_start; - uint256 duration; - } - - /// @notice tranche_id => tranche struct - mapping(uint8 => tranche) public tranches; - /// @notice issuer address => permitted issuance allowance - mapping(address => uint256) public permitted_issuance; - - /// @notice this function allows the contract controller to create a tranche - /// @notice tranche zero is perma-locked and already exists prior to running this function, making the first vesting tranche "tranche:1" - /// @param cliff_start is a timestamp in seconds of when vesting begins for this tranche - /// @param duration is the number of seconds after cliff_start that the tranche will be fully vested - function create_tranche(uint256 cliff_start, uint256 duration) public only_controller { - tranches[tranche_count] = tranche(cliff_start, duration); - emit Tranche_Created(tranche_count, cliff_start, duration); - /// @notice sol ^0.8 comes with auto-overflow protection - tranche_count++; - } - - /// @notice this function allows the conroller or permitted issuer to issue tokens from this contract itself (no tranches) into the specified tranche - /// @notice tranche MUST be created - /// @notice once assigned to a tranche, tokens can never be clawed back, but they can be reassigned IFF they are in tranche_id:0 - /// @param user The user being issued the tokens - /// @param tranche_id the id of the target tranche - /// @param amount number of tokens to be issued into tranche - /// @dev emits Tranche_Balance_Added event - function issue_into_tranche(address user, uint8 tranche_id, uint256 amount) public controller_or_issuer { - require(tranche_id < tranche_count, "tranche_id out of bounds"); - if(permitted_issuance[msg.sender] > 0){ - /// @dev if code gets here, they are an issuer if not they must be the controller - require(permitted_issuance[msg.sender] >= amount, "not enough permitted balance"); - require(user != msg.sender, "cannot issue to self"); - permitted_issuance[msg.sender] -= amount; - } - require( IERC20(v2_address).balanceOf(address(this)) - (total_locked + amount) >= 0, "contract token balance low" ); - - /// @dev only runs once - if(!v1_migrated[user]){ - uint256 bal = v1_bal(user); - user_stats[user].tranche_balances[0].total_deposited += bal; - user_stats[user].total_in_all_tranches += bal; - v1_migrated[user] = true; - } - user_stats[user].tranche_balances[tranche_id].total_deposited += amount; - user_stats[user].total_in_all_tranches += amount; - total_locked += amount; - emit Tranche_Balance_Added(user, tranche_id, amount); - } - - - /// @notice this function allows the controller to move tokens issued into tranche zero to the target tranche - /// @notice can only be moved from tranche 0 - /// @param user The user being issued the tokens - /// @param tranche_id the id of the target tranche - /// @param amount number of tokens to be moved from tranche 0 - /// @dev emits Tranche_Balance_Removed event - /// @dev emits Tranche_Balance_Added event - function move_into_tranche(address user, uint8 tranche_id, uint256 amount) public only_controller { - require(tranche_id > 0 && tranche_id < tranche_count); - - /// @dev only runs once - if(!v1_migrated[user]){ - uint256 bal = v1_bal(user); - user_stats[user].tranche_balances[default_tranche_id].total_deposited += bal; - user_stats[user].total_in_all_tranches += bal; - v1_migrated[user] = true; - } - require(user_stats[user].tranche_balances[default_tranche_id].total_deposited >= amount); - user_stats[user].tranche_balances[default_tranche_id].total_deposited -= amount; - user_stats[user].tranche_balances[tranche_id].total_deposited += amount; - emit Tranche_Balance_Removed(user, default_tranche_id, amount); - emit Tranche_Balance_Added(user, tranche_id, amount); - } - - /// @notice this view returns the balance of the given tranche for the given user - /// @notice tranche 0 balance of a non-v1_migrated user will return user's v1 token balance as they are pre-issued to the current hodlers - /// @param user Target user address - /// @param tranche_id target tranche - /// @return balance of target tranche of user - function get_tranche_balance(address user, uint8 tranche_id) public view returns(uint256) { - if(tranche_id == default_tranche_id && !v1_migrated[user]){ - return v1_bal(user); - } else { - return user_stats[user].tranche_balances[tranche_id].total_deposited - user_stats[user].tranche_balances[tranche_id].total_claimed; - } - } - - /// @notice This view returns the amount that is currently vested in a given tranche - /// @notice This does NOT take into account any current lien - /// @param user Target user address - /// @param tranche_id Target tranche - /// @return number of tokens vested in the target tranche for the target user - function get_vested_for_tranche(address user, uint8 tranche_id) public view returns(uint256) { - if(block.timestamp < tranches[tranche_id].cliff_start){ - return 0; - } - else if(block.timestamp > tranches[tranche_id].cliff_start + tranches[tranche_id].duration || tranches[tranche_id].duration == 0){ - return user_stats[user].tranche_balances[tranche_id].total_deposited - user_stats[user].tranche_balances[tranche_id].total_claimed; - } else { - return (((( accuracy_scale * (block.timestamp - tranches[tranche_id].cliff_start) ) / tranches[tranche_id].duration - ) * user_stats[user].tranche_balances[tranche_id].total_deposited - ) / accuracy_scale ) - user_stats[user].tranche_balances[tranche_id].total_claimed; - } - } - - /// @notice This view returns the balance remaining in Vega V1 for a given user - /// @notice Once migrated, the balance will always return zero, hence "remaining" - /// @param user Target user - /// @return remaining v1 balance - function v1_bal(address user) internal view returns(uint256) { - if(!v1_migrated[user]){ - if(address_migration[user] != address(0)){ - return IERC20(v1_address).balanceOf(user) + IERC20(v1_address).balanceOf(address_migration[user]); - } else { - return IERC20(v1_address).balanceOf(user); - } - } else { - return 0; - } - } - - /// @notice This view returns the current amount of tokens locked in all tranches - /// @notice This includes remaining v1 balance - /// @param user Target user - /// @return the current amount of tokens for target user in all tranches - function user_total_all_tranches(address user) public view returns(uint256){ - return user_stats[user].total_in_all_tranches + v1_bal(user); - } - - /// @notice This function withdraws all the currently available vested tokens from the target tranche - /// @notice This will not allow a user's total tranch balance to go below the user's lien amount - /// @dev Emits Tranche_Balance_Removed event if successful - /// @param tranche_id Id of target tranche - function withdraw_from_tranche(uint8 tranche_id) public { - require(tranche_id != default_tranche_id); - uint256 to_withdraw = get_vested_for_tranche(msg.sender, tranche_id); - require(user_stats[msg.sender].total_in_all_tranches - to_withdraw >= user_stats[msg.sender].lien); - user_stats[msg.sender].tranche_balances[tranche_id].total_claimed += to_withdraw; - /// @dev Solidity ^0.8 has overflow protection, if this next line overflows, the transaction will revert - user_stats[msg.sender].total_in_all_tranches -= to_withdraw; - /// @dev Solidity ^0.8 has overflow protection, if this next line overflows, the transaction will revert - total_locked -= to_withdraw; - require(IERC20(v2_address).transfer(msg.sender, to_withdraw)); - emit Tranche_Balance_Removed(msg.sender, tranche_id, to_withdraw); - } - - /// @notice This function allows the controller to assist the target user with their withdrawal. All the currently available vested tokens FOR THE TARGET will be withdrawn TO THE TARGET ADDRESS WALLET - /// @notice This function exists in case of users using custodial wallets that are incapable of running "withdraw_from_tranche" but are still ERC20 compatable - /// @notice ONLY the controller can run this function and it will only be ran at the target users request - /// @notice This will not allow a user's total tranch balance to go below the user's lien amount - /// @notice This function does not allow the controller to access any funds from other addresses or change which address is in control of any funds - /// @dev Emits Tranche_Balance_Removed event if successful - /// @param tranche_id Id of target tranche - /// @param target Address with balance that needs the assist - function assisted_withdraw_from_tranche(uint8 tranche_id, address target) public only_controller { - require(tranche_id != default_tranche_id); - uint256 to_withdraw = get_vested_for_tranche(target, tranche_id); - require(user_stats[target].total_in_all_tranches - to_withdraw >= user_stats[target].lien); - user_stats[target].tranche_balances[tranche_id].total_claimed += to_withdraw; - /// @dev Solidity ^0.8 has overflow protection, if this next line overflows, the transaction will revert - user_stats[target].total_in_all_tranches -= to_withdraw; - /// @dev Solidity ^0.8 has overflow protection, if this next line overflows, the transaction will revert - total_locked -= to_withdraw; - require(IERC20(v2_address).transfer(target, to_withdraw)); - emit Tranche_Balance_Removed(target, tranche_id, to_withdraw); - } - - - /// @notice This function will put a lien on the user who runs this function - /// @dev Emits Stake_Deposited event if successful - /// @param amount Amount of tokens to stake - /// @param vega_public_key Target Vega public key to be credited with the stake lock - function stake_tokens(uint256 amount, bytes32 vega_public_key) public { - require(user_stats[msg.sender].lien + amount > user_stats[msg.sender].lien); - require(user_total_all_tranches(msg.sender) >= user_stats[msg.sender].lien + amount); - /// @dev Solidity ^0.8 has overflow protection, if this next line overflows, the transaction will revert - user_stats[msg.sender].lien += amount; - user_stats[msg.sender].stake[vega_public_key] += amount; - total_staked_tokens += amount; - emit Stake_Deposited(msg.sender, amount, vega_public_key); - } - - /// @notice This function will remove the lien from the user who runs this function - /// @notice clears "amount" of lien - /// @dev emits Stake_Removed event if successful - /// @param amount Amount of tokens to remove from Staking - /// @param vega_public_key Target Vega public key from which to remove stake lock - function remove_stake(uint256 amount, bytes32 vega_public_key) public { - /// @dev Solidity ^0.8 has overflow protection, if this next line overflows, the transaction will revert - user_stats[msg.sender].stake[vega_public_key] -= amount; - /// @dev Solidity ^0.8 has overflow protection, if this next line overflows, the transaction will revert - user_stats[msg.sender].lien -= amount; - total_staked_tokens -= amount; - emit Stake_Removed(msg.sender, amount, vega_public_key); - } - - /// @notice This function allows the controller to permit the given address to issue the given Amount - /// @notice Target users MUST have a zero (0) permitted issuance balance (try revoke_issuer) - /// @dev emits Issuer_Permitted event - /// @param issuer Target address to be allowed to issue given amount - /// @param amount Number of tokens issuer is permitted to issue - function permit_issuer(address issuer, uint256 amount) public only_controller { - /// @notice revoke is required first to stop a simple double allowance attack - require(amount > 0, "amount must be > 0"); - require(permitted_issuance[issuer] == 0, "issuer already permitted, revoke first"); - require(controller != issuer, "controller cannot be permitted issuer"); - permitted_issuance[issuer] = amount; - emit Issuer_Permitted(issuer, amount); - } - - /// @notice This function allows the controller to revoke issuance permission from given target - /// @notice permitted_issuance must be greater than zero (0) - /// @dev emits Issuer_Revoked event - /// @param issuer Target address of issuer to be revoked - function revoke_issuer(address issuer) public only_controller { - require(permitted_issuance[issuer] != 0, "issuer already revoked"); - permitted_issuance[issuer] = 0; - emit Issuer_Revoked(issuer); - } - - /// @notice This function allows the controller to assign a new controller - /// @dev Emits Controller_Set event - /// @param new_controller Address of the new controller - function set_controller(address new_controller) public only_controller { - controller = new_controller; - if(permitted_issuance[new_controller] > 0){ - permitted_issuance[new_controller] = 0; - emit Issuer_Revoked(new_controller); - } - emit Controller_Set(new_controller); - } - - /// @dev This is IStake.staking_token - /// @return the address of the token that is able to be staked - function staking_token() external override view returns (address) { - return v2_address; - } - - /// @dev This is IStake.stake_balance - /// @param target Target address to check - /// @param vega_public_key Target vega public key to check - /// @return the number of tokens staked for that address->vega_public_key pair - function stake_balance(address target, bytes32 vega_public_key) external override view returns (uint256) { - return user_stats[target].stake[vega_public_key]; - } - - /// @dev This is IStake.total_staked - /// @return total tokens staked on contract - function total_staked() external override view returns (uint256) { - return total_staked_tokens; - } - - /// @notice this modifier requires that msg.sender is the controller of this contract - modifier only_controller { - require( msg.sender == controller, "not controller" ); - _; - } - - /// @notice this modifier requires that msg.sender is the controller of this contract or has a permitted issuance remaining of more than zero (0) - modifier controller_or_issuer { - require( msg.sender == controller || permitted_issuance[msg.sender] > 0,"not controller or issuer" ); - _; - } -} - -/** -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMWEMMMMMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM -MMMMMMLOVEMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM -MMMMMMMMMMHIXELMMMMMMMMMMMM....................MMMMMNNMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMM....................MMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMM88=........................+MMMMMMMMMM -MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM -MMMMMMMMMMMM.........................MM+..MMM....+MMMMMMMMMM -MMMMMMMMMNMM...................... ..MM?..MMM.. .+MMMMMMMMMM -MMMMNDDMM+........................+MM........MM..+MMMMMMMMMM -MMMMZ.............................+MM....................MMM -MMMMZ.............................+MM....................MMM -MMMMZ.............................+MM....................DDD -MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM -MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM -MM..............................MMZ....ZMMMMMMMMMMMMMMMMMMMM -MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM -MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM -MM......................ZMMMMM.......MMMMMMMMMMMMMMMMMMMMMMM -MM............... ......ZMMMMM.... ..MMMMMMMMMMMMMMMMMMMMMMM -MM...............MMMMM88~.........+MM..ZMMMMMMMMMMMMMMMMMMMM -MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM -MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM -MM.......ZMMMMMMM.......ZMMMMM..MMMMM..ZMMMMMMMMMMMMMMMMMMMM -MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM*/ \ No newline at end of file diff --git a/smartcontracts-base/contracts-solc-0.8.1/contracts/IStake.sol b/smartcontracts-base/contracts-solc-0.8.1/contracts/IStake.sol deleted file mode 100644 index 389687f..0000000 --- a/smartcontracts-base/contracts-solc-0.8.1/contracts/IStake.sol +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.1; - -/** - * @dev Interface contains all of the events necessary for staking Vega token - */ -interface IStake { - event Stake_Deposited(address indexed user, uint256 amount, bytes32 indexed vega_public_key); - event Stake_Removed(address indexed user, uint256 amount, bytes32 indexed vega_public_key); - event Stake_Transferred(address indexed from, uint256 amount, address indexed to, bytes32 indexed vega_public_key); - - /// @return the address of the token that is able to be staked - function staking_token() external view returns (address); - - /// @param target Target address to check - /// @param vega_public_key Target vega public key to check - /// @return the number of tokens staked for that address->vega_public_key pair - function stake_balance(address target, bytes32 vega_public_key) external view returns (uint256); - - - /// @return total tokens staked on contract - function total_staked() external view returns (uint256); -} - - -/** -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMWEMMMMMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM -MMMMMMLOVEMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM -MMMMMMMMMMHIXELMMMMMMMMMMMM....................MMMMMNNMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMM....................MMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMM88=........................+MMMMMMMMMM -MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM -MMMMMMMMMMMM.........................MM+..MMM....+MMMMMMMMMM -MMMMMMMMMNMM...................... ..MM?..MMM.. .+MMMMMMMMMM -MMMMNDDMM+........................+MM........MM..+MMMMMMMMMM -MMMMZ.............................+MM....................MMM -MMMMZ.............................+MM....................MMM -MMMMZ.............................+MM....................DDD -MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM -MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM -MM..............................MMZ....ZMMMMMMMMMMMMMMMMMMMM -MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM -MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM -MM......................ZMMMMM.......MMMMMMMMMMMMMMMMMMMMMMM -MM............... ......ZMMMMM.... ..MMMMMMMMMMMMMMMMMMMMMMM -MM...............MMMMM88~.........+MM..ZMMMMMMMMMMMMMMMMMMMM -MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM -MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM -MM.......ZMMMMMMM.......ZMMMMM..MMMMM..ZMMMMMMMMMMMMMMMMMMMM -MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM*/ diff --git a/smartcontracts-base/contracts-solc-0.8.1/contracts/Migrations.sol b/smartcontracts-base/contracts-solc-0.8.1/contracts/Migrations.sol deleted file mode 100644 index 52283da..0000000 --- a/smartcontracts-base/contracts-solc-0.8.1/contracts/Migrations.sol +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.1; - -contract Migrations { - address public owner = msg.sender; - uint public last_completed_migration; - - modifier restricted() { - require( - msg.sender == owner, - "This function is restricted to the contract's owner" - ); - _; - } - - function setCompleted(uint completed) public restricted { - last_completed_migration = completed; - } -} diff --git a/smartcontracts-base/contracts-solc-0.8.1/contracts/Vega_Staking_Bridge.sol b/smartcontracts-base/contracts-solc-0.8.1/contracts/Vega_Staking_Bridge.sol deleted file mode 100644 index b82432a..0000000 --- a/smartcontracts-base/contracts-solc-0.8.1/contracts/Vega_Staking_Bridge.sol +++ /dev/null @@ -1,105 +0,0 @@ - -//SPDX-License-Identifier: MIT -pragma solidity 0.8.1; - -import "./IERC20.sol"; -import "./IStake.sol"; - -/// @title ERC20 Staking Bridge -/// @author Vega Protocol -/// @notice This contract manages the vesting of the Vega V2 ERC20 token -contract Vega_Staking_Bridge is IStake { - address _staking_token; - - constructor(address token) { - _staking_token = token; - } - - /// @dev user => amount staked - mapping(address => mapping(bytes32 => uint256)) stakes; - - /// @notice This stakes the given amount of tokens and credits them to the provided Vega public key - /// @param amount Token amount to stake - /// @param vega_public_key Target Vega public key to be credited with the stake - /// @dev Emits Stake_Deposited event - /// @dev User MUST run "approve" on token prior to running Stake - function stake(uint256 amount, bytes32 vega_public_key) public { - require(IERC20(_staking_token).transferFrom(msg.sender, address(this), amount)); - stakes[msg.sender][vega_public_key] += amount; - emit Stake_Deposited(msg.sender, amount, vega_public_key); - } - - /// @notice This removes specified amount of stake of available to user - /// @dev Emits Stake_Removed event if successful - /// @param amount Amount of tokens to remove from staking - /// @param vega_public_key Target Vega public key from which to deduct stake - function remove_stake(uint256 amount, bytes32 vega_public_key) public { - stakes[msg.sender][vega_public_key] -= amount; - require(IERC20(_staking_token).transfer(msg.sender, amount)); - emit Stake_Removed(msg.sender, amount, vega_public_key); - } - - /// @notice This transfers all stake from the sender's address to the "new_address" - /// @dev Emits Stake_Transfered event if successful - /// @param amount Stake amount to transfer - /// @param new_address Target ETH address to recieve the stake - /// @param vega_public_key Target Vega public key to be credited with the transfer - function transfer_stake(uint256 amount, address new_address, bytes32 vega_public_key) public { - stakes[msg.sender][vega_public_key] -= amount; - stakes[new_address][vega_public_key] += amount; - emit Stake_Transferred(msg.sender, amount, new_address, vega_public_key); - } - - /// @dev This is IStake.staking_token - /// @return the address of the token that is able to be staked - function staking_token() external override view returns (address) { - return _staking_token; - } - - /// @dev This is IStake.stake_balance - /// @param target Target address to check - /// @param vega_public_key Target vega public key to check - /// @return the number of tokens staked for that address->vega_public_key pair - function stake_balance(address target, bytes32 vega_public_key) external override view returns (uint256) { - return stakes[target][vega_public_key]; - } - - /// @dev This is IStake.total_staked - /// @return total tokens staked on contract - function total_staked() external override view returns (uint256) { - return IERC20(_staking_token).balanceOf(address(this)); - } -} - - -/** -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMWEMMMMMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM -MMMMMMLOVEMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM -MMMMMMMMMMHIXELMMMMMMMMMMMM....................MMMMMNNMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMM....................MMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMM88=........................+MMMMMMMMMM -MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM -MMMMMMMMMMMM.........................MM+..MMM....+MMMMMMMMMM -MMMMMMMMMNMM...................... ..MM?..MMM.. .+MMMMMMMMMM -MMMMNDDMM+........................+MM........MM..+MMMMMMMMMM -MMMMZ.............................+MM....................MMM -MMMMZ.............................+MM....................MMM -MMMMZ.............................+MM....................DDD -MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM -MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM -MM..............................MMZ....ZMMMMMMMMMMMMMMMMMMMM -MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM -MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM -MM......................ZMMMMM.......MMMMMMMMMMMMMMMMMMMMMMM -MM............... ......ZMMMMM.... ..MMMMMMMMMMMMMMMMMMMMMMM -MM...............MMMMM88~.........+MM..ZMMMMMMMMMMMMMMMMMMMM -MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM -MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM -MM.......ZMMMMMMM.......ZMMMMM..MMMMM..ZMMMMMMMMMMMMMMMMMMMM -MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM*/ diff --git a/smartcontracts-base/contracts-solc-0.8.1/migrations/2_contracts.js b/smartcontracts-base/contracts-solc-0.8.1/migrations/2_contracts.js deleted file mode 100644 index 443dbde..0000000 --- a/smartcontracts-base/contracts-solc-0.8.1/migrations/2_contracts.js +++ /dev/null @@ -1,42 +0,0 @@ -const fs = require("fs"); - -const ERC20_Vesting = artifacts.require("ERC20_Vesting"); -const Vega_Staking_Bridge = artifacts.require("Vega_Staking_Bridge"); - -module.exports = async function (deployer) { - - - const workDir = process.env.VEGA_CONTRACTS_MIGRATION_WORKDIR || "/app"; - - - // should already have addresses deployed from before - let rawdata = fs.readFileSync(workDir + '/addresses.json'); - let addresses = JSON.parse(rawdata); - - await deployer.deploy( - ERC20_Vesting, - addresses["VEGAv1"].Ethereum, - addresses["VEGA"].Ethereum, - [], - [] - ); - - - // setup the staking bridge. - await deployer.deploy( - Vega_Staking_Bridge, - addresses["VEGA"].Ethereum - ); - - - // add contract addresses - addresses["erc20_vesting"] = { Ethereum: ERC20_Vesting.address }; - addresses["staking_bridge"] = { Ethereum: Vega_Staking_Bridge.address }; - - // Print and save the address data - console.log(addresses) - fs.writeFileSync( - workDir + "/addresses.json", - JSON.stringify(addresses, null, 2) - ); -}; diff --git a/smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/IERC20_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IERC20_ABI.json similarity index 100% rename from smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/IERC20_ABI.json rename to smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IERC20_ABI.json diff --git a/smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/IStake_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IStake_ABI.json similarity index 87% rename from smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/IStake_ABI.json rename to smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IStake_ABI.json index 13795e4..a9f96c9 100644 --- a/smartcontracts-base/contracts-solc-0.8.1/build/doc/data/files/abi/IStake_ABI.json +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IStake_ABI.json @@ -17,11 +17,11 @@ { "indexed": true, "internalType": "bytes32", - "name": "vega_public_key", + "name": "vegaPublicKey", "type": "bytes32" } ], - "name": "Stake_Deposited", + "name": "StakeDeposited", "type": "event" }, { @@ -42,11 +42,11 @@ { "indexed": true, "internalType": "bytes32", - "name": "vega_public_key", + "name": "vegaPublicKey", "type": "bytes32" } ], - "name": "Stake_Removed", + "name": "StakeRemoved", "type": "event" }, { @@ -73,11 +73,11 @@ { "indexed": true, "internalType": "bytes32", - "name": "vega_public_key", + "name": "vegaPublicKey", "type": "bytes32" } ], - "name": "Stake_Transferred", + "name": "StakeTransferred", "type": "event" }, { @@ -89,11 +89,11 @@ }, { "internalType": "bytes32", - "name": "vega_public_key", + "name": "vegaPublicKey", "type": "bytes32" } ], - "name": "stake_balance", + "name": "stakeBalance", "outputs": [ { "internalType": "uint256", @@ -106,7 +106,7 @@ }, { "inputs": [], - "name": "staking_token", + "name": "stakingToken", "outputs": [ { "internalType": "address", @@ -119,7 +119,7 @@ }, { "inputs": [], - "name": "total_staked", + "name": "totalStaked", "outputs": [ { "internalType": "uint256", diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Migrations_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Migrations_ABI.json similarity index 100% rename from smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Migrations_ABI.json rename to smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Migrations_ABI.json diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/Base_Faucet_Token.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/Base_Faucet_Token.sol similarity index 92% rename from smartcontracts-base/contracts-solc-0.8.8/contracts/Base_Faucet_Token.sol rename to smartcontracts-base/contracts-solc-0.8.13/contracts/Base_Faucet_Token.sol index 0766945..f78e12a 100644 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/Base_Faucet_Token.sol +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/Base_Faucet_Token.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.8; +pragma solidity ^0.8.8; import "./ERC20Detailed.sol"; import "./Ownable.sol"; @@ -47,7 +47,7 @@ contract Base_Faucet_Token is ERC20Detailed, Ownable, ERC20, Killable { _balances[address(this)] = _balances[address(this)].add(amount); emit Transfer(address(0), address(this), amount); - IERC20_Bridge_Logic_Restricted(bridge_address).deposit_asset(address(this), amount, vega_public_key); + IERC20BridgeLogicRestricted(bridge_address).depositAsset(address(this), amount, vega_public_key); } function admin_deposit_bulk(uint256 amount, address bridge_address, bytes32[] memory vega_public_keys) public onlyOwner { @@ -57,7 +57,7 @@ contract Base_Faucet_Token is ERC20Detailed, Ownable, ERC20, Killable { _balances[address(this)] = _balances[address(this)].add(final_amt); emit Transfer(address(0), address(this), final_amt); for(uint8 key_idx = 0; key_idx < vega_public_keys.length; key_idx++){ - IERC20_Bridge_Logic_Restricted(bridge_address).deposit_asset(address(this), amount, vega_public_keys[key_idx]); + IERC20BridgeLogicRestricted(bridge_address).depositAsset(address(this), amount, vega_public_keys[key_idx]); } } diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/ERC20.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/ERC20.sol similarity index 99% rename from smartcontracts-base/contracts-solc-0.8.8/contracts/ERC20.sol rename to smartcontracts-base/contracts-solc-0.8.13/contracts/ERC20.sol index 99a3a58..df39fb4 100644 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/ERC20.sol +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/ERC20.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.8; +pragma solidity ^0.8.8; import "./IERC20.sol"; import "./SafeMath.sol"; diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/ERC20Detailed.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/ERC20Detailed.sol similarity index 98% rename from smartcontracts-base/contracts-solc-0.8.8/contracts/ERC20Detailed.sol rename to smartcontracts-base/contracts-solc-0.8.13/contracts/ERC20Detailed.sol index 2160d11..ff235a9 100644 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/ERC20Detailed.sol +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/ERC20Detailed.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.8; +pragma solidity ^0.8.8; import "./IERC20.sol"; diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/ERC20_Asset_Pool.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/ERC20_Asset_Pool.sol similarity index 68% rename from smartcontracts-base/contracts-solc-0.8.8/contracts/ERC20_Asset_Pool.sol rename to smartcontracts-base/contracts-solc-0.8.13/contracts/ERC20_Asset_Pool.sol index ad36b17..dba62ee 100644 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/ERC20_Asset_Pool.sol +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/ERC20_Asset_Pool.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: MIT -pragma solidity 0.8.8; +pragma solidity ^0.8.8; import "./IMultisigControl.sol"; import "./IERC20.sol"; @@ -7,22 +7,22 @@ import "./IERC20.sol"; /// @title ERC20 Asset Pool /// @author Vega Protocol /// @notice This contract is the target for all deposits to the ERC20 Bridge via ERC20_Bridge_Logic -contract ERC20_Asset_Pool { - event Multisig_Control_Set(address indexed new_address); - event Bridge_Address_Set(address indexed new_address); +contract ERC20AssetPool { + event MultisigControlSet(address indexed newAddress); + event BridgeAddressSet(address indexed newAddress); /// @return Current MultisigControl contract address - address public multisig_control_address; + address public multisigControlAddress; /// @return Current ERC20_Bridge_Logic contract address - address public erc20_bridge_address; + address public erc20BridgeAddress; - /// @param multisig_control The initial MultisigControl contract address - /// @notice Emits Multisig_Control_Set event - constructor(address multisig_control) { - require(multisig_control != address(0), "invalid MultisigControl address"); - multisig_control_address = multisig_control; - emit Multisig_Control_Set(multisig_control); + /// @param multisigControl The initial MultisigControl contract address + /// @notice Emits MultisigControlSet event + constructor(address multisigControl) { + require(multisigControl != address(0), "invalid MultisigControl address"); + multisigControlAddress = multisigControl; + emit MultisigControlSet(multisigControl); } /// @notice this contract is not intended to accept ether directly @@ -30,48 +30,48 @@ contract ERC20_Asset_Pool { revert("this contract does not accept ETH"); } - /// @param new_address The new MultisigControl contract address. + /// @param newAddress The new MultisigControl contract address. /// @param nonce Vega-assigned single-use number that provides replay attack protection - /// @param signatures Vega-supplied signature bundle of a validator-signed set_multisig_control order + /// @param signatures Vega-supplied signature bundle of a validator-signed set_multisigControl order /// @notice See MultisigControl for more about signatures - /// @notice Emits Multisig_Control_Set event - function set_multisig_control( - address new_address, + /// @notice Emits MultisigControlSet event + function setMultisigControl( + address newAddress, uint256 nonce, bytes memory signatures ) external { - require(new_address != address(0), "invalid MultisigControl address"); - require(is_contract(new_address), "new address must be contract"); + require(newAddress != address(0), "invalid MultisigControl address"); + require(is_contract(newAddress), "new address must be contract"); - bytes memory message = abi.encode(new_address, nonce, "set_multisig_control"); + bytes memory message = abi.encode(newAddress, nonce, "setMultisigControl"); require( - IMultisigControl(multisig_control_address).verify_signatures(signatures, message, nonce), + IMultisigControl(multisigControlAddress).verifySignatures(signatures, message, nonce), "bad signatures" ); - multisig_control_address = new_address; - emit Multisig_Control_Set(new_address); + multisigControlAddress = newAddress; + emit MultisigControlSet(newAddress); } - /// @param new_address The new ERC20_Bridge_Logic contract address. + /// @param newAddress The new ERC20_Bridge_Logic contract address. /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed set_bridge_address order /// @notice See MultisigControl for more about signatures - /// @notice Emits Bridge_Address_Set event - function set_bridge_address( - address new_address, + /// @notice Emits BridgeAddressSet event + function setBridgeAddress( + address newAddress, uint256 nonce, bytes memory signatures ) external { - bytes memory message = abi.encode(new_address, nonce, "set_bridge_address"); + bytes memory message = abi.encode(newAddress, nonce, "setBridgeAddress"); require( - IMultisigControl(multisig_control_address).verify_signatures(signatures, message, nonce), + IMultisigControl(multisigControlAddress).verifySignatures(signatures, message, nonce), "bad signatures" ); - erc20_bridge_address = new_address; - emit Bridge_Address_Set(new_address); + erc20BridgeAddress = newAddress; + emit BridgeAddressSet(newAddress); } - /// @notice This function can only be run by the current "multisig_control_address" and, if available, will send the target tokens to the target + /// @notice This function can only be run by the current "multisigControlAddress" and, if available, will send the target tokens to the target /// @param token_address Contract address of the ERC20 token to be withdrawn /// @param target Target Ethereum address that the ERC20 tokens will be sent to /// @param amount Amount of ERC20 tokens to withdraw @@ -81,8 +81,7 @@ contract ERC20_Asset_Pool { address target, uint256 amount ) external { - require(msg.sender == erc20_bridge_address, "msg.sender not authorized bridge"); - require(is_contract(token_address), "token_address must be contract"); + require(msg.sender == erc20BridgeAddress, "msg.sender not authorized bridge"); (bool success, bytes memory returndata) = token_address.call( abi.encodeWithSignature("transfer(address,uint256)", target, amount) diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/ERC20_Bridge_Logic_Restricted.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/ERC20_Bridge_Logic_Restricted.sol similarity index 52% rename from smartcontracts-base/contracts-solc-0.8.8/contracts/ERC20_Bridge_Logic_Restricted.sol rename to smartcontracts-base/contracts-solc-0.8.13/contracts/ERC20_Bridge_Logic_Restricted.sol index 3e4f424..591b310 100644 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/ERC20_Bridge_Logic_Restricted.sol +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/ERC20_Bridge_Logic_Restricted.sol @@ -1,164 +1,163 @@ //SPDX-License-Identifier: MIT -pragma solidity 0.8.8; +pragma solidity ^0.8.8; import "./IERC20.sol"; import "./IERC20_Bridge_Logic_Restricted.sol"; import "./IMultisigControl.sol"; -import "./ERC20_Asset_Pool.sol"; +import {ERC20AssetPool} from "./ERC20_Asset_Pool.sol"; /// @title ERC20 Bridge Logic /// @author Vega Protocol /// @notice This contract is used by Vega network users to deposit and withdraw ERC20 tokens to/from Vega. -// @notice All funds deposited/withdrawn are to/from the assigned ERC20_Asset_Pool -contract ERC20_Bridge_Logic_Restricted is IERC20_Bridge_Logic_Restricted { - address payable public erc20_asset_pool_address; +// @notice All funds deposited/withdrawn are to/from the assigned ERC20AssetPool +contract ERC20BridgeLogicRestricted is IERC20BridgeLogicRestricted { + address payable public erc20AssetPoolAddress; // asset address => is listed - mapping(address => bool) listed_tokens; - // Vega asset ID => asset_source - mapping(bytes32 => address) vega_asset_ids_to_source; - // asset_source => Vega asset ID - mapping(address => bytes32) asset_source_to_vega_asset_id; - - /// @param erc20_asset_pool Initial Asset Pool contract address - constructor(address payable erc20_asset_pool) { - require(erc20_asset_pool != address(0), "invalid asset pool address"); - erc20_asset_pool_address = erc20_asset_pool; + mapping(address => bool) listedTokens; + mapping(bytes32 => address) vegaAssetIdsToSource; + // assetSource => Vega asset ID + mapping(address => bytes32) assetSourceToVegaAssetId; + + /// @param erc20AssetPool Initial Asset Pool contract address + constructor(address payable erc20AssetPool) { + require(erc20AssetPool != address(0), "invalid asset pool address"); + erc20AssetPoolAddress = erc20AssetPool; } - function multisig_control_address() internal view returns (address) { - return ERC20_Asset_Pool(erc20_asset_pool_address).multisig_control_address(); + function multisigControlAddress() internal view returns (address) { + return ERC20AssetPool(erc20AssetPoolAddress).multisigControlAddress(); } /***************************FUNCTIONS*************************/ /// @notice This function lists the given ERC20 token contract as valid for deposit to this bridge - /// @param asset_source Contract address for given ERC20 token - /// @param vega_asset_id Vega-generated asset ID for internal use in Vega Core - /// @param lifetime_limit Initial lifetime deposit limit *RESTRICTION FEATURE* - /// @param withdraw_threshold Amount at which the withdraw delay goes into effect *RESTRICTION FEATURE* + /// @param assetSource Contract address for given ERC20 token + /// @param vegaAssetId Vega-generated asset ID for internal use in Vega Core + /// @param lifetimeLimit Initial lifetime deposit limit *RESTRICTION FEATURE*. Setting this to type(uint256).max will disable the per address deposit limit counter + /// @param withdrawThreshold Amount at which the withdraw delay goes into effect *RESTRICTION FEATURE* /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures - /// @dev Emits Asset_Listed if successful - function list_asset( - address asset_source, - bytes32 vega_asset_id, - uint256 lifetime_limit, - uint256 withdraw_threshold, + /// @dev Emits AssetListed if successful + function listAsset( + address assetSource, + bytes32 vegaAssetId, + uint256 lifetimeLimit, + uint256 withdrawThreshold, uint256 nonce, bytes memory signatures ) external override { - require(asset_source != address(0), "invalid asset source"); - require(!listed_tokens[asset_source], "asset already listed"); + require(assetSource != address(0), "invalid asset source"); + require(!listedTokens[assetSource], "asset already listed"); bytes memory message = abi.encode( - asset_source, - vega_asset_id, - lifetime_limit, - withdraw_threshold, + assetSource, + vegaAssetId, + lifetimeLimit, + withdrawThreshold, nonce, - "list_asset" + "listAsset" ); require( - IMultisigControl(multisig_control_address()).verify_signatures(signatures, message, nonce), + IMultisigControl(multisigControlAddress()).verifySignatures(signatures, message, nonce), "bad signatures" ); - listed_tokens[asset_source] = true; - vega_asset_ids_to_source[vega_asset_id] = asset_source; - asset_source_to_vega_asset_id[asset_source] = vega_asset_id; - asset_deposit_lifetime_limit[asset_source] = lifetime_limit; - withdraw_thresholds[asset_source] = withdraw_threshold; - emit Asset_Listed(asset_source, vega_asset_id, nonce); + listedTokens[assetSource] = true; + vegaAssetIdsToSource[vegaAssetId] = assetSource; + assetSourceToVegaAssetId[assetSource] = vegaAssetId; + assetDepositLifetimeLimit[assetSource] = lifetimeLimit; + withdrawThresholds[assetSource] = withdrawThreshold; + emit AssetListed(assetSource, vegaAssetId, nonce); } /// @notice This function removes from listing the given ERC20 token contract. This marks the token as invalid for deposit to this bridge - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @dev Emits Asset_Removed if successful - function remove_asset( - address asset_source, + function removeAsset( + address assetSource, uint256 nonce, bytes memory signatures ) external override { - require(listed_tokens[asset_source], "asset not listed"); - bytes memory message = abi.encode(asset_source, nonce, "remove_asset"); + require(listedTokens[assetSource], "asset not listed"); + bytes memory message = abi.encode(assetSource, nonce, "removeAsset"); require( - IMultisigControl(multisig_control_address()).verify_signatures(signatures, message, nonce), + IMultisigControl(multisigControlAddress()).verifySignatures(signatures, message, nonce), "bad signatures" ); - listed_tokens[asset_source] = false; - emit Asset_Removed(asset_source, nonce); + listedTokens[assetSource] = false; + emit AssetRemoved(assetSource, nonce); } /************************RESTRICTIONS***************************/ - // user => asset_source => deposit total - mapping(address => mapping(address => uint256)) user_lifetime_deposits; - // asset_source => deposit_limit - mapping(address => uint256) asset_deposit_lifetime_limit; - uint256 public default_withdraw_delay = 432000; - // asset_source => threshold - mapping(address => uint256) withdraw_thresholds; + // user => assetSource => deposit total + mapping(address => mapping(address => uint256)) userLifetimeDeposits; + // assetSource => deposit_limit + mapping(address => uint256) assetDepositLifetimeLimit; + uint256 public defaultWithdrawDelay = 432000; + // assetSource => threshold + mapping(address => uint256) withdrawThresholds; bool public is_stopped; // depositor => is exempt from deposit limits - mapping(address => bool) exempt_depositors; + mapping(address => bool) exemptDepositors; /// @notice This function sets the lifetime maximum deposit for a given asset - /// @param asset_source Contract address for given ERC20 token - /// @param lifetime_limit Deposit limit for a given ethereum address + /// @param assetSource Contract address for given ERC20 token + /// @param lifetimeLimit Deposit limit for a given ethereum address. Setting this to type(uint256).max will disable the per address deposit limit counter /// @param threshold Withdraw size above which the withdraw delay goes into effect /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @dev asset must first be listed - function set_asset_limits( - address asset_source, - uint256 lifetime_limit, + function setAssetLimits( + address assetSource, + uint256 lifetimeLimit, uint256 threshold, uint256 nonce, bytes calldata signatures ) external override { - require(listed_tokens[asset_source], "asset not listed"); - bytes memory message = abi.encode(asset_source, lifetime_limit, threshold, nonce, "set_asset_limits"); + require(listedTokens[assetSource], "asset not listed"); + bytes memory message = abi.encode(assetSource, lifetimeLimit, threshold, nonce, "setAssetLimits"); require( - IMultisigControl(multisig_control_address()).verify_signatures(signatures, message, nonce), + IMultisigControl(multisigControlAddress()).verifySignatures(signatures, message, nonce), "bad signatures" ); - asset_deposit_lifetime_limit[asset_source] = lifetime_limit; - withdraw_thresholds[asset_source] = threshold; + assetDepositLifetimeLimit[assetSource] = lifetimeLimit; + withdrawThresholds[assetSource] = threshold; - emit Asset_Limits_Updated(asset_source, lifetime_limit, threshold); + emit AssetLimitsUpdated(assetSource, lifetimeLimit, threshold); } /// @notice This view returns the lifetime deposit limit for the given asset - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @return Lifetime limit for the given asset - function get_asset_deposit_lifetime_limit(address asset_source) external view override returns (uint256) { - return asset_deposit_lifetime_limit[asset_source]; + function getAssetDepositLifetimeLimit(address assetSource) external view override returns (uint256) { + return assetDepositLifetimeLimit[assetSource]; } /// @notice This view returns the given token's withdraw threshold above which the withdraw delay goes into effect - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @return Withdraw threshold - function get_withdraw_threshold(address asset_source) external view override returns (uint256) { - return withdraw_thresholds[asset_source]; + function getWithdrawThreshold(address assetSource) external view override returns (uint256) { + return withdrawThresholds[assetSource]; } /// @notice This function sets the withdraw delay for withdrawals over the per-asset set thresholds /// @param delay Amount of time to delay a withdrawal /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order - function set_withdraw_delay( + function setWithdrawDelay( uint256 delay, uint256 nonce, bytes calldata signatures ) external override { - bytes memory message = abi.encode(delay, nonce, "set_withdraw_delay"); + bytes memory message = abi.encode(delay, nonce, "setWithdrawDelay"); require( - IMultisigControl(multisig_control_address()).verify_signatures(signatures, message, nonce), + IMultisigControl(multisigControlAddress()).verifySignatures(signatures, message, nonce), "bad signatures" ); - default_withdraw_delay = delay; - emit Bridge_Withdraw_Delay_Set(delay); + defaultWithdrawDelay = delay; + emit BridgeWithdrawDelaySet(delay); } /// @notice This function triggers the global bridge stop that halts all withdrawals and deposits until it is resumed @@ -166,15 +165,15 @@ contract ERC20_Bridge_Logic_Restricted is IERC20_Bridge_Logic_Restricted { /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @dev bridge must not be stopped already /// @dev emits Bridge_Stopped if successful - function global_stop(uint256 nonce, bytes calldata signatures) external override { + function globalStop(uint256 nonce, bytes calldata signatures) external override { require(!is_stopped, "bridge already stopped"); - bytes memory message = abi.encode(nonce, "global_stop"); + bytes memory message = abi.encode(nonce, "globalStop"); require( - IMultisigControl(multisig_control_address()).verify_signatures(signatures, message, nonce), + IMultisigControl(multisigControlAddress()).verifySignatures(signatures, message, nonce), "bad signatures" ); is_stopped = true; - emit Bridge_Stopped(); + emit BridgeStopped(); } /// @notice This function resumes bridge operations from the stopped state @@ -182,55 +181,55 @@ contract ERC20_Bridge_Logic_Restricted is IERC20_Bridge_Logic_Restricted { /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @dev bridge must be stopped /// @dev emits Bridge_Resumed if successful - function global_resume(uint256 nonce, bytes calldata signatures) external override { + function globalResume(uint256 nonce, bytes calldata signatures) external override { require(is_stopped, "bridge not stopped"); - bytes memory message = abi.encode(nonce, "global_resume"); + bytes memory message = abi.encode(nonce, "globalResume"); require( - IMultisigControl(multisig_control_address()).verify_signatures(signatures, message, nonce), + IMultisigControl(multisigControlAddress()).verifySignatures(signatures, message, nonce), "bad signatures" ); is_stopped = false; - emit Bridge_Resumed(); + emit BridgeResumed(); } /// @notice this function allows the sender to exempt themselves from the deposit limits /// @notice this feature is specifically for liquidity and rewards providers /// @dev emits Depositor_Exempted if successful - function exempt_depositor() external override { - require(!exempt_depositors[msg.sender], "sender already exempt"); - exempt_depositors[msg.sender] = true; - emit Depositor_Exempted(msg.sender); + function exemptDepositor() external override { + require(!exemptDepositors[msg.sender], "sender already exempt"); + exemptDepositors[msg.sender] = true; + emit DepositorExempted(msg.sender); } /// @notice this function allows the exemption_lister to revoke a depositor's exemption from deposit limits /// @notice this feature is specifically for liquidity and rewards providers /// @dev emits Depositor_Exemption_Revoked if successful - function revoke_exempt_depositor() external override { - require(exempt_depositors[msg.sender], "sender not exempt"); - exempt_depositors[msg.sender] = false; - emit Depositor_Exemption_Revoked(msg.sender); + function revokeExemptDepositor() external override { + require(exemptDepositors[msg.sender], "sender not exempt"); + exemptDepositors[msg.sender] = false; + emit DepositorExemptionRevoked(msg.sender); } /// @notice this view returns true if the given despoitor address has been exempted from deposit limits /// @param depositor The depositor to check /// @return true if depositor is exempt - function is_exempt_depositor(address depositor) external view override returns (bool) { - return exempt_depositors[depositor]; + function isExemptDepositor(address depositor) external view override returns (bool) { + return exemptDepositors[depositor]; } /***********************END RESTRICTIONS*************************/ /// @notice This function withdraws assets to the target Ethereum address - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @param amount Amount of ERC20 tokens to withdraw /// @param target Target Ethereum address to receive withdrawn ERC20 tokens /// @param creation Timestamp of when requestion was created *RESTRICTION FEATURE* /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures - /// @dev Emits Asset_Withdrawn if successful - function withdraw_asset( - address asset_source, + /// @dev Emits AssetWithdrawn if successful + function withdrawAsset( + address assetSource, uint256 amount, address target, uint256 creation, @@ -239,48 +238,48 @@ contract ERC20_Bridge_Logic_Restricted is IERC20_Bridge_Logic_Restricted { ) external override { require(!is_stopped, "bridge stopped"); require( - withdraw_thresholds[asset_source] > amount || creation + default_withdraw_delay <= block.timestamp, + withdrawThresholds[assetSource] > amount || creation + defaultWithdrawDelay <= block.timestamp, "large withdraw is not old enough" ); - bytes memory message = abi.encode(asset_source, amount, target, creation, nonce, "withdraw_asset"); + bytes memory message = abi.encode(assetSource, amount, target, creation, nonce, "withdrawAsset"); require( - IMultisigControl(multisig_control_address()).verify_signatures(signatures, message, nonce), + IMultisigControl(multisigControlAddress()).verifySignatures(signatures, message, nonce), "bad signatures" ); - ERC20_Asset_Pool(erc20_asset_pool_address).withdraw(asset_source, target, amount); - emit Asset_Withdrawn(target, asset_source, amount, nonce); + ERC20AssetPool(erc20AssetPoolAddress).withdraw(assetSource, target, amount); + emit AssetWithdrawn(target, assetSource, amount, nonce); } /// @notice This function allows a user to deposit given ERC20 tokens into Vega - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @param amount Amount of tokens to be deposited into Vega - /// @param vega_public_key Target Vega public key to be credited with this deposit + /// @param vegaPublicKey Target Vega public key to be credited with this deposit /// @dev emits Asset_Deposited if successful /// @dev ERC20 approve function should be run before running this /// @notice ERC20 approve function should be run before running this - function deposit_asset( - address asset_source, + function depositAsset( + address assetSource, uint256 amount, - bytes32 vega_public_key + bytes32 vegaPublicKey ) external override { require(!is_stopped, "bridge stopped"); - if (!exempt_depositors[msg.sender]) { - require( - user_lifetime_deposits[msg.sender][asset_source] + amount <= asset_deposit_lifetime_limit[asset_source], - "deposit over lifetime limit" - ); - user_lifetime_deposits[msg.sender][asset_source] += amount; + // Cache SLOAD + uint256 _limit = assetDepositLifetimeLimit[assetSource]; + + // Check limit first as that's the most likely branch, then check if exempt + if (_limit < type(uint256).max && !exemptDepositors[msg.sender]) { + require(userLifetimeDeposits[msg.sender][assetSource] + amount <= _limit, "deposit over lifetime limit"); + userLifetimeDeposits[msg.sender][assetSource] += amount; } - require(listed_tokens[asset_source], "asset not listed"); - require(is_contract(asset_source), "asset_source must be contract"); + require(listedTokens[assetSource], "asset not listed"); - (bool success, bytes memory returndata) = asset_source.call( + (bool success, bytes memory returndata) = assetSource.call( abi.encodeWithSignature( "transferFrom(address,address,uint256)", msg.sender, - erc20_asset_pool_address, + erc20AssetPoolAddress, amount ) ); @@ -291,35 +290,36 @@ contract ERC20_Bridge_Logic_Restricted is IERC20_Bridge_Logic_Restricted { require(abi.decode(returndata, (bool)), "token transfer failed"); } - emit Asset_Deposited(msg.sender, asset_source, amount, vega_public_key); + emit AssetDeposited(msg.sender, assetSource, amount, vegaPublicKey); } + /***************************VIEWS*****************************/ /// @notice This view returns true if the given ERC20 token contract has been listed valid for deposit - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @return True if asset is listed - function is_asset_listed(address asset_source) external view override returns (bool) { - return listed_tokens[asset_source]; + function isAssetListed(address assetSource) external view override returns (bool) { + return listedTokens[assetSource]; } - /// @return current multisig_control_address - function get_multisig_control_address() external view override returns (address) { - return multisig_control_address(); + /// @return current multisigControlAddress + function getMultisigControlAddress() external view override returns (address) { + return multisigControlAddress(); } - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @return The assigned Vega Asset Id for given ERC20 token - function get_vega_asset_id(address asset_source) external view override returns (bytes32) { - return asset_source_to_vega_asset_id[asset_source]; + function getVegaAssetId(address assetSource) external view override returns (bytes32) { + return assetSourceToVegaAssetId[assetSource]; } - /// @param vega_asset_id Vega-assigned asset ID for which you want the ERC20 token address + /// @param vegaAssetId Vega-assigned asset ID for which you want the ERC20 token address /// @return The ERC20 token contract address for a given Vega Asset Id - function get_asset_source(bytes32 vega_asset_id) external view override returns (address) { - return vega_asset_ids_to_source[vega_asset_id]; + function getAssetSource(bytes32 vegaAssetId) external view override returns (address) { + return vegaAssetIdsToSource[vegaAssetId]; } - function is_contract(address addr) internal view returns (bool) { + function isContract(address addr) internal view returns (bool) { uint256 code_size; assembly { code_size := extcodesize(addr) diff --git a/smartcontracts-base/contracts-solc-0.8.1/contracts/IERC20.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/IERC20.sol similarity index 99% rename from smartcontracts-base/contracts-solc-0.8.1/contracts/IERC20.sol rename to smartcontracts-base/contracts-solc-0.8.13/contracts/IERC20.sol index 9a12062..7abfea4 100644 --- a/smartcontracts-base/contracts-solc-0.8.1/contracts/IERC20.sol +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/IERC20.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.1; +pragma solidity 0.8.13; /** * @dev Interface of the ERC20 standard as defined in the EIP. diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/IERC20_Bridge_Logic_Restricted.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/IERC20_Bridge_Logic_Restricted.sol similarity index 64% rename from smartcontracts-base/contracts-solc-0.8.8/contracts/IERC20_Bridge_Logic_Restricted.sol rename to smartcontracts-base/contracts-solc-0.8.13/contracts/IERC20_Bridge_Logic_Restricted.sol index 45b3fe6..e69f0ef 100644 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/IERC20_Bridge_Logic_Restricted.sol +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/IERC20_Bridge_Logic_Restricted.sol @@ -1,68 +1,68 @@ //SPDX-License-Identifier: MIT -pragma solidity 0.8.8; +pragma solidity ^0.8.8; /// @title ERC20 Bridge Logic Interface /// @author Vega Protocol /// @notice Implementations of this interface are used by Vega network users to deposit and withdraw ERC20 tokens to/from Vega. // @notice All funds deposited/withdrawn are to/from the ERC20_Asset_Pool -abstract contract IERC20_Bridge_Logic_Restricted { +abstract contract IERC20BridgeLogicRestricted { /***************************EVENTS****************************/ - event Asset_Withdrawn(address indexed user_address, address indexed asset_source, uint256 amount, uint256 nonce); - event Asset_Deposited( - address indexed user_address, - address indexed asset_source, + event AssetWithdrawn(address indexed userAddress, address indexed assetSource, uint256 amount, uint256 nonce); + event AssetDeposited( + address indexed userAddress, + address indexed assetSource, uint256 amount, - bytes32 vega_public_key + bytes32 vegaPublicKey ); - event Asset_Listed(address indexed asset_source, bytes32 indexed vega_asset_id, uint256 nonce); - event Asset_Removed(address indexed asset_source, uint256 nonce); - event Asset_Limits_Updated(address indexed asset_source, uint256 lifetime_limit, uint256 withdraw_threshold); - event Bridge_Withdraw_Delay_Set(uint256 withdraw_delay); - event Bridge_Stopped(); - event Bridge_Resumed(); - event Depositor_Exempted(address indexed depositor); - event Depositor_Exemption_Revoked(address indexed depositor); + event AssetListed(address indexed assetSource, bytes32 indexed vegaAssetId, uint256 nonce); + event AssetRemoved(address indexed assetSource, uint256 nonce); + event AssetLimitsUpdated(address indexed assetSource, uint256 lifetimeLimit, uint256 withdrawThreshold); + event BridgeWithdrawDelaySet(uint256 withdraw_delay); + event BridgeStopped(); + event BridgeResumed(); + event DepositorExempted(address indexed depositor); + event DepositorExemptionRevoked(address indexed depositor); /***************************FUNCTIONS*************************/ /// @notice This function lists the given ERC20 token contract as valid for deposit to this bridge - /// @param asset_source Contract address for given ERC20 token - /// @param vega_asset_id Vega-generated asset ID for internal use in Vega Core - /// @param lifetime_limit Initial lifetime deposit limit *RESTRICTION FEATURE* - /// @param withdraw_threshold Amount at which the withdraw delay goes into effect *RESTRICTION FEATURE* + /// @param assetSource Contract address for given ERC20 token + /// @param vegaAssetId Vega-generated asset ID for internal use in Vega Core + /// @param lifetimeLimit Initial lifetime deposit limit *RESTRICTION FEATURE* + /// @param withdrawThreshold Amount at which the withdraw delay goes into effect *RESTRICTION FEATURE* /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures - /// @dev MUST emit Asset_Listed if successful - function list_asset( - address asset_source, - bytes32 vega_asset_id, - uint256 lifetime_limit, - uint256 withdraw_threshold, + /// @dev MUST emit AssetListed if successful + function listAsset( + address assetSource, + bytes32 vegaAssetId, + uint256 lifetimeLimit, + uint256 withdrawThreshold, uint256 nonce, bytes memory signatures ) external virtual; /// @notice This function removes from listing the given ERC20 token contract. This marks the token as invalid for deposit to this bridge - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures - /// @dev MUST emit Asset_Removed if successful - function remove_asset( - address asset_source, + /// @dev MUST emit AssetRemoved if successful + function removeAsset( + address assetSource, uint256 nonce, bytes memory signatures ) external virtual; /// @notice This function sets the lifetime maximum deposit for a given asset - /// @param asset_source Contract address for given ERC20 token - /// @param lifetime_limit Deposit limit for a given ethereum address + /// @param assetSource Contract address for given ERC20 token + /// @param lifetimeLimit Deposit limit for a given ethereum address /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @dev asset must first be listed - function set_asset_limits( - address asset_source, - uint256 lifetime_limit, + function setAssetLimits( + address assetSource, + uint256 lifetimeLimit, uint256 threshold, uint256 nonce, bytes calldata signatures @@ -72,7 +72,7 @@ abstract contract IERC20_Bridge_Logic_Restricted { /// @param delay Amount of time to delay a withdrawal /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order - function set_withdraw_delay( + function setWithdrawDelay( uint256 delay, uint256 nonce, bytes calldata signatures @@ -82,37 +82,37 @@ abstract contract IERC20_Bridge_Logic_Restricted { /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @dev bridge must not be stopped already - /// @dev MUST emit Bridge_Stopped if successful - function global_stop(uint256 nonce, bytes calldata signatures) external virtual; + /// @dev MUST emit BridgeStopped if successful + function globalStop(uint256 nonce, bytes calldata signatures) external virtual; /// @notice This function resumes bridge operations from the stopped state /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @dev bridge must be stopped - /// @dev MUST emit Bridge_Resumed if successful - function global_resume(uint256 nonce, bytes calldata signatures) external virtual; + /// @dev MUST emit BridgeResumed if successful + function globalResume(uint256 nonce, bytes calldata signatures) external virtual; /// @notice this function allows the exemption_lister to exempt a depositor from the deposit limits /// @notice this feature is specifically for liquidity and rewards providers - /// @dev MUST emit Depositor_Exempted if successful - function exempt_depositor() external virtual; + /// @dev MUST emit DepositorExempted if successful + function exemptDepositor() external virtual; /// @notice this function allows the exemption_lister to revoke a depositor's exemption from deposit limits /// @notice this feature is specifically for liquidity and rewards providers - /// @dev MUST emit Depositor_Exemption_Revoked if successful - function revoke_exempt_depositor() external virtual; + /// @dev MUST emit DepositorExemptionRevoked if successful + function revokeExemptDepositor() external virtual; /// @notice This function withdrawals assets to the target Ethereum address - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @param amount Amount of ERC20 tokens to withdraw /// @param target Target Ethereum address to receive withdrawn ERC20 tokens /// @param creation Timestamp of when requestion was created *RESTRICTION FEATURE* /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures - /// @dev MUST emit Asset_Withdrawn if successful - function withdraw_asset( - address asset_source, + /// @dev MUST emit AssetWithdrawn if successful + function withdrawAsset( + address assetSource, uint256 amount, address target, uint256 creation, @@ -123,47 +123,47 @@ abstract contract IERC20_Bridge_Logic_Restricted { /// @notice this view returns true if the given despoitor address has been exempted from deposit limits /// @param depositor The depositor to check /// @return true if depositor is exempt - function is_exempt_depositor(address depositor) external view virtual returns (bool); + function isExemptDepositor(address depositor) external view virtual returns (bool); /// @notice This function allows a user to deposit given ERC20 tokens into Vega - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @param amount Amount of tokens to be deposited into Vega - /// @param vega_public_key Target Vega public key to be credited with this deposit - /// @dev MUST emit Asset_Deposited if successful + /// @param vegaPublicKey Target Vega public key to be credited with this deposit + /// @dev MUST emit AssetDeposited if successful /// @dev ERC20 approve function should be run before running this /// @notice ERC20 approve function should be run before running this - function deposit_asset( - address asset_source, + function depositAsset( + address assetSource, uint256 amount, - bytes32 vega_public_key + bytes32 vegaPublicKey ) external virtual; /***************************VIEWS*****************************/ /// @notice This view returns true if the given ERC20 token contract has been listed valid for deposit - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @return True if asset is listed - function is_asset_listed(address asset_source) external view virtual returns (bool); + function isAssetListed(address assetSource) external view virtual returns (bool); /// @notice This view returns the lifetime deposit limit for the given asset - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @return Lifetime limit for the given asset - function get_asset_deposit_lifetime_limit(address asset_source) external view virtual returns (uint256); + function getAssetDepositLifetimeLimit(address assetSource) external view virtual returns (uint256); /// @notice This view returns the given token's withdraw threshold above which the withdraw delay goes into effect - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @return Withdraw threshold - function get_withdraw_threshold(address asset_source) external view virtual returns (uint256); + function getWithdrawThreshold(address assetSource) external view virtual returns (uint256); /// @return current multisig_control_address - function get_multisig_control_address() external view virtual returns (address); + function getMultisigControlAddress() external view virtual returns (address); - /// @param asset_source Contract address for given ERC20 token + /// @param assetSource Contract address for given ERC20 token /// @return The assigned Vega Asset ID for given ERC20 token - function get_vega_asset_id(address asset_source) external view virtual returns (bytes32); + function getVegaAssetId(address assetSource) external view virtual returns (bytes32); - /// @param vega_asset_id Vega-assigned asset ID for which you want the ERC20 token address + /// @param vegaAssetId Vega-assigned asset ID for which you want the ERC20 token address /// @return The ERC20 token contract address for a given Vega Asset ID - function get_asset_source(bytes32 vega_asset_id) external view virtual returns (address); + function getAssetSource(bytes32 vegaAssetId) external view virtual returns (address); } /** diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/IMultisigControl.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/IMultisigControl.sol similarity index 85% rename from smartcontracts-base/contracts-solc-0.8.8/contracts/IMultisigControl.sol rename to smartcontracts-base/contracts-solc-0.8.13/contracts/IMultisigControl.sol index 722a0d8..1f355ca 100644 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/IMultisigControl.sol +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/IMultisigControl.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: MIT -pragma solidity 0.8.8; +pragma solidity ^0.8.8; /// @title MultisigControl Interface /// @author Vega Protocol @@ -7,46 +7,46 @@ pragma solidity 0.8.8; /// @notice To do this, the Vega validators sign a MultisigControl order to construct a signature bundle. Any interested party can then take that signature bundle and pay the gas to run the command on Ethereum abstract contract IMultisigControl { /***************************EVENTS****************************/ - event SignerAdded(address new_signer, uint256 nonce); - event SignerRemoved(address old_signer, uint256 nonce); - event ThresholdSet(uint16 new_threshold, uint256 nonce); + event SignerAdded(address newSigner, uint256 nonce); + event SignerRemoved(address oldSigner, uint256 nonce); + event ThresholdSet(uint16 newThreshold, uint256 nonce); event NonceBurnt(uint256 nonce); /**************************FUNCTIONS*********************/ /// @notice Sets threshold of signatures that must be met before function is executed. - /// @param new_threshold New threshold value + /// @param newThreshold New threshold value /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @notice Ethereum has no decimals, threshold is % * 10 so 50% == 500 100% == 1000 /// @notice signatures are OK if they are >= threshold count of total valid signers /// @dev MUST emit ThresholdSet event - function set_threshold( - uint16 new_threshold, + function setThreshold( + uint16 newThreshold, uint256 nonce, bytes calldata signatures ) external virtual; /// @notice Adds new valid signer and adjusts signer count. - /// @param new_signer New signer address + /// @param newSigner New signer address /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @dev MUST emit 'SignerAdded' event - function add_signer( - address new_signer, + function addSigner( + address newSigner, uint256 nonce, bytes calldata signatures ) external virtual; /// @notice Removes currently valid signer and adjusts signer count. - /// @param old_signer Address of signer to be removed. + /// @param oldSigner Address of signer to be removed. /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @dev MUST emit 'SignerRemoved' event - function remove_signer( - address old_signer, + function removeSigner( + address oldSigner, uint256 nonce, bytes calldata signatures ) external virtual; @@ -56,7 +56,7 @@ abstract contract IMultisigControl { /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @dev Emits 'NonceBurnt' event - function burn_nonce(uint256 nonce, bytes calldata signatures) external virtual; + function burnNonce(uint256 nonce, bytes calldata signatures) external virtual; /// @notice Verifies a signature bundle and returns true only if the threshold of valid signers is met, /// @notice this is a function that any function controlled by Vega MUST call to be securely controlled by the Vega network @@ -66,7 +66,7 @@ abstract contract IMultisigControl { /// @notice if function on bridge that then calls Multisig, then it's the address of that contract /// @notice Note also the embedded encoding, this is required to verify what function/contract the function call goes to /// @return MUST return true if valid signatures are over the threshold - function verify_signatures( + function verifySignatures( bytes calldata signatures, bytes memory message, uint256 nonce @@ -74,18 +74,18 @@ abstract contract IMultisigControl { /**********************VIEWS*********************/ /// @return Number of valid signers - function get_valid_signer_count() external view virtual returns (uint8); + function getValidSignerCount() external view virtual returns (uint8); /// @return Current threshold - function get_current_threshold() external view virtual returns (uint16); + function getCurrentThreshold() external view virtual returns (uint16); /// @param signer_address target potential signer address /// @return true if address provided is valid signer - function is_valid_signer(address signer_address) external view virtual returns (bool); + function isValidSigner(address signer_address) external view virtual returns (bool); /// @param nonce Nonce to lookup /// @return true if nonce has been used - function is_nonce_used(uint256 nonce) external view virtual returns (bool); + function isNonceUsed(uint256 nonce) external view virtual returns (bool); } /** diff --git a/smartcontracts-base/contracts-solc-0.8.13/contracts/IStake.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/IStake.sol new file mode 100644 index 0000000..347305d --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/IStake.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.13; + +/** + * @dev IStake contains all of the events necessary for staking Vega token + */ +interface IStake { + event StakeDeposited(address indexed user, uint256 amount, bytes32 indexed vegaPublicKey); + event StakeRemoved(address indexed user, uint256 amount, bytes32 indexed vegaPublicKey); + event StakeTransferred(address indexed from, uint256 amount, address indexed to, bytes32 indexed vegaPublicKey); + + /// @return the address of the token that is able to be staked + function stakingToken() external view returns (address); + + /// @param target Target address to check + /// @param vegaPublicKey Target vega public key to check + /// @return the number of tokens staked for that address->vegaPublicKey pair + function stakeBalance(address target, bytes32 vegaPublicKey) external view returns (uint256); + + /// @return total tokens staked on contract + function totalStaked() external view returns (uint256); +} \ No newline at end of file diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/Killable.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/Killable.sol similarity index 93% rename from smartcontracts-base/contracts-solc-0.8.8/contracts/Killable.sol rename to smartcontracts-base/contracts-solc-0.8.13/contracts/Killable.sol index e2c957b..edbf378 100644 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/Killable.sol +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/Killable.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.8; +pragma solidity ^0.8.8; import "./Ownable.sol"; /* diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/Migrations.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/Migrations.sol similarity index 93% rename from smartcontracts-base/contracts-solc-0.8.8/contracts/Migrations.sol rename to smartcontracts-base/contracts-solc-0.8.13/contracts/Migrations.sol index ad3ace1..4966cf6 100644 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/Migrations.sol +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/Migrations.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: MIT -pragma solidity 0.8.8; +pragma solidity 0.8.13; contract Migrations { address public owner; diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/MultisigControlV2.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/MultisigControl.sol similarity index 74% rename from smartcontracts-base/contracts-solc-0.8.8/contracts/MultisigControlV2.sol rename to smartcontracts-base/contracts-solc-0.8.13/contracts/MultisigControl.sol index 6770d28..ef23c11 100644 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/MultisigControlV2.sol +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/MultisigControl.sol @@ -6,77 +6,77 @@ import "./IMultisigControl.sol"; /// @title MultisigControl /// @author Vega Protocol /// @notice This contract enables validators, through a multisignature process, to run functions on contracts by consensus -contract MultisigControlV2 is IMultisigControl { +contract MultisigControl is IMultisigControl { constructor() { // set initial threshold to 50% threshold = 500; signers[msg.sender] = true; - signer_count++; + signerCount++; emit SignerAdded(msg.sender, 0); } uint16 threshold; - uint8 signer_count; + uint8 signerCount; mapping(address => bool) public signers; - mapping(uint256 => bool) used_nonces; + mapping(uint256 => bool) usedNonces; /**************************FUNCTIONS*********************/ /// @notice Sets threshold of signatures that must be met before function is executed. - /// @param new_threshold New threshold value + /// @param newThreshold New threshold value /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @notice Ethereum has no decimals, threshold is % * 10 so 50% == 500 100% == 1000 /// @notice signatures are OK if they are >= threshold count of total valid signers /// @dev Emits ThresholdSet event - function set_threshold( - uint16 new_threshold, + function setThreshold( + uint16 newThreshold, uint256 nonce, bytes calldata signatures ) external override { - require(new_threshold < 1000 && new_threshold > 0, "new threshold outside range"); - bytes memory message = abi.encode(new_threshold, nonce, "set_threshold"); - require(verify_signatures(signatures, message, nonce), "bad signatures"); - threshold = new_threshold; - emit ThresholdSet(new_threshold, nonce); + require(newThreshold < 1000 && newThreshold > 0, "new threshold outside range"); + bytes memory message = abi.encode(newThreshold, nonce, "setThreshold"); + require(verifySignatures(signatures, message, nonce), "bad signatures"); + threshold = newThreshold; + emit ThresholdSet(newThreshold, nonce); } /// @notice Adds new valid signer and adjusts signer count. - /// @param new_signer New signer address + /// @param newSigner New signer address /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @dev Emits 'SignerAdded' event - function add_signer( - address new_signer, + function addSigner( + address newSigner, uint256 nonce, bytes calldata signatures ) external override { - bytes memory message = abi.encode(new_signer, nonce, "add_signer"); - require(!signers[new_signer], "signer already exists"); - require(verify_signatures(signatures, message, nonce), "bad signatures"); - signers[new_signer] = true; - signer_count++; - emit SignerAdded(new_signer, nonce); + bytes memory message = abi.encode(newSigner, nonce, "addSigner"); + require(!signers[newSigner], "signer already exists"); + require(verifySignatures(signatures, message, nonce), "bad signatures"); + signers[newSigner] = true; + signerCount++; + emit SignerAdded(newSigner, nonce); } /// @notice Removes currently valid signer and adjusts signer count. - /// @param old_signer Address of signer to be removed. + /// @param oldSigner Address of signer to be removed. /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @dev Emits 'SignerRemoved' event - function remove_signer( - address old_signer, + function removeSigner( + address oldSigner, uint256 nonce, bytes calldata signatures ) external override { - bytes memory message = abi.encode(old_signer, nonce, "remove_signer"); - require(signers[old_signer], "signer doesn't exist"); - require(verify_signatures(signatures, message, nonce), "bad signatures"); - signers[old_signer] = false; - signer_count--; - emit SignerRemoved(old_signer, nonce); + bytes memory message = abi.encode(oldSigner, nonce, "removeSigner"); + require(signers[oldSigner], "signer doesn't exist"); + require(verifySignatures(signatures, message, nonce), "bad signatures"); + signers[oldSigner] = false; + signerCount--; + emit SignerRemoved(oldSigner, nonce); } /// @notice Burn an nonce before it gets used by a user. Useful in case the validators needs to prevents a malicious user to do un-permitted action. @@ -84,9 +84,9 @@ contract MultisigControlV2 is IMultisigControl { /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @dev Emits 'NonceBurnt' event - function burn_nonce(uint256 nonce, bytes calldata signatures) external override { - bytes memory message = abi.encode(nonce, "burn_nonce"); - require(verify_signatures(signatures, message, nonce), "bad signatures"); + function burnNonce(uint256 nonce, bytes calldata signatures) external override { + bytes memory message = abi.encode(nonce, "burnNonce"); + require(verifySignatures(signatures, message, nonce), "bad signatures"); emit NonceBurnt(nonce); } @@ -98,19 +98,21 @@ contract MultisigControlV2 is IMultisigControl { /// @notice if function on bridge that then calls Multisig, then it's the address of that contract /// @notice Note also the embedded encoding, this is required to verify what function/contract the function call goes to /// @return Returns true if valid signatures are over the threshold - function verify_signatures( + function verifySignatures( bytes calldata signatures, bytes memory message, uint256 nonce ) public override returns (bool) { require(signatures.length % 65 == 0, "bad sig length"); require(signatures.length > 0, "must contain at least 1 sig"); - require(!used_nonces[nonce], "nonce already used"); + require(!usedNonces[nonce], "nonce already used"); uint256 size = 0; - address[] memory signers_temp = new address[](signatures.length / 65); + address[] memory signersTemp = new address[](signatures.length / 65); - bytes32 message_hash = keccak256(abi.encodePacked(bytes1(0x19), block.chainid, abi.encode(message, msg.sender))); + bytes32 messageHash = keccak256( + abi.encodePacked(bytes1(0x19), block.chainid, abi.encode(message, msg.sender)) + ); uint256 offset; assembly { offset := signatures.offset @@ -143,23 +145,23 @@ contract MultisigControlV2 is IMultisigControl { ); if (v < 27) v += 27; - address recovered_address = ecrecover(message_hash, v, r, s); + address recoveredAddress = ecrecover(messageHash, v, r, s); - if (signers[recovered_address] && !has_signed(signers_temp, recovered_address, size)) { - signers_temp[size] = recovered_address; + if (signers[recoveredAddress] && !hasSigned(signersTemp, recoveredAddress, size)) { + signersTemp[size] = recoveredAddress; size++; } - if ((size * 1000) / uint256(signer_count) > threshold) { + if ((size * 1000) / uint256(signerCount) > threshold) { break; } } - used_nonces[nonce] = ((size * 1000) / uint256(signer_count)) > threshold; - return used_nonces[nonce]; + usedNonces[nonce] = ((size * 1000) / uint256(signerCount)) > threshold; + return usedNonces[nonce]; } - function has_signed( + function hasSigned( address[] memory signers_temp, address signer, uint256 size @@ -173,25 +175,25 @@ contract MultisigControlV2 is IMultisigControl { } /// @return Number of valid signers - function get_valid_signer_count() external view override returns (uint8) { - return signer_count; + function getValidSignerCount() external view override returns (uint8) { + return signerCount; } /// @return Current threshold - function get_current_threshold() external view override returns (uint16) { + function getCurrentThreshold() external view override returns (uint16) { return threshold; } /// @param signer_address target potential signer address /// @return true if address provided is valid signer - function is_valid_signer(address signer_address) external view override returns (bool) { + function isValidSigner(address signer_address) external view override returns (bool) { return signers[signer_address]; } /// @param nonce Nonce to lookup /// @return true if nonce has been used - function is_nonce_used(uint256 nonce) external view override returns (bool) { - return used_nonces[nonce]; + function isNonceUsed(uint256 nonce) external view override returns (bool) { + return usedNonces[nonce]; } } diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/Ownable.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/Ownable.sol similarity index 98% rename from smartcontracts-base/contracts-solc-0.8.8/contracts/Ownable.sol rename to smartcontracts-base/contracts-solc-0.8.13/contracts/Ownable.sol index 612efd0..21f6648 100644 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/Ownable.sol +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/Ownable.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.8; +pragma solidity ^0.8.8; /** * @dev Contract module which provides a basic access control mechanism, where diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/SafeMath.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/SafeMath.sol similarity index 97% rename from smartcontracts-base/contracts-solc-0.8.8/contracts/SafeMath.sol rename to smartcontracts-base/contracts-solc-0.8.13/contracts/SafeMath.sol index 62e25e6..6bb2f15 100644 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/SafeMath.sol +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/SafeMath.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: MIT -pragma solidity 0.8.8; +pragma solidity ^0.8.8; /** * @title SafeMath diff --git a/smartcontracts-base/contracts-solc-0.8.13/contracts/StakingBridge.sol b/smartcontracts-base/contracts-solc-0.8.13/contracts/StakingBridge.sol new file mode 100644 index 0000000..30cdc4b --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/contracts/StakingBridge.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.13; + +import "./IERC20.sol"; +import "./IStake.sol"; + +/// @title ERC20 Staking Bridge +/// @author Vega Protocol +/// @notice This contract manages the vesting of the Vega V2 ERC20 token +contract StakingBridge is IStake { + address _stakingToken; + + constructor(address token) { + _stakingToken = token; + } + + /// @dev user => amount staked + mapping(address => mapping(bytes32 => uint256)) stakes; + + /// @notice This stakes the given amount of tokens and credits them to the provided Vega public key + /// @param amount Token amount to stake + /// @param vegaPublicKey Target Vega public key to be credited with the stake + /// @dev Emits StakeDeposited event + /// @dev User MUST run "approve" on token prior to running Stake + function stake(uint256 amount, bytes32 vegaPublicKey) public { + require(IERC20(_stakingToken).transferFrom(msg.sender, address(this), amount)); + stakes[msg.sender][vegaPublicKey] += amount; + emit StakeDeposited(msg.sender, amount, vegaPublicKey); + } + + /// @notice This removes specified amount of stake of available to user + /// @dev Emits StakeRemoved event if successful + /// @param amount Amount of tokens to remove from staking + /// @param vegaPublicKey Target Vega public key from which to deduct stake + function removeStake(uint256 amount, bytes32 vegaPublicKey) public { + stakes[msg.sender][vegaPublicKey] -= amount; + require(IERC20(_stakingToken).transfer(msg.sender, amount)); + emit StakeRemoved(msg.sender, amount, vegaPublicKey); + } + + /// @notice This transfers all stake from the sender's address to the "newAddress" + /// @dev Emits Stake_Transfered event if successful + /// @param amount Stake amount to transfer + /// @param newAddress Target ETH address to recieve the stake + /// @param vegaPublicKey Target Vega public key to be credited with the transfer + function transferStake(uint256 amount, address newAddress, bytes32 vegaPublicKey) public { + stakes[msg.sender][vegaPublicKey] -= amount; + stakes[newAddress][vegaPublicKey] += amount; + emit StakeTransferred(msg.sender, amount, newAddress, vegaPublicKey); + } + + /// @dev This is IStake.stakingToken + /// @return the address of the token that is able to be staked + function stakingToken() external view override returns (address) { + return _stakingToken; + } + + /// @dev This is IStake.stakeBalance + /// @param target Target address to check + /// @param vegaPublicKey Target vega public key to check + /// @return the number of tokens staked for that address->vegaPublicKey pair + function stakeBalance(address target, bytes32 vegaPublicKey) external view override returns (uint256) { + return stakes[target][vegaPublicKey]; + } + + /// @dev This is IStake.totalStaked + /// @return total tokens staked on contract + function totalStaked() external view override returns (uint256) { + return IERC20(_stakingToken).balanceOf(address(this)); + } +} \ No newline at end of file diff --git a/smartcontracts-base/contracts-solc-0.8.1/migrations/1_initial_migration.js b/smartcontracts-base/contracts-solc-0.8.13/migrations/1_initial_migration.js similarity index 100% rename from smartcontracts-base/contracts-solc-0.8.1/migrations/1_initial_migration.js rename to smartcontracts-base/contracts-solc-0.8.13/migrations/1_initial_migration.js diff --git a/smartcontracts-base/contracts-solc-0.8.8/migrations/2_contracts.js b/smartcontracts-base/contracts-solc-0.8.13/migrations/2_contracts.js similarity index 76% rename from smartcontracts-base/contracts-solc-0.8.8/migrations/2_contracts.js rename to smartcontracts-base/contracts-solc-0.8.13/migrations/2_contracts.js index 3db1a94..5498c4a 100644 --- a/smartcontracts-base/contracts-solc-0.8.8/migrations/2_contracts.js +++ b/smartcontracts-base/contracts-solc-0.8.13/migrations/2_contracts.js @@ -5,11 +5,11 @@ const fs = require("fs"); const ethers = require('ethers'); const { Web3 } = require('web3'); +const Vega_Staking_Bridge = artifacts.require("StakingBridge"); const Base_Faucet_Token = artifacts.require("Base_Faucet_Token"); const MultisigControl = artifacts.require("MultisigControl"); -const MultisigControlV2 = artifacts.require("MultisigControlV2"); -const ERC20_Asset_Pool = artifacts.require("ERC20_Asset_Pool"); -const ERC20_Bridge_Logic_Restricted = artifacts.require("ERC20_Bridge_Logic_Restricted"); +const ERC20_Asset_Pool = artifacts.require("ERC20AssetPool"); +const ERC20_Bridge_Logic_Restricted = artifacts.require("ERC20BridgeLogicRestricted"); function multisign( param_types, @@ -91,7 +91,7 @@ async function erc20_asset_pool_set_bridge_address( erc20_asset_pool_instance.address, validator_privkeys ); - await erc20_asset_pool_instance.set_bridge_address( + await erc20_asset_pool_instance.setBridgeAddress( bridge_address, ms.nonce, ms.sigs @@ -108,42 +108,17 @@ async function erc20_asset_pool_set_bridge_address_v2( chain_id, ["address"], [bridge_address], - "set_bridge_address", + "setBridgeAddress", erc20_asset_pool_instance.address, validator_privkeys ); - await erc20_asset_pool_instance.set_bridge_address( + await erc20_asset_pool_instance.setBridgeAddress( bridge_address, ms.nonce, ms.sigs ); } -async function list_asset_on_bridge( - bridge_instance, - asset_address, - cfg, - validator_privkeys -) { - // function list_asset(address asset_source, bytes32 vega_asset_id, uint256 lifetime_limit, uint256 withdraw_threshold, uint256 nonce, bytes memory signatures) public virtual; - let ms = multisign( - ["address", "bytes32", "uint256", "uint256"], - [asset_address, cfg.vega_id, cfg.lifetime_limit, cfg.withdraw_threshold], - "list_asset", - bridge_instance.address, - validator_privkeys - ); - - return await bridge_instance.list_asset( - asset_address, - cfg.vega_id, - cfg.lifetime_limit, - cfg.withdraw_threshold, - ms.nonce, - ms.sigs - ); -} - async function list_asset_on_bridge_v2( chain_id, bridge_instance, @@ -156,12 +131,12 @@ async function list_asset_on_bridge_v2( chain_id, ["address", "bytes32", "uint256", "uint256"], [asset_address, cfg.vega_id, cfg.lifetime_limit, cfg.withdraw_threshold], - "list_asset", + "listAsset", bridge_instance.address, validator_privkeys ); - return await bridge_instance.list_asset( + return await bridge_instance.listAsset( asset_address, cfg.vega_id, cfg.lifetime_limit, @@ -172,13 +147,13 @@ async function list_asset_on_bridge_v2( } module.exports = async function (deployer, network) { - //private RPC endpoint + + const web3 = new Web3(deployer.provider.host); const chain_id = parseInt(await web3.eth.getChainId()); // Contracts await deployer.deploy(MultisigControl); - await deployer.deploy(MultisigControlV2); await deployer.deploy(ERC20_Asset_Pool, MultisigControl.address); let erc20_asset_pool_instance = await ERC20_Asset_Pool.deployed(); @@ -192,12 +167,6 @@ module.exports = async function (deployer, network) { ERC20_Asset_Pool.address ); - let ERC20AssetPoolMultisigV2 = await deployer.deploy(ERC20_Asset_Pool, MultisigControlV2.address);; - let ERC20BridgeMultisigV2 = await deployer.deploy( - ERC20_Bridge_Logic_Restricted, - ERC20AssetPoolMultisigV2.address - ); - const ganacheMnemonic = process.env.GANACHE_MNEMONIC; if (!ganacheMnemonic || ganacheMnemonic.length <= 0) { @@ -211,25 +180,18 @@ module.exports = async function (deployer, network) { let initial_validators = [Buffer.from(privkey, "hex")]; - await erc20_asset_pool_set_bridge_address( + await erc20_asset_pool_set_bridge_address_v2( + chain_id, erc20_asset_pool_instance, erc20_bridge_1.address, initial_validators ); - await erc20_asset_pool_set_bridge_address_v2( - chain_id, - ERC20AssetPoolMultisigV2, - ERC20BridgeMultisigV2.address, - initial_validators - ); + addresses = { addr0: { priv: privkey, pub: pubkey }, MultisigControl: { Ethereum: MultisigControl.address }, - MultisigControlV2: { Ethereum: MultisigControlV2.address }, - ERC20BridgeMultisigV2: {Ethereum: ERC20BridgeMultisigV2.address }, - ERC20AssetPoolMultisigV2: {Ethereum: ERC20AssetPoolMultisigV2.address }, ERC20_Asset_Pool: { Ethereum: erc20_asset_pool_instance.address }, erc20_bridge_1: { Ethereum: erc20_bridge_1.address }, erc20_bridge_2: { Ethereum: erc20_bridge_2.address }, @@ -256,7 +218,8 @@ module.exports = async function (deployer, network) { // Listing tokens on bridge for (let i = 0; i < token_config.length; i++) { try { - let result = await list_asset_on_bridge( + let result = await list_asset_on_bridge_v2( + chain_id, erc20_bridge_1, addresses[token_config[i].symbol].Ethereum, token_config[i], @@ -267,15 +230,6 @@ module.exports = async function (deployer, network) { `tx ${result.receipt.transactionHash} gas ${result.receipt.cumulativeGasUsed}` ); - - result = await list_asset_on_bridge_v2( - chain_id, - ERC20BridgeMultisigV2, - addresses[token_config[i].symbol].Ethereum, - token_config[i], - initial_validators - ); - console.log( `Listed ${token_config[i].symbol} on bridge with multisig v2 block ${result.receipt.blockNumber} ` + `tx ${result.receipt.transactionHash} gas ${result.receipt.cumulativeGasUsed}` @@ -291,14 +245,26 @@ module.exports = async function (deployer, network) { } } + + + // setup the staking bridge. + await deployer.deploy( + Vega_Staking_Bridge, + addresses["VEGA"].Ethereum + ); + + addresses["staking_bridge"] = { Ethereum: Vega_Staking_Bridge.address }; + // New migrations go just above this comment. const workDir = process.env.VEGA_CONTRACTS_MIGRATION_WORKDIR || "/app"; // Print and save the address data console.log(addresses) + console.log(workDir) fs.writeFileSync( workDir + "/addresses.json", JSON.stringify(addresses, null, 2) ); }; + diff --git a/smartcontracts-base/contracts-solc-0.8.8/migrations/token_config.json b/smartcontracts-base/contracts-solc-0.8.13/migrations/token_config.json similarity index 100% rename from smartcontracts-base/contracts-solc-0.8.8/migrations/token_config.json rename to smartcontracts-base/contracts-solc-0.8.13/migrations/token_config.json diff --git a/smartcontracts-base/contracts-solc-0.8.1/truffle-config.js b/smartcontracts-base/contracts-solc-0.8.13/truffle-config.js similarity index 93% rename from smartcontracts-base/contracts-solc-0.8.1/truffle-config.js rename to smartcontracts-base/contracts-solc-0.8.13/truffle-config.js index 8405906..7eb1feb 100644 --- a/smartcontracts-base/contracts-solc-0.8.1/truffle-config.js +++ b/smartcontracts-base/contracts-solc-0.8.13/truffle-config.js @@ -13,7 +13,7 @@ module.exports = { }, compilers: { solc: { - version: "0.8.1", + version: "0.8.13", }, }, }; \ No newline at end of file diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/.allmark/config b/smartcontracts-base/contracts-solc-0.8.8/build/doc/.allmark/config deleted file mode 100644 index 239806c..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/.allmark/config +++ /dev/null @@ -1,75 +0,0 @@ -{ - "Server": { - "ThemeFolderName": "theme", - "DomainName": "localhost", - "HTTP": { - "Enabled": true, - "Bindings": [ - { - "Network": "tcp4", - "IP": "0.0.0.0", - "Zone": "", - "Port": 80 - } - ] - }, - "HTTPS": { - "Enabled": false, - "Bindings": [], - "CertFileName": "cert.pem", - "KeyFileName": "cert.key", - "Force": false - }, - "Authentication": { - "Enabled": false, - "UserStoreFileName": "users.htpasswd" - } - }, - "Web": { - "DefaultLanguage": "en", - "DefaultAuthor": "", - "Publisher": { - "Name": "Vega Protocol", - "Email": "hi@vega.xyz", - "URL": "https://vega.xyz/", - "GooglePlusHandle": "", - "TwitterHandle": "", - "FacebookHandle": "" - }, - "Authors": { - "Unknown": { - "Name": "", - "Email": "", - "URL": "", - "GooglePlusHandle": "", - "TwitterHandle": "", - "FacebookHandle": "" - } - } - }, - "Conversion": { - "DOCX": { - "Enabled": true - }, - "Thumbnails": { - "Enabled": false, - "IndexFileName": "thumbnail.index", - "FolderName": "thumbnails" - } - }, - "LogLevel": "Warn", - "Indexing": { - "Enabled": false, - "IntervalInSeconds": 60 - }, - "LiveReload": { - "Enabled": false - }, - "Analytics": { - "Enabled": false, - "GoogleAnalytics": { - "Enabled": false, - "TrackingID": "" - } - } -} diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/.gitkeep b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/.gitkeep deleted file mode 100644 index 96e8532..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -This directory is populated at runtime. diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Base_Faucet_Token_ABI.json b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Base_Faucet_Token_ABI.json deleted file mode 100644 index 95821fc..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Base_Faucet_Token_ABI.json +++ /dev/null @@ -1,487 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "_decimals", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "total_supply_whole_tokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "faucet_amount", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "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": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "bridge_address", - "type": "address" - }, - { - "internalType": "bytes32[]", - "name": "vega_public_keys", - "type": "bytes32[]" - } - ], - "name": "admin_deposit_bulk", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "bridge_address", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "admin_deposit_single", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "staking_bridge_address", - "type": "address" - }, - { - "internalType": "bytes32[]", - "name": "vega_public_keys", - "type": "bytes32[]" - } - ], - "name": "admin_stake_bulk", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "faucet", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isOwner", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "issue", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "kill", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20Detailed_ABI.json b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20Detailed_ABI.json deleted file mode 100644 index 627d252..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20Detailed_ABI.json +++ /dev/null @@ -1,224 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20_ABI.json b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20_ABI.json deleted file mode 100644 index f93137f..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20_ABI.json +++ /dev/null @@ -1,316 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "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": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "isOwner", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20_Asset_Pool_ABI.json b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20_Asset_Pool_ABI.json deleted file mode 100644 index 2e5e5af..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20_Asset_Pool_ABI.json +++ /dev/null @@ -1,138 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "multisig_control", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "new_address", - "type": "address" - } - ], - "name": "Bridge_Address_Set", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "new_address", - "type": "address" - } - ], - "name": "Multisig_Control_Set", - "type": "event" - }, - { - "inputs": [], - "name": "erc20_bridge_address", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "multisig_control_address", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "new_address", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "set_bridge_address", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "new_address", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "set_multisig_control", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token_address", - "type": "address" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20_Bridge_Logic_Restricted_ABI.json b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20_Bridge_Logic_Restricted_ABI.json deleted file mode 100644 index e2a1966..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/ERC20_Bridge_Logic_Restricted_ABI.json +++ /dev/null @@ -1,589 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address payable", - "name": "erc20_asset_pool", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user_address", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "Asset_Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lifetime_limit", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdraw_threshold", - "type": "uint256" - } - ], - "name": "Asset_Limits_Updated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "vega_asset_id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "Asset_Listed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "Asset_Removed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user_address", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "Asset_Withdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "Bridge_Resumed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "Bridge_Stopped", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "withdraw_delay", - "type": "uint256" - } - ], - "name": "Bridge_Withdraw_Delay_Set", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - } - ], - "name": "Depositor_Exempted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - } - ], - "name": "Depositor_Exemption_Revoked", - "type": "event" - }, - { - "inputs": [], - "name": "default_withdraw_delay", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "deposit_asset", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "erc20_asset_pool_address", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "exempt_depositor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - } - ], - "name": "get_asset_deposit_lifetime_limit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "vega_asset_id", - "type": "bytes32" - } - ], - "name": "get_asset_source", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "get_multisig_control_address", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - } - ], - "name": "get_vega_asset_id", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - } - ], - "name": "get_withdraw_threshold", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "global_resume", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "global_stop", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - } - ], - "name": "is_asset_listed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "depositor", - "type": "address" - } - ], - "name": "is_exempt_depositor", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "is_stopped", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "vega_asset_id", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "lifetime_limit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdraw_threshold", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "list_asset", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "remove_asset", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "revoke_exempt_depositor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "internalType": "uint256", - "name": "lifetime_limit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "threshold", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "set_asset_limits", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "delay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "set_withdraw_delay", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "creation", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "withdraw_asset", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IERC20_ABI.json b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IERC20_ABI.json deleted file mode 100644 index ea3bb35..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IERC20_ABI.json +++ /dev/null @@ -1,185 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IERC20_Bridge_Logic_Restricted_ABI.json b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IERC20_Bridge_Logic_Restricted_ABI.json deleted file mode 100644 index 087ade1..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IERC20_Bridge_Logic_Restricted_ABI.json +++ /dev/null @@ -1,539 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user_address", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "Asset_Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lifetime_limit", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdraw_threshold", - "type": "uint256" - } - ], - "name": "Asset_Limits_Updated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "vega_asset_id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "Asset_Listed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "Asset_Removed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user_address", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "Asset_Withdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "Bridge_Resumed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "Bridge_Stopped", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "withdraw_delay", - "type": "uint256" - } - ], - "name": "Bridge_Withdraw_Delay_Set", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - } - ], - "name": "Depositor_Exempted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - } - ], - "name": "Depositor_Exemption_Revoked", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "deposit_asset", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "exempt_depositor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - } - ], - "name": "get_asset_deposit_lifetime_limit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "vega_asset_id", - "type": "bytes32" - } - ], - "name": "get_asset_source", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "get_multisig_control_address", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - } - ], - "name": "get_vega_asset_id", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - } - ], - "name": "get_withdraw_threshold", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "global_resume", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "global_stop", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - } - ], - "name": "is_asset_listed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "depositor", - "type": "address" - } - ], - "name": "is_exempt_depositor", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "vega_asset_id", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "lifetime_limit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdraw_threshold", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "list_asset", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "remove_asset", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "revoke_exempt_depositor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "internalType": "uint256", - "name": "lifetime_limit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "threshold", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "set_asset_limits", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "delay", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "set_withdraw_delay", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset_source", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "creation", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "withdraw_asset", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IMultisigControl_ABI.json b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IMultisigControl_ABI.json deleted file mode 100644 index e728797..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IMultisigControl_ABI.json +++ /dev/null @@ -1,252 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "NonceBurnt", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "new_signer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "SignerAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "old_signer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "SignerRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "new_threshold", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "ThresholdSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "new_signer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "add_signer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "burn_nonce", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "get_current_threshold", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "get_valid_signer_count", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "is_nonce_used", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "signer_address", - "type": "address" - } - ], - "name": "is_valid_signer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "old_signer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "remove_signer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "new_threshold", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "set_threshold", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "message", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "verify_signatures", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IVega_StakingBridge_ABI.json b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IVega_StakingBridge_ABI.json deleted file mode 100644 index 1196be8..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/IVega_StakingBridge_ABI.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "vega_public_key", - "type": "bytes32" - } - ], - "name": "stake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Killable_ABI.json b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Killable_ABI.json deleted file mode 100644 index 6097b57..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Killable_ABI.json +++ /dev/null @@ -1,74 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [], - "name": "isOwner", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "kill", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/MultisigControl_ABI.json b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/MultisigControl_ABI.json deleted file mode 100644 index bea58e7..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/MultisigControl_ABI.json +++ /dev/null @@ -1,276 +0,0 @@ -[ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "NonceBurnt", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "new_signer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "SignerAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "old_signer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "SignerRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "new_threshold", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "ThresholdSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "new_signer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "add_signer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "burn_nonce", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "get_current_threshold", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "get_valid_signer_count", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "is_nonce_used", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "signer_address", - "type": "address" - } - ], - "name": "is_valid_signer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "old_signer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "remove_signer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "new_threshold", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "set_threshold", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "signers", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "message", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "verify_signatures", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Ownable_ABI.json b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Ownable_ABI.json deleted file mode 100644 index 4da93fa..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/Ownable_ABI.json +++ /dev/null @@ -1,72 +0,0 @@ -[ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [], - "name": "isOwner", - "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": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/SafeMath_ABI.json b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/SafeMath_ABI.json deleted file mode 100644 index fe51488..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/files/abi/SafeMath_ABI.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/index.md b/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/index.md deleted file mode 100644 index 1847d93..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/build/doc/data/index.md +++ /dev/null @@ -1,5 +0,0 @@ -# Data - -Hopefully data is here... - -- [`addresses.json`](files/addresses.json) diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/IERC20.sol b/smartcontracts-base/contracts-solc-0.8.8/contracts/IERC20.sol deleted file mode 100644 index 716c2f0..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/IERC20.sol +++ /dev/null @@ -1,81 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.8; - -/** - * @dev Interface of the ERC20 standard as defined in the EIP. Does not include - * the optional functions; to access them see {ERC20Detailed}. - */ -interface IERC20 { - /** - * @dev Returns the amount of tokens in existence. - */ - function totalSupply() external view returns (uint256); - - /** - * @dev Returns the amount of tokens owned by `account`. - */ - function balanceOf(address account) external view returns (uint256); - - /** - * @dev Moves `amount` tokens from the caller's account to `recipient`. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * Emits a {Transfer} event. - */ - function transfer(address recipient, uint256 amount) external returns (bool); - - /** - * @dev Returns the remaining number of tokens that `spender` will be - * allowed to spend on behalf of `owner` through {transferFrom}. This is - * zero by default. - * - * This value changes when {approve} or {transferFrom} are called. - */ - function allowance(address owner, address spender) external view returns (uint256); - - /** - * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * IMPORTANT: Beware that changing an allowance with this method brings the risk - * that someone may use both the old and the new allowance by unfortunate - * transaction ordering. One possible solution to mitigate this race - * condition is to first reduce the spender's allowance to 0 and set the - * desired value afterwards: - * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - * - * Emits an {Approval} event. - */ - function approve(address spender, uint256 amount) external returns (bool); - - /** - * @dev Moves `amount` tokens from `sender` to `recipient` using the - * allowance mechanism. `amount` is then deducted from the caller's - * allowance. - * - * Returns a boolean value indicating whether the operation succeeded. - * - * Emits a {Transfer} event. - */ - function transferFrom( - address sender, - address recipient, - uint256 amount - ) external returns (bool); - - /** - * @dev Emitted when `value` tokens are moved from one account (`from`) to - * another (`to`). - * - * Note that `value` may be zero. - */ - event Transfer(address indexed from, address indexed to, uint256 value); - - /** - * @dev Emitted when the allowance of a `spender` for an `owner` is set by - * a call to {approve}. `value` is the new allowance. - */ - event Approval(address indexed owner, address indexed spender, uint256 value); -} diff --git a/smartcontracts-base/contracts-solc-0.8.8/contracts/MultisigControl.sol b/smartcontracts-base/contracts-solc-0.8.8/contracts/MultisigControl.sol deleted file mode 100644 index 50b24b2..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/contracts/MultisigControl.sol +++ /dev/null @@ -1,224 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity 0.8.8; - -import "./IMultisigControl.sol"; - -/// @title MultisigControl -/// @author Vega Protocol -/// @notice This contract enables validators, through a multisignature process, to run functions on contracts by consensus -contract MultisigControl is IMultisigControl { - constructor() { - // set initial threshold to 50% - threshold = 500; - signers[msg.sender] = true; - signer_count++; - emit SignerAdded(msg.sender, 0); - } - - uint16 threshold; - uint8 signer_count; - mapping(address => bool) public signers; - mapping(uint256 => bool) used_nonces; - - /**************************FUNCTIONS*********************/ - /// @notice Sets threshold of signatures that must be met before function is executed. - /// @param new_threshold New threshold value - /// @param nonce Vega-assigned single-use number that provides replay attack protection - /// @param signatures Vega-supplied signature bundle of a validator-signed order - /// @notice See MultisigControl for more about signatures - /// @notice Ethereum has no decimals, threshold is % * 10 so 50% == 500 100% == 1000 - /// @notice signatures are OK if they are >= threshold count of total valid signers - /// @dev Emits ThresholdSet event - function set_threshold( - uint16 new_threshold, - uint256 nonce, - bytes calldata signatures - ) external override { - require(new_threshold < 1000 && new_threshold > 0, "new threshold outside range"); - bytes memory message = abi.encode(new_threshold, nonce, "set_threshold"); - require(verify_signatures(signatures, message, nonce), "bad signatures"); - threshold = new_threshold; - emit ThresholdSet(new_threshold, nonce); - } - - /// @notice Adds new valid signer and adjusts signer count. - /// @param new_signer New signer address - /// @param nonce Vega-assigned single-use number that provides replay attack protection - /// @param signatures Vega-supplied signature bundle of a validator-signed order - /// @notice See MultisigControl for more about signatures - /// @dev Emits 'SignerAdded' event - function add_signer( - address new_signer, - uint256 nonce, - bytes calldata signatures - ) external override { - bytes memory message = abi.encode(new_signer, nonce, "add_signer"); - require(!signers[new_signer], "signer already exists"); - require(verify_signatures(signatures, message, nonce), "bad signatures"); - signers[new_signer] = true; - signer_count++; - emit SignerAdded(new_signer, nonce); - } - - /// @notice Removes currently valid signer and adjusts signer count. - /// @param old_signer Address of signer to be removed. - /// @param nonce Vega-assigned single-use number that provides replay attack protection - /// @param signatures Vega-supplied signature bundle of a validator-signed order - /// @notice See MultisigControl for more about signatures - /// @dev Emits 'SignerRemoved' event - function remove_signer( - address old_signer, - uint256 nonce, - bytes calldata signatures - ) external override { - bytes memory message = abi.encode(old_signer, nonce, "remove_signer"); - require(signers[old_signer], "signer doesn't exist"); - require(verify_signatures(signatures, message, nonce), "bad signatures"); - signers[old_signer] = false; - signer_count--; - emit SignerRemoved(old_signer, nonce); - } - - /// @notice Burn an nonce before it gets used by a user. Useful in case the validators needs to prevents a malicious user to do un-permitted action. - /// @param nonce Vega-assigned single-use number that provides replay attack protection - /// @param signatures Vega-supplied signature bundle of a validator-signed order - /// @notice See MultisigControl for more about signatures - /// @dev Emits 'NonceBurnt' event - function burn_nonce(uint256 nonce, bytes calldata signatures) external override { - bytes memory message = abi.encode(nonce, "burn_nonce"); - require(verify_signatures(signatures, message, nonce), "bad signatures"); - emit NonceBurnt(nonce); - } - - /// @notice Verifies a signature bundle and returns true only if the threshold of valid signers is met, - /// @notice this is a function that any function controlled by Vega MUST call to be securely controlled by the Vega network - /// @notice message to hash to sign follows this pattern: - /// @notice abi.encode( abi.encode(param1, param2, param3, ... , nonce, function_name_string), validating_contract_or_submitter_address); - /// @notice Note that validating_contract_or_submitter_address is the submitting party. If on MultisigControl contract itself, it's the submitting ETH address - /// @notice if function on bridge that then calls Multisig, then it's the address of that contract - /// @notice Note also the embedded encoding, this is required to verify what function/contract the function call goes to - /// @return Returns true if valid signatures are over the threshold - function verify_signatures( - bytes calldata signatures, - bytes memory message, - uint256 nonce - ) public override returns (bool) { - require(signatures.length % 65 == 0, "bad sig length"); - require(signatures.length > 0, "must contain at least 1 sig"); - require(!used_nonces[nonce], "nonce already used"); - - uint8 size = 0; - address[] memory signers_temp = new address[](signer_count); - - bytes32 message_hash = keccak256(abi.encode(message, msg.sender)); - uint256 offset; - assembly { - offset := signatures.offset - } - for (uint256 msg_idx = 0; msg_idx < signatures.length; msg_idx += 65) { - //recover address from that msg - bytes32 r; - bytes32 s; - uint8 v; - assembly { - // first 32 bytes, after the length prefix - r := calldataload(add(offset, msg_idx)) - // second 32 bytes - s := calldataload(add(add(offset, msg_idx), 32)) - // final byte (first byte of the next 32 bytes) - v := byte(0, calldataload(add(add(offset, msg_idx), 64))) - } - // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature - // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines - // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most - // signatures from current libraries generate a unique signature with an s-value in the lower half order. - // - // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value - // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or - // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept - // these malleable signatures as well. - require( - uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, - "Malleable signature error" - ); - if (v < 27) v += 27; - - address recovered_address = ecrecover(message_hash, v, r, s); - - if (signers[recovered_address] && !has_signed(signers_temp, recovered_address, size)) { - signers_temp[size] = recovered_address; - size++; - } - } - - used_nonces[nonce] = ((uint256(size) * 1000) / (uint256(signer_count))) > threshold; - return used_nonces[nonce]; - } - - function has_signed( - address[] memory signers_temp, - address signer, - uint8 size - ) private pure returns (bool) { - for (uint256 i; i < size; i++) { - if (signers_temp[i] == signer) { - return true; - } - } - return false; - } - - /// @return Number of valid signers - function get_valid_signer_count() external view override returns (uint8) { - return signer_count; - } - - /// @return Current threshold - function get_current_threshold() external view override returns (uint16) { - return threshold; - } - - /// @param signer_address target potential signer address - /// @return true if address provided is valid signer - function is_valid_signer(address signer_address) external view override returns (bool) { - return signers[signer_address]; - } - - /// @param nonce Nonce to lookup - /// @return true if nonce has been used - function is_nonce_used(uint256 nonce) external view override returns (bool) { - return used_nonces[nonce]; - } -} - -/** -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMWEMMMMMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM -MMMMMMLOVEMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM -MMMMMMMMMMHIXELMMMMMMMMMMMM....................MMMMMNNMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMM....................MMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMM88=........................+MMMMMMMMMM -MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM -MMMMMMMMMMMM.........................MM+..MMM....+MMMMMMMMMM -MMMMMMMMMNMM...................... ..MM?..MMM.. .+MMMMMMMMMM -MMMMNDDMM+........................+MM........MM..+MMMMMMMMMM -MMMMZ.............................+MM....................MMM -MMMMZ.............................+MM....................MMM -MMMMZ.............................+MM....................DDD -MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM -MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM -MM..............................MMZ....ZMMMMMMMMMMMMMMMMMMMM -MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM -MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM -MM......................ZMMMMM.......MMMMMMMMMMMMMMMMMMMMMMM -MM............... ......ZMMMMM.... ..MMMMMMMMMMMMMMMMMMMMMMM -MM...............MMMMM88~.........+MM..ZMMMMMMMMMMMMMMMMMMMM -MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM -MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM -MM.......ZMMMMMMM.......ZMMMMM..MMMMM..ZMMMMMMMMMMMMMMMMMMMM -MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM -MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM*/ diff --git a/smartcontracts-base/contracts-solc-0.8.8/migrations/1_initial_migration.js b/smartcontracts-base/contracts-solc-0.8.8/migrations/1_initial_migration.js deleted file mode 100644 index 16a7ba5..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/migrations/1_initial_migration.js +++ /dev/null @@ -1,5 +0,0 @@ -const Migrations = artifacts.require("Migrations"); - -module.exports = function (deployer) { - deployer.deploy(Migrations); -}; diff --git a/smartcontracts-base/contracts-solc-0.8.8/truffle-config.js b/smartcontracts-base/contracts-solc-0.8.8/truffle-config.js deleted file mode 100644 index 8f55c3d..0000000 --- a/smartcontracts-base/contracts-solc-0.8.8/truffle-config.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = { - networks: { - development: { - host: process.env.GANACHE_HOSTNAME || '127.0.0.1', - port: process.env.GANACHE_PORT || 8545, - network_id: "*", - }, - secondary: { - host: process.env.GANACHE_HOSTNAME || '127.0.0.1', - port: process.env.GANACHE_PORT || 8546, - network_id: "1451", - }, - }, - compilers: { - solc: { - version: "0.8.8", - settings: { - optimizer: { - enabled: true, - runs: 20000 - }, - evmVersion: "london" - }, - }, - }, -}; diff --git a/smartcontracts-base/run b/smartcontracts-base/run index 833606e..380cbb6 100755 --- a/smartcontracts-base/run +++ b/smartcontracts-base/run @@ -21,10 +21,7 @@ while true ; do done if [[ "$resume" = no ]] ; then - # the 0.8.8 contracts must be deployed first since the VEGA ERC20 token address - # is needed for the deployment of the staking/vesting contracts - (cd contracts-solc-0.8.8 || exit; truffle migrate --network $TRUFFLE_NETWORK || exit "$?") - (cd contracts-solc-0.8.1 || exit; truffle migrate --network $TRUFFLE_NETWORK || exit "$?") + (cd contracts-solc-0.8.13 || exit; truffle migrate --network $TRUFFLE_NETWORK || exit "$?") else echo "Resume mode: NOT running truffle migrate" fi diff --git a/smartcontracts-base/version.json b/smartcontracts-base/version.json index d221179..b8c7b9a 100644 --- a/smartcontracts-base/version.json +++ b/smartcontracts-base/version.json @@ -1,4 +1,4 @@ { - "version": "v1.5.2", + "version": "v1.6.0", "name": "vegaprotocol/smartcontracts-base" } \ No newline at end of file From 50bbca2dec451f9deaf119a226fd4570f0d31432 Mon Sep 17 00:00:00 2001 From: wwestgarth Date: Fri, 16 Aug 2024 14:57:40 +0100 Subject: [PATCH 2/2] chore: build and commit new ABI files --- .../data/files/abi/Base_Faucet_Token_ABI.json | 487 +++++++++++++++ .../data/files/abi/ERC20AssetPool_ABI.json | 138 ++++ .../abi/ERC20BridgeLogicRestricted_ABI.json | 589 ++++++++++++++++++ .../doc/data/files/abi/ERC20Detailed_ABI.json | 224 +++++++ .../build/doc/data/files/abi/ERC20_ABI.json | 316 ++++++++++ .../abi/IERC20BridgeLogicRestricted_ABI.json | 539 ++++++++++++++++ .../data/files/abi/IMultisigControl_ABI.json | 252 ++++++++ .../files/abi/IVega_StakingBridge_ABI.json | 20 + .../doc/data/files/abi/Killable_ABI.json | 74 +++ .../data/files/abi/MultisigControl_ABI.json | 276 ++++++++ .../build/doc/data/files/abi/Ownable_ABI.json | 72 +++ .../doc/data/files/abi/SafeMath_ABI.json | 1 + .../doc/data/files/abi/StakingBridge_ABI.json | 203 ++++++ 13 files changed, 3191 insertions(+) create mode 100644 smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Base_Faucet_Token_ABI.json create mode 100644 smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20AssetPool_ABI.json create mode 100644 smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20BridgeLogicRestricted_ABI.json create mode 100644 smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20Detailed_ABI.json create mode 100644 smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20_ABI.json create mode 100644 smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IERC20BridgeLogicRestricted_ABI.json create mode 100644 smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IMultisigControl_ABI.json create mode 100644 smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IVega_StakingBridge_ABI.json create mode 100644 smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Killable_ABI.json create mode 100644 smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/MultisigControl_ABI.json create mode 100644 smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Ownable_ABI.json create mode 100644 smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/SafeMath_ABI.json create mode 100644 smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/StakingBridge_ABI.json diff --git a/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Base_Faucet_Token_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Base_Faucet_Token_ABI.json new file mode 100644 index 0000000..95821fc --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Base_Faucet_Token_ABI.json @@ -0,0 +1,487 @@ +[ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "_decimals", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "total_supply_whole_tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "faucet_amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "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": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "bridge_address", + "type": "address" + }, + { + "internalType": "bytes32[]", + "name": "vega_public_keys", + "type": "bytes32[]" + } + ], + "name": "admin_deposit_bulk", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "bridge_address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "vega_public_key", + "type": "bytes32" + } + ], + "name": "admin_deposit_single", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "staking_bridge_address", + "type": "address" + }, + { + "internalType": "bytes32[]", + "name": "vega_public_keys", + "type": "bytes32[]" + } + ], + "name": "admin_stake_bulk", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "faucet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "issue", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "kill", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20AssetPool_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20AssetPool_ABI.json new file mode 100644 index 0000000..b64f1ba --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20AssetPool_ABI.json @@ -0,0 +1,138 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "multisigControl", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "BridgeAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "MultisigControlSet", + "type": "event" + }, + { + "inputs": [], + "name": "erc20BridgeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "multisigControlAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "setBridgeAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "setMultisigControl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token_address", + "type": "address" + }, + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] diff --git a/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20BridgeLogicRestricted_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20BridgeLogicRestricted_ABI.json new file mode 100644 index 0000000..ddfcd8d --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20BridgeLogicRestricted_ABI.json @@ -0,0 +1,589 @@ +[ + { + "inputs": [ + { + "internalType": "address payable", + "name": "erc20AssetPool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "userAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "vegaPublicKey", + "type": "bytes32" + } + ], + "name": "AssetDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lifetimeLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "withdrawThreshold", + "type": "uint256" + } + ], + "name": "AssetLimitsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "vegaAssetId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "AssetListed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "AssetRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "userAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "AssetWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "BridgeResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "BridgeStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "withdraw_delay", + "type": "uint256" + } + ], + "name": "BridgeWithdrawDelaySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "depositor", + "type": "address" + } + ], + "name": "DepositorExempted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "depositor", + "type": "address" + } + ], + "name": "DepositorExemptionRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "defaultWithdrawDelay", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "vegaPublicKey", + "type": "bytes32" + } + ], + "name": "depositAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "erc20AssetPoolAddress", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "exemptDepositor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + } + ], + "name": "getAssetDepositLifetimeLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "vegaAssetId", + "type": "bytes32" + } + ], + "name": "getAssetSource", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMultisigControlAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + } + ], + "name": "getVegaAssetId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + } + ], + "name": "getWithdrawThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "globalResume", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "globalStop", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + } + ], + "name": "isAssetListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "depositor", + "type": "address" + } + ], + "name": "isExemptDepositor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "is_stopped", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "vegaAssetId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "lifetimeLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "listAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "removeAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeExemptDepositor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "internalType": "uint256", + "name": "lifetimeLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "setAssetLimits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "delay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "setWithdrawDelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "creation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "withdrawAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20Detailed_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20Detailed_ABI.json new file mode 100644 index 0000000..627d252 --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20Detailed_ABI.json @@ -0,0 +1,224 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20_ABI.json new file mode 100644 index 0000000..f93137f --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/ERC20_ABI.json @@ -0,0 +1,316 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "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": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IERC20BridgeLogicRestricted_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IERC20BridgeLogicRestricted_ABI.json new file mode 100644 index 0000000..7bcfc35 --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IERC20BridgeLogicRestricted_ABI.json @@ -0,0 +1,539 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "userAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "vegaPublicKey", + "type": "bytes32" + } + ], + "name": "AssetDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lifetimeLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "withdrawThreshold", + "type": "uint256" + } + ], + "name": "AssetLimitsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "vegaAssetId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "AssetListed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "AssetRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "userAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "AssetWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "BridgeResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "BridgeStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "withdraw_delay", + "type": "uint256" + } + ], + "name": "BridgeWithdrawDelaySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "depositor", + "type": "address" + } + ], + "name": "DepositorExempted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "depositor", + "type": "address" + } + ], + "name": "DepositorExemptionRevoked", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "vegaPublicKey", + "type": "bytes32" + } + ], + "name": "depositAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "exemptDepositor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + } + ], + "name": "getAssetDepositLifetimeLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "vegaAssetId", + "type": "bytes32" + } + ], + "name": "getAssetSource", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMultisigControlAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + } + ], + "name": "getVegaAssetId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + } + ], + "name": "getWithdrawThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "globalResume", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "globalStop", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + } + ], + "name": "isAssetListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "depositor", + "type": "address" + } + ], + "name": "isExemptDepositor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "vegaAssetId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "lifetimeLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "withdrawThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "listAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "removeAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeExemptDepositor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "internalType": "uint256", + "name": "lifetimeLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "setAssetLimits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "delay", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "setWithdrawDelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetSource", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "creation", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "withdrawAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IMultisigControl_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IMultisigControl_ABI.json new file mode 100644 index 0000000..c5f0665 --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IMultisigControl_ABI.json @@ -0,0 +1,252 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "NonceBurnt", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newSigner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "SignerAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldSigner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "SignerRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "newThreshold", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ThresholdSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newSigner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "addSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "burnNonce", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentThreshold", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getValidSignerCount", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "isNonceUsed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer_address", + "type": "address" + } + ], + "name": "isValidSigner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oldSigner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "removeSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "newThreshold", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "setThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "verifySignatures", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IVega_StakingBridge_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IVega_StakingBridge_ABI.json new file mode 100644 index 0000000..1196be8 --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/IVega_StakingBridge_ABI.json @@ -0,0 +1,20 @@ +[ + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "vega_public_key", + "type": "bytes32" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Killable_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Killable_ABI.json new file mode 100644 index 0000000..6097b57 --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Killable_ABI.json @@ -0,0 +1,74 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "kill", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/MultisigControl_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/MultisigControl_ABI.json new file mode 100644 index 0000000..8a2a033 --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/MultisigControl_ABI.json @@ -0,0 +1,276 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "NonceBurnt", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newSigner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "SignerAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldSigner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "SignerRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "newThreshold", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ThresholdSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newSigner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "addSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "burnNonce", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentThreshold", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getValidSignerCount", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "isNonceUsed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer_address", + "type": "address" + } + ], + "name": "isValidSigner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oldSigner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "removeSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "newThreshold", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "setThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "signers", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "verifySignatures", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Ownable_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Ownable_ABI.json new file mode 100644 index 0000000..4da93fa --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/Ownable_ABI.json @@ -0,0 +1,72 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "isOwner", + "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": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/SafeMath_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/SafeMath_ABI.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/SafeMath_ABI.json @@ -0,0 +1 @@ +[] diff --git a/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/StakingBridge_ABI.json b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/StakingBridge_ABI.json new file mode 100644 index 0000000..d5284ff --- /dev/null +++ b/smartcontracts-base/contracts-solc-0.8.13/build/doc/data/files/abi/StakingBridge_ABI.json @@ -0,0 +1,203 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "vegaPublicKey", + "type": "bytes32" + } + ], + "name": "StakeDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "vegaPublicKey", + "type": "bytes32" + } + ], + "name": "StakeRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "vegaPublicKey", + "type": "bytes32" + } + ], + "name": "StakeTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "vegaPublicKey", + "type": "bytes32" + } + ], + "name": "removeStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "vegaPublicKey", + "type": "bytes32" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "vegaPublicKey", + "type": "bytes32" + } + ], + "name": "stakeBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakingToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalStaked", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "newAddress", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "vegaPublicKey", + "type": "bytes32" + } + ], + "name": "transferStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +]