diff --git a/src/stakekit_plugin.h b/src/stakekit_plugin.h index e93a50a..b7c5796 100644 --- a/src/stakekit_plugin.h +++ b/src/stakekit_plugin.h @@ -7,7 +7,7 @@ #define PLUGIN_NAME "StakeKit" -#define NUM_STAKEKIT_SELECTORS 58u +#define NUM_STAKEKIT_SELECTORS 59u #define TICKER_LEN 30u diff --git a/tests/build_local_test_elfs.sh b/tests/build_local_test_elfs.sh index 1abb945..6cb04b2 100755 --- a/tests/build_local_test_elfs.sh +++ b/tests/build_local_test_elfs.sh @@ -6,7 +6,7 @@ #NANOSP_SDK= #FLEX_SDK= #STAX_SDK= -APP_ETHEREUM=/plugin_dev/app-ethereum +APP_ETHEREUM=/plugin_dev/Ledger/app-ethereum # Create elfs folder if it doesn't exist mkdir -p elfs @@ -20,7 +20,7 @@ build_device_elfs() { export BOLOS_SDK="${!sdk_var}" # Build plugin - echo "**Building app-paraswap for ${device}..." + echo "**Building app-stakekit for ${device}..." make clean make -j DEBUG=1 cp bin/app.elf "tests/elfs/plugin_${device,,}.elf" diff --git a/tests/networks/ethereum/stakekit/abis/0x06998af8f39ff8630d1fb515d22781da4dc2ca71.abi.json b/tests/networks/ethereum/stakekit/abis/0x06998af8f39ff8630d1fb515d22781da4dc2ca71.abi.json new file mode 100644 index 0000000..d4ab850 --- /dev/null +++ b/tests/networks/ethereum/stakekit/abis/0x06998af8f39ff8630d1fb515d22781da4dc2ca71.abi.json @@ -0,0 +1,834 @@ +[ + { + "inputs": [], + "payable": false, + "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" + }, + { + "constant": false, + "inputs": [{ "internalType": "bool", "name": "pol", "type": "bool" }], + "name": "_restake", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "claimAmount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "maximumSharesToBurn", + "type": "uint256" + }, + { "internalType": "bool", "name": "pol", "type": "bool" } + ], + "name": "_sellVoucher_new", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "activeAmount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "_minSharesToMint", + "type": "uint256" + } + ], + "name": "buyVoucher", + "outputs": [ + { + "internalType": "uint256", + "name": "amountToDeposit", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "_minSharesToMint", + "type": "uint256" + } + ], + "name": "buyVoucherPOL", + "outputs": [ + { + "internalType": "uint256", + "name": "amountToDeposit", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "_minSharesToMint", + "type": "uint256" + }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "v", "type": "uint8" }, + { "internalType": "bytes32", "name": "r", "type": "bytes32" }, + { "internalType": "bytes32", "name": "s", "type": "bytes32" } + ], + "name": "buyVoucherWithPermit", + "outputs": [ + { + "internalType": "uint256", + "name": "amountToDeposit", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "commissionRate_deprecated", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "delegation", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "token", "type": "address" }, + { + "internalType": "address payable", + "name": "destination", + "type": "address" + }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "drain", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "eventsHub", + "outputs": [ + { "internalType": "contract EventsHub", "name": "", "type": "address" } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "exchangeRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getLiquidRewards", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getRewardPerShare", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getTotalStake", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "initalRewardPerShare", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "_validatorId", "type": "uint256" }, + { + "internalType": "address", + "name": "_stakingLogger", + "type": "address" + }, + { "internalType": "address", "name": "_stakeManager", "type": "address" } + ], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isOwner", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "lastCommissionUpdate_deprecated", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "lock", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "locked", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "migrateIn", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "migrateOut", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "minAmount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "polToken", + "outputs": [ + { "internalType": "contract IERC20Permit", "name": "", "type": "address" } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "restake", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "restakePOL", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "rewardPerShare", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "claimAmount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "maximumSharesToBurn", + "type": "uint256" + } + ], + "name": "sellVoucher", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "claimAmount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "maximumSharesToBurn", + "type": "uint256" + } + ], + "name": "sellVoucherPOL", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "claimAmount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "maximumSharesToBurn", + "type": "uint256" + } + ], + "name": "sellVoucher_new", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "claimAmount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "maximumSharesToBurn", + "type": "uint256" + } + ], + "name": "sellVoucher_newPOL", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "validatorStake", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "delegatedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalAmountToSlash", + "type": "uint256" + } + ], + "name": "slash", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "stakeManager", + "outputs": [ + { + "internalType": "contract IStakeManager", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "stakingLogger", + "outputs": [ + { "internalType": "contract StakingInfo", "name": "", "type": "address" } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalStake_deprecated", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "transferPOL", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "unbondNonces", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "unbonds", + "outputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" }, + { "internalType": "uint256", "name": "withdrawEpoch", "type": "uint256" } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "unbonds_new", + "outputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" }, + { "internalType": "uint256", "name": "withdrawEpoch", "type": "uint256" } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "unlock", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "unstakeClaimTokens", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "unstakeClaimTokensPOL", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "unbondNonce", "type": "uint256" } + ], + "name": "unstakeClaimTokens_new", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "unbondNonce", "type": "uint256" } + ], + "name": "unstakeClaimTokens_newPOL", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "bool", "name": "_delegation", "type": "bool" } + ], + "name": "updateDelegation", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "validatorId", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "validatorRewards_deprecated", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "withdrawExchangeRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "withdrawPool", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "withdrawRewards", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "withdrawRewardsPOL", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "withdrawShares", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + } +] diff --git a/tests/networks/ethereum/stakekit/abis/0x857679d69fe50e7b722f94acd2629d80c355163d.abi.json b/tests/networks/ethereum/stakekit/abis/0x857679d69fe50e7b722f94acd2629d80c355163d.abi.json index 1eddf90..d4ab850 100644 --- a/tests/networks/ethereum/stakekit/abis/0x857679d69fe50e7b722f94acd2629d80c355163d.abi.json +++ b/tests/networks/ethereum/stakekit/abis/0x857679d69fe50e7b722f94acd2629d80c355163d.abi.json @@ -1,4 +1,10 @@ [ + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, { "anonymous": false, "inputs": [ @@ -69,16 +75,39 @@ "type": "event" }, { - "constant": true, - "inputs": [], - "name": "activeAmount", + "constant": false, + "inputs": [{ "internalType": "bool", "name": "pol", "type": "bool" }], + "name": "_restake", "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "claimAmount", "type": "uint256" }, { "internalType": "uint256", - "name": "", + "name": "maximumSharesToBurn", "type": "uint256" - } + }, + { "internalType": "bool", "name": "pol", "type": "bool" } ], + "name": "_sellVoucher_new", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "activeAmount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -86,25 +115,34 @@ { "constant": true, "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } ], "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -112,23 +150,19 @@ { "constant": false, "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "uint256", - "name": "value", + "name": "_minSharesToMint", "type": "uint256" } ], - "name": "approve", + "name": "buyVoucher", "outputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "internalType": "uint256", + "name": "amountToDeposit", + "type": "uint256" } ], "payable": false, @@ -136,41 +170,42 @@ "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { - "internalType": "address", - "name": "owner", - "type": "address" + "internalType": "uint256", + "name": "_minSharesToMint", + "type": "uint256" } ], - "name": "balanceOf", + "name": "buyVoucherPOL", "outputs": [ { "internalType": "uint256", - "name": "", + "name": "amountToDeposit", "type": "uint256" } ], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "uint256", "name": "_minSharesToMint", "type": "uint256" - } + }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "v", "type": "uint8" }, + { "internalType": "bytes32", "name": "r", "type": "bytes32" }, + { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], - "name": "buyVoucher", + "name": "buyVoucherWithPermit", "outputs": [ { "internalType": "uint256", @@ -186,13 +221,7 @@ "constant": true, "inputs": [], "name": "commissionRate_deprecated", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -200,11 +229,7 @@ { "constant": false, "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, + { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "subtractedValue", @@ -212,13 +237,7 @@ } ], "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" @@ -227,13 +246,7 @@ "constant": true, "inputs": [], "name": "delegation", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" @@ -241,21 +254,13 @@ { "constant": false, "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, + { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "address payable", "name": "destination", "type": "address" }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "drain", "outputs": [], @@ -268,11 +273,7 @@ "inputs": [], "name": "eventsHub", "outputs": [ - { - "internalType": "contract EventsHub", - "name": "", - "type": "address" - } + { "internalType": "contract EventsHub", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", @@ -282,13 +283,7 @@ "constant": true, "inputs": [], "name": "exchangeRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -296,20 +291,10 @@ { "constant": true, "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - } + { "internalType": "address", "name": "user", "type": "address" } ], "name": "getLiquidRewards", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -318,13 +303,7 @@ "constant": true, "inputs": [], "name": "getRewardPerShare", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -332,24 +311,12 @@ { "constant": true, "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - } + { "internalType": "address", "name": "user", "type": "address" } ], "name": "getTotalStake", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", @@ -358,46 +325,20 @@ { "constant": false, "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } ], "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "initalRewardPerShare", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -405,21 +346,13 @@ { "constant": false, "inputs": [ - { - "internalType": "uint256", - "name": "_validatorId", - "type": "uint256" - }, + { "internalType": "uint256", "name": "_validatorId", "type": "uint256" }, { "internalType": "address", "name": "_stakingLogger", "type": "address" }, - { - "internalType": "address", - "name": "_stakeManager", - "type": "address" - } + { "internalType": "address", "name": "_stakeManager", "type": "address" } ], "name": "initialize", "outputs": [], @@ -431,13 +364,7 @@ "constant": true, "inputs": [], "name": "isOwner", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" @@ -446,13 +373,7 @@ "constant": true, "inputs": [], "name": "lastCommissionUpdate_deprecated", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -470,13 +391,7 @@ "constant": true, "inputs": [], "name": "locked", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" @@ -484,16 +399,8 @@ { "constant": false, "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "migrateIn", "outputs": [], @@ -504,16 +411,8 @@ { "constant": false, "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "migrateOut", "outputs": [], @@ -525,13 +424,7 @@ "constant": true, "inputs": [], "name": "minAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -540,12 +433,17 @@ "constant": true, "inputs": [], "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "polToken", "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } + { "internalType": "contract IERC20Permit", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", @@ -565,16 +463,20 @@ "inputs": [], "name": "restake", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "restakePOL", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", @@ -584,32 +486,38 @@ "constant": true, "inputs": [], "name": "rewardPerShare", - "outputs": [ + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "claimAmount", "type": "uint256" }, { "internalType": "uint256", - "name": "", + "name": "maximumSharesToBurn", "type": "uint256" } ], + "name": "sellVoucher", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ - { - "internalType": "uint256", - "name": "claimAmount", - "type": "uint256" - }, + { "internalType": "uint256", "name": "claimAmount", "type": "uint256" }, { "internalType": "uint256", "name": "maximumSharesToBurn", "type": "uint256" } ], - "name": "sellVoucher", + "name": "sellVoucherPOL", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -618,18 +526,30 @@ { "constant": false, "inputs": [ + { "internalType": "uint256", "name": "claimAmount", "type": "uint256" }, { "internalType": "uint256", - "name": "claimAmount", + "name": "maximumSharesToBurn", "type": "uint256" - }, + } + ], + "name": "sellVoucher_new", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "claimAmount", "type": "uint256" }, { "internalType": "uint256", "name": "maximumSharesToBurn", "type": "uint256" } ], - "name": "sellVoucher_new", + "name": "sellVoucher_newPOL", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -655,13 +575,7 @@ } ], "name": "slash", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "nonpayable", "type": "function" @@ -686,11 +600,7 @@ "inputs": [], "name": "stakingLogger", "outputs": [ - { - "internalType": "contract StakingInfo", - "name": "", - "type": "address" - } + { "internalType": "contract StakingInfo", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", @@ -700,13 +610,7 @@ "constant": true, "inputs": [], "name": "totalStake_deprecated", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -715,13 +619,7 @@ "constant": true, "inputs": [], "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -729,25 +627,11 @@ { "constant": false, "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" @@ -755,30 +639,12 @@ { "constant": false, "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" @@ -786,11 +652,7 @@ { "constant": false, "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } + { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], @@ -799,47 +661,33 @@ "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } ], + "name": "transferPOL", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "unbondNonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "unbonds", "outputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawEpoch", - "type": "uint256" - } + { "internalType": "uint256", "name": "shares", "type": "uint256" }, + { "internalType": "uint256", "name": "withdrawEpoch", "type": "uint256" } ], "payable": false, "stateMutability": "view", @@ -848,29 +696,13 @@ { "constant": true, "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "unbonds_new", "outputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "withdrawEpoch", - "type": "uint256" - } + { "internalType": "uint256", "name": "shares", "type": "uint256" }, + { "internalType": "uint256", "name": "withdrawEpoch", "type": "uint256" } ], "payable": false, "stateMutability": "view", @@ -894,14 +726,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "constant": false, + "inputs": [], + "name": "unstakeClaimTokensPOL", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": false, "inputs": [ - { - "internalType": "uint256", - "name": "unbondNonce", - "type": "uint256" - } + { "internalType": "uint256", "name": "unbondNonce", "type": "uint256" } ], "name": "unstakeClaimTokens_new", "outputs": [], @@ -912,11 +749,18 @@ { "constant": false, "inputs": [ - { - "internalType": "bool", - "name": "_delegation", - "type": "bool" - } + { "internalType": "uint256", "name": "unbondNonce", "type": "uint256" } + ], + "name": "unstakeClaimTokens_newPOL", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "bool", "name": "_delegation", "type": "bool" } ], "name": "updateDelegation", "outputs": [], @@ -928,13 +772,7 @@ "constant": true, "inputs": [], "name": "validatorId", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -943,13 +781,7 @@ "constant": true, "inputs": [], "name": "validatorRewards_deprecated", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -958,13 +790,7 @@ "constant": true, "inputs": [], "name": "withdrawExchangeRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -973,13 +799,7 @@ "constant": true, "inputs": [], "name": "withdrawPool", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" @@ -993,19 +813,22 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "constant": false, + "inputs": [], + "name": "withdrawRewardsPOL", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": true, "inputs": [], "name": "withdrawShares", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" } -] \ No newline at end of file +] diff --git a/tests/networks/ethereum/stakekit/b2c.json b/tests/networks/ethereum/stakekit/b2c.json index b79dd5e..e71f411 100644 --- a/tests/networks/ethereum/stakekit/b2c.json +++ b/tests/networks/ethereum/stakekit/b2c.json @@ -80,6 +80,52 @@ } } }, + { + "address": "0x06998af8f39ff8630d1fb515d22781da4dc2ca71", + "contractName": "ValidatorShareProxy", + "selectors": { + "0x6ab15071": { + "erc20OfInterest": [], + "method": "buyVoucher", + "plugin": "StakeKit" + }, + "0xe4457a8a": { + "erc20OfInterest": [], + "method": "buyVoucherPOL", + "plugin": "StakeKit" + }, + "0xc83ec04d": { + "erc20OfInterest": [], + "method": "sellVoucher_new", + "plugin": "StakeKit" + }, + "0xe570b78b": { + "erc20OfInterest": [], + "method": "sellVoucher_newPOL", + "plugin": "StakeKit" + }, + "0xe97fddc2": { + "erc20OfInterest": [], + "method": "unstakeClaimTokens_new", + "plugin": "StakeKit" + }, + "0x8759c234": { + "erc20OfInterest": [], + "method": "unstakeClaimTokens_newPOL", + "plugin": "StakeKit" + }, + "0xc7b8981c": { + "erc20OfInterest": [], + "method": "withdrawRewards", + "plugin": "StakeKit" + }, + "0xe0db556b": { + "erc20OfInterest": [], + "method": "withdrawRewardsPOL", + "plugin": "StakeKit" + } + } + }, { "address": "0xc5c9fb6223a989208df27dcee33fc59ff5c26fff", "contractName": "InitializableAdminUpgradeabilityProxy", diff --git a/tests/package.json b/tests/package.json index b36dd0f..158943c 100644 --- a/tests/package.json +++ b/tests/package.json @@ -29,5 +29,6 @@ "@babel/preset-flow": "^7.22.5", "@babel/preset-stage-0": "^7.0.0", "@babel/register": "^7.22.5" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/tests/snapshots/ethereum_flex_ethereum_buy_voucher_pol/00000.png b/tests/snapshots/ethereum_flex_ethereum_buy_voucher_pol/00000.png new file mode 100644 index 0000000..39bf6c5 Binary files /dev/null and b/tests/snapshots/ethereum_flex_ethereum_buy_voucher_pol/00000.png differ diff --git a/tests/snapshots/ethereum_flex_ethereum_buy_voucher_pol/00001.png b/tests/snapshots/ethereum_flex_ethereum_buy_voucher_pol/00001.png new file mode 100644 index 0000000..cc79659 Binary files /dev/null and b/tests/snapshots/ethereum_flex_ethereum_buy_voucher_pol/00001.png differ diff --git a/tests/snapshots/ethereum_flex_ethereum_buy_voucher_pol/00002.png b/tests/snapshots/ethereum_flex_ethereum_buy_voucher_pol/00002.png new file mode 100644 index 0000000..b1b9a33 Binary files /dev/null and b/tests/snapshots/ethereum_flex_ethereum_buy_voucher_pol/00002.png differ diff --git a/tests/snapshots/ethereum_flex_ethereum_buy_voucher_pol/00003.png b/tests/snapshots/ethereum_flex_ethereum_buy_voucher_pol/00003.png new file mode 100644 index 0000000..dabe7af Binary files /dev/null and b/tests/snapshots/ethereum_flex_ethereum_buy_voucher_pol/00003.png differ diff --git a/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00000.png b/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00000.png differ diff --git a/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00001.png b/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00001.png new file mode 100644 index 0000000..3ae0af1 Binary files /dev/null and b/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00001.png differ diff --git a/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00002.png b/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00002.png new file mode 100644 index 0000000..90a9852 Binary files /dev/null and b/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00002.png differ diff --git a/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00003.png b/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00003.png new file mode 100644 index 0000000..eeec632 Binary files /dev/null and b/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00003.png differ diff --git a/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00004.png b/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00004.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00004.png differ diff --git a/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00005.png b/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00005.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/snapshots/ethereum_nanos_ethereum_buy_voucher_pol/00005.png differ diff --git a/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00000.png b/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00000.png differ diff --git a/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00001.png b/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00001.png new file mode 100644 index 0000000..35b3613 Binary files /dev/null and b/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00001.png differ diff --git a/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00002.png b/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00002.png new file mode 100644 index 0000000..1df46e7 Binary files /dev/null and b/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00002.png differ diff --git a/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00003.png b/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00003.png new file mode 100644 index 0000000..89bfa0b Binary files /dev/null and b/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00003.png differ diff --git a/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00004.png b/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00004.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00004.png differ diff --git a/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00005.png b/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00005.png new file mode 100644 index 0000000..a58590b Binary files /dev/null and b/tests/snapshots/ethereum_nanosp_ethereum_buy_voucher_pol/00005.png differ diff --git a/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00000.png b/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00000.png differ diff --git a/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00001.png b/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00001.png new file mode 100644 index 0000000..35b3613 Binary files /dev/null and b/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00001.png differ diff --git a/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00002.png b/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00002.png new file mode 100644 index 0000000..1df46e7 Binary files /dev/null and b/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00002.png differ diff --git a/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00003.png b/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00003.png new file mode 100644 index 0000000..89bfa0b Binary files /dev/null and b/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00003.png differ diff --git a/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00004.png b/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00004.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00004.png differ diff --git a/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00005.png b/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00005.png new file mode 100644 index 0000000..a58590b Binary files /dev/null and b/tests/snapshots/ethereum_nanox_ethereum_buy_voucher_pol/00005.png differ diff --git a/tests/snapshots/ethereum_stax_ethereum_buy_voucher_pol/00000.png b/tests/snapshots/ethereum_stax_ethereum_buy_voucher_pol/00000.png new file mode 100644 index 0000000..9fce5d8 Binary files /dev/null and b/tests/snapshots/ethereum_stax_ethereum_buy_voucher_pol/00000.png differ diff --git a/tests/snapshots/ethereum_stax_ethereum_buy_voucher_pol/00001.png b/tests/snapshots/ethereum_stax_ethereum_buy_voucher_pol/00001.png new file mode 100644 index 0000000..26cf33e Binary files /dev/null and b/tests/snapshots/ethereum_stax_ethereum_buy_voucher_pol/00001.png differ diff --git a/tests/snapshots/ethereum_stax_ethereum_buy_voucher_pol/00002.png b/tests/snapshots/ethereum_stax_ethereum_buy_voucher_pol/00002.png new file mode 100644 index 0000000..6b7e074 Binary files /dev/null and b/tests/snapshots/ethereum_stax_ethereum_buy_voucher_pol/00002.png differ diff --git a/tests/snapshots/ethereum_stax_ethereum_buy_voucher_pol/00003.png b/tests/snapshots/ethereum_stax_ethereum_buy_voucher_pol/00003.png new file mode 100644 index 0000000..339db1b Binary files /dev/null and b/tests/snapshots/ethereum_stax_ethereum_buy_voucher_pol/00003.png differ diff --git a/tests/src/ethereum/ethereum_buy_voucher_pol.test.js b/tests/src/ethereum/ethereum_buy_voucher_pol.test.js new file mode 100644 index 0000000..75cd4a2 --- /dev/null +++ b/tests/src/ethereum/ethereum_buy_voucher_pol.test.js @@ -0,0 +1,47 @@ +import { processTest, populateTransaction } from "../test.fixture"; + +const contractName = "ValidatorShareProxy"; // <= Name of the smart contract + +const testLabel = "ethereum_buy_voucher_pol"; // <= Name of the test +const testDirSuffix = "ethereum_buy_voucher_pol"; // <= directory to compare device snapshots to +const testNetwork = "ethereum"; +const signedPlugin = false; + +const contractAddr = "0x06998af8f39ff8630d1fb515d22781da4dc2ca71"; // <= Address of the smart contract +const chainID = 1; + +// From : https://etherscan.io/tx/0x5c99588f563b6492624322cad17701ae613725bf9d13fc6c60e4a7abd6d93c0a +const inputData = "0xe4457a8a0000000000000000000000000000000000000000000017b28c969594bc1800000000000000000000000000000000000000000000000000000000000000000000"; + +// Create serializedTx and remove the "0x" prefix +const serializedTx = populateTransaction(contractAddr, inputData, chainID); + +const devices = [ + { + name: "nanos", + label: "Nano S", + steps: 4, // <= Define the number of steps for this test case and this device + }, + { + name: "nanox", + label: "Nano X", + steps: 4, // <= Define the number of steps for this test case and this device + }, + { + name: "nanosp", + label: "Nano S+", + steps: 4, // <= Define the number of steps for this test case and this device + }, + { + name: "stax", + label: "Stax", + }, + { + name: "flex", + label: "Flex", + } +]; + +devices.forEach((device) => + processTest(device, contractName, testLabel, testDirSuffix, "", signedPlugin, serializedTx, testNetwork) +);