From a2114e8df657ea0d35e00205c1507ec714fdb2d3 Mon Sep 17 00:00:00 2001 From: Dmitri Tsumak Date: Fri, 28 Jun 2024 00:08:54 +0300 Subject: [PATCH] Update tests and abis --- abi/IEthBlocklistErc20Vault.json | 75 ++++++++++++ abi/IEthBlocklistVault.json | 75 ++++++++++++ abi/IEthErc20Vault.json | 75 ++++++++++++ abi/IEthGenesisVault.json | 75 ++++++++++++ abi/IEthPrivErc20Vault.json | 75 ++++++++++++ abi/IEthPrivVault.json | 75 ++++++++++++ abi/IEthVault.json | 75 ++++++++++++ test/EthErc20Vault.spec.ts | 107 +++++++++++++++++- test/EthVault.mint.spec.ts | 100 +++++++++++++++- .../DepositDataRegistry.spec.ts.snap | 12 +- .../EthBlocklistErc20Vault.spec.ts.snap | 6 +- .../EthBlocklistVault.spec.ts.snap | 4 +- test/__snapshots__/EthErc20Vault.spec.ts.snap | 18 ++- .../EthGenesisVault.spec.ts.snap | 8 +- .../EthPrivErc20Vault.spec.ts.snap | 6 +- test/__snapshots__/EthPrivVault.spec.ts.snap | 2 +- test/__snapshots__/EthVault.burn.spec.ts.snap | 4 +- .../EthVault.deposit.spec.ts.snap | 6 +- .../EthVault.liquidate.spec.ts.snap | 4 +- test/__snapshots__/EthVault.mint.spec.ts.snap | 18 ++- .../EthVault.multicall.spec.ts.snap | 4 +- .../EthVault.register.spec.ts.snap | 4 +- .../EthVault.settings.spec.ts.snap | 6 +- .../__snapshots__/EthVault.state.spec.ts.snap | 4 +- .../__snapshots__/EthVault.token.spec.ts.snap | 10 +- .../EthVault.upgrade.spec.ts.snap | 12 +- .../EthVault.whitelist.spec.ts.snap | 4 +- .../EthVault.withdraw.spec.ts.snap | 10 +- test/__snapshots__/KeeperRewards.spec.ts.snap | 6 +- .../KeeperValidators.spec.ts.snap | 8 +- .../__snapshots__/RewardSplitter.spec.ts.snap | 8 +- .../GnoBlocklistErc20Vault.spec.ts.snap | 4 +- .../GnoBlocklistVault.spec.ts.snap | 2 +- .../__snapshots__/GnoErc20Vault.spec.ts.snap | 2 +- .../GnoPrivErc20Vault.spec.ts.snap | 4 +- .../__snapshots__/GnoPrivVault.spec.ts.snap | 2 +- 36 files changed, 829 insertions(+), 81 deletions(-) diff --git a/abi/IEthBlocklistErc20Vault.json b/abi/IEthBlocklistErc20Vault.json index 32878d39..4df347ea 100644 --- a/abi/IEthBlocklistErc20Vault.json +++ b/abi/IEthBlocklistErc20Vault.json @@ -859,6 +859,30 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "depositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -1539,6 +1563,57 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "rewardsRoot", + "type": "bytes32" + }, + { + "internalType": "int160", + "name": "reward", + "type": "int160" + }, + { + "internalType": "uint160", + "name": "unlockedMevReward", + "type": "uint160" + }, + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + } + ], + "internalType": "struct IKeeperRewards.HarvestParams", + "name": "harvestParams", + "type": "tuple" + } + ], + "name": "updateStateAndDepositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [], "name": "validatorsManager", diff --git a/abi/IEthBlocklistVault.json b/abi/IEthBlocklistVault.json index f2a9765b..3cad0e6c 100644 --- a/abi/IEthBlocklistVault.json +++ b/abi/IEthBlocklistVault.json @@ -716,6 +716,30 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "depositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -1242,6 +1266,57 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "rewardsRoot", + "type": "bytes32" + }, + { + "internalType": "int160", + "name": "reward", + "type": "int160" + }, + { + "internalType": "uint160", + "name": "unlockedMevReward", + "type": "uint160" + }, + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + } + ], + "internalType": "struct IKeeperRewards.HarvestParams", + "name": "harvestParams", + "type": "tuple" + } + ], + "name": "updateStateAndDepositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [], "name": "validatorsManager", diff --git a/abi/IEthErc20Vault.json b/abi/IEthErc20Vault.json index 35b3eecd..d41ef6a2 100644 --- a/abi/IEthErc20Vault.json +++ b/abi/IEthErc20Vault.json @@ -783,6 +783,30 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "depositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -1432,6 +1456,57 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "rewardsRoot", + "type": "bytes32" + }, + { + "internalType": "int160", + "name": "reward", + "type": "int160" + }, + { + "internalType": "uint160", + "name": "unlockedMevReward", + "type": "uint160" + }, + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + } + ], + "internalType": "struct IKeeperRewards.HarvestParams", + "name": "harvestParams", + "type": "tuple" + } + ], + "name": "updateStateAndDepositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [], "name": "validatorsManager", diff --git a/abi/IEthGenesisVault.json b/abi/IEthGenesisVault.json index 731e5730..e8832b92 100644 --- a/abi/IEthGenesisVault.json +++ b/abi/IEthGenesisVault.json @@ -703,6 +703,30 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "depositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -1222,6 +1246,57 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "rewardsRoot", + "type": "bytes32" + }, + { + "internalType": "int160", + "name": "reward", + "type": "int160" + }, + { + "internalType": "uint160", + "name": "unlockedMevReward", + "type": "uint160" + }, + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + } + ], + "internalType": "struct IKeeperRewards.HarvestParams", + "name": "harvestParams", + "type": "tuple" + } + ], + "name": "updateStateAndDepositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [], "name": "validatorsManager", diff --git a/abi/IEthPrivErc20Vault.json b/abi/IEthPrivErc20Vault.json index 55b22cec..fb7abe9c 100644 --- a/abi/IEthPrivErc20Vault.json +++ b/abi/IEthPrivErc20Vault.json @@ -827,6 +827,30 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "depositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -1489,6 +1513,57 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "rewardsRoot", + "type": "bytes32" + }, + { + "internalType": "int160", + "name": "reward", + "type": "int160" + }, + { + "internalType": "uint160", + "name": "unlockedMevReward", + "type": "uint160" + }, + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + } + ], + "internalType": "struct IKeeperRewards.HarvestParams", + "name": "harvestParams", + "type": "tuple" + } + ], + "name": "updateStateAndDepositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { diff --git a/abi/IEthPrivVault.json b/abi/IEthPrivVault.json index 2b789e57..2d63d4e0 100644 --- a/abi/IEthPrivVault.json +++ b/abi/IEthPrivVault.json @@ -684,6 +684,30 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "depositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -1192,6 +1216,57 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "rewardsRoot", + "type": "bytes32" + }, + { + "internalType": "int160", + "name": "reward", + "type": "int160" + }, + { + "internalType": "uint160", + "name": "unlockedMevReward", + "type": "uint160" + }, + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + } + ], + "internalType": "struct IKeeperRewards.HarvestParams", + "name": "harvestParams", + "type": "tuple" + } + ], + "name": "updateStateAndDepositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { diff --git a/abi/IEthVault.json b/abi/IEthVault.json index e519340d..f063a119 100644 --- a/abi/IEthVault.json +++ b/abi/IEthVault.json @@ -640,6 +640,30 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + } + ], + "name": "depositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -1135,6 +1159,57 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "referrer", + "type": "address" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "rewardsRoot", + "type": "bytes32" + }, + { + "internalType": "int160", + "name": "reward", + "type": "int160" + }, + { + "internalType": "uint160", + "name": "unlockedMevReward", + "type": "uint160" + }, + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + } + ], + "internalType": "struct IKeeperRewards.HarvestParams", + "name": "harvestParams", + "type": "tuple" + } + ], + "name": "updateStateAndDepositAndMintOsToken", + "outputs": [ + { + "internalType": "uint256", + "name": "osTokenShares", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [], "name": "validatorsManager", diff --git a/test/EthErc20Vault.spec.ts b/test/EthErc20Vault.spec.ts index 6c4beedf..8ea56240 100644 --- a/test/EthErc20Vault.spec.ts +++ b/test/EthErc20Vault.spec.ts @@ -9,6 +9,8 @@ import { OsTokenConfig, SharedMevEscrow, DepositDataRegistry, + IKeeperRewards, + OsToken, } from '../typechain-types' import snapshotGasCost from './shared/snapshotGasCost' import { @@ -23,6 +25,7 @@ import { collateralizeEthVault, getHarvestParams, getRewardsRootProof, + setAvgRewardPerSecond, updateRewards, } from './shared/rewards' import keccak256 from 'keccak256' @@ -38,7 +41,7 @@ describe('EthErc20Vault', () => { const feePercent = 1000 const metadataIpfsHash = 'bafkreidivzimqfqtoqxkrpge6bjyhlvxqs3rhe73owtmdulaxr5do5in7u' const referrer = '0x' + '1'.repeat(40) - let sender: Wallet, receiver: Wallet, admin: Signer + let sender: Wallet, receiver: Wallet, admin: Signer, dao: Wallet let vault: EthErc20Vault, keeper: Keeper, validatorsRegistry: Contract, @@ -46,10 +49,11 @@ describe('EthErc20Vault', () => { vaultsRegistry: VaultsRegistry, osTokenConfig: OsTokenConfig, sharedMevEscrow: SharedMevEscrow, - depositDataRegistry: DepositDataRegistry + depositDataRegistry: DepositDataRegistry, + osToken: OsToken beforeEach('deploy fixtures', async () => { - ;[sender, receiver, admin] = (await (ethers as any).getSigners()).slice(1, 4) + ;[dao, sender, receiver, admin] = await (ethers as any).getSigners() const fixture = await loadFixture(ethVaultFixture) vault = await fixture.createEthErc20Vault(admin, { capacity, @@ -66,6 +70,7 @@ describe('EthErc20Vault', () => { vaultsRegistry = fixture.vaultsRegistry sharedMevEscrow = fixture.sharedMevEscrow depositDataRegistry = fixture.depositDataRegistry + osToken = fixture.osToken }) it('has id', async () => { @@ -253,4 +258,100 @@ describe('EthErc20Vault', () => { vault.connect(receiver).transferFrom(sender.address, receiver.address, transferShares) ).to.emit(vault, 'Transfer') }) + + it('can deposit and mint osToken in one transaction', async () => { + const assets = ethers.parseEther('1') + let shares = await vault.convertToShares(assets) + + await setAvgRewardPerSecond(dao, vault, keeper, 0) + expect(await vault.osTokenPositions(sender.address)).to.eq(0n) + expect(await vault.getShares(sender.address)).to.eq(0n) + + const config = await osTokenConfig.getConfig(await vault.getAddress()) + let osTokenAssets = (assets * config.ltvPercent) / ethers.parseEther('1') + const osTokenShares = await osTokenVaultController.convertToShares(osTokenAssets) + const receipt = await vault + .connect(sender) + .depositAndMintOsToken(receiver.address, ZERO_ADDRESS, { value: assets }) + + if (MAINNET_FORK.enabled) { + shares += 1n // rounding error + osTokenAssets -= 1n // rounding error + } + + expect(await osToken.balanceOf(receiver.address)).to.eq(osTokenShares) + expect(await vault.osTokenPositions(sender.address)).to.eq(osTokenShares) + expect(await vault.getShares(sender.address)).to.eq(shares) + await expect(receipt) + .to.emit(vault, 'Deposited') + .withArgs(sender.address, sender.address, assets, shares, ZERO_ADDRESS) + await expect(receipt).to.emit(vault, 'Transfer').withArgs(ZERO_ADDRESS, sender.address, shares) + await expect(receipt) + .to.emit(vault, 'OsTokenMinted') + .withArgs(sender.address, receiver.address, osTokenAssets, osTokenShares, ZERO_ADDRESS) + await snapshotGasCost(receipt) + }) + + it('can update state, deposit, and mint osToken in one transaction', async () => { + await setAvgRewardPerSecond(dao, vault, keeper, 0) + const vaultAddr = await vault.getAddress() + const assets = ethers.parseEther('1') + const sharesBefore = await vault.convertToShares(assets) + + await updateRewards( + keeper, + [getHarvestParams(vaultAddr, ethers.parseEther('1'), ethers.parseEther('0'))], + 0 + ) + const tree = await updateRewards( + keeper, + [getHarvestParams(vaultAddr, ethers.parseEther('1.2'), ethers.parseEther('0'))], + 0 + ) + const vaultReward = getHarvestParams( + vaultAddr, + ethers.parseEther('1.2'), + ethers.parseEther('0') + ) + const harvestParams: IKeeperRewards.HarvestParamsStruct = { + rewardsRoot: tree.root, + reward: vaultReward.reward, + unlockedMevReward: vaultReward.unlockedMevReward, + proof: getRewardsRootProof(tree, vaultReward), + } + + expect(await vault.osTokenPositions(sender.address)).to.eq(0n) + expect(await vault.getShares(sender.address)).to.eq(0n) + + const config = await osTokenConfig.getConfig(await vault.getAddress()) + let osTokenAssets = (assets * config.ltvPercent) / ethers.parseEther('1') + const osTokenShares = await osTokenVaultController.convertToShares(osTokenAssets) + const receipt = await vault + .connect(sender) + .updateStateAndDepositAndMintOsToken(receiver.address, ZERO_ADDRESS, harvestParams, { + value: assets, + }) + + let sharesAfter = await vault.convertToShares(assets) + sharesAfter += 1n // rounding error + + if (MAINNET_FORK.enabled) { + osTokenAssets -= 1n // rounding error + } + + expect(sharesBefore).to.gt(sharesAfter) + expect(await osToken.balanceOf(receiver.address)).to.eq(osTokenShares) + expect(await vault.osTokenPositions(sender.address)).to.eq(osTokenShares) + expect(await vault.getShares(sender.address)).to.eq(sharesAfter) + await expect(receipt) + .to.emit(vault, 'Deposited') + .withArgs(sender.address, sender.address, assets, sharesAfter, ZERO_ADDRESS) + await expect(receipt) + .to.emit(vault, 'Transfer') + .withArgs(ZERO_ADDRESS, sender.address, sharesAfter) + await expect(receipt) + .to.emit(vault, 'OsTokenMinted') + .withArgs(sender.address, receiver.address, osTokenAssets, osTokenShares, ZERO_ADDRESS) + await snapshotGasCost(receipt) + }) }) diff --git a/test/EthVault.mint.spec.ts b/test/EthVault.mint.spec.ts index b9acb607..ca4e9edb 100644 --- a/test/EthVault.mint.spec.ts +++ b/test/EthVault.mint.spec.ts @@ -8,6 +8,8 @@ import { VaultsRegistry, OsTokenVaultController, DepositDataRegistry, + OsTokenConfig, + IKeeperRewards, } from '../typechain-types' import { ThenArg } from '../helpers/types' import snapshotGasCost from './shared/snapshotGasCost' @@ -17,10 +19,12 @@ import { ONE_DAY, ZERO_ADDRESS } from './shared/constants' import { collateralizeEthVault, getHarvestParams, + getRewardsRootProof, setAvgRewardPerSecond, updateRewards, } from './shared/rewards' import { extractDepositShares, increaseTime } from './shared/utils' +import { MAINNET_FORK } from '../helpers/constants' describe('EthVault - mint', () => { const assets = ethers.parseEther('2') @@ -31,19 +35,20 @@ describe('EthVault - mint', () => { feePercent: 1000, metadataIpfsHash: 'bafkreidivzimqfqtoqxkrpge6bjyhlvxqs3rhe73owtmdulaxr5do5in7u', } - let dao: Wallet, sender: Wallet, receiver: Wallet, admin: Signer + let dao: Wallet, sender: Wallet, receiver: Wallet, admin: Signer, other: Wallet let vault: EthVault, keeper: Keeper, vaultsRegistry: VaultsRegistry, osTokenVaultController: OsTokenVaultController, osToken: OsToken, validatorsRegistry: Contract, - depositDataRegistry: DepositDataRegistry + depositDataRegistry: DepositDataRegistry, + osTokenConfig: OsTokenConfig let createVault: ThenArg>['createEthVault'] beforeEach('deploy fixture', async () => { - ;[dao, sender, receiver, admin] = await (ethers as any).getSigners() + ;[dao, sender, receiver, admin, other] = await (ethers as any).getSigners() ;({ createEthVault: createVault, keeper, @@ -52,6 +57,7 @@ describe('EthVault - mint', () => { osTokenVaultController, vaultsRegistry, depositDataRegistry, + osTokenConfig, } = await loadFixture(ethVaultFixture)) vault = await createVault(admin, vaultParams) admin = await ethers.getImpersonatedSigner(await vault.admin()) @@ -197,4 +203,92 @@ describe('EthVault - mint', () => { await snapshotGasCost(receipt) }) + + it('can deposit and mint osToken in one transaction', async () => { + await setAvgRewardPerSecond(dao, vault, keeper, 0) + expect(await vault.osTokenPositions(other.address)).to.eq(0n) + expect(await vault.getShares(other.address)).to.eq(0n) + + const config = await osTokenConfig.getConfig(await vault.getAddress()) + let osTokenAssets = (assets * config.ltvPercent) / ethers.parseEther('1') + const osTokenShares = await osTokenVaultController.convertToShares(osTokenAssets) + const receipt = await vault + .connect(other) + .depositAndMintOsToken(receiver.address, ZERO_ADDRESS, { value: assets }) + + if (MAINNET_FORK.enabled) { + osTokenAssets -= 1n // rounding error + } + + expect(await osToken.balanceOf(receiver.address)).to.eq(osTokenShares) + expect(await vault.osTokenPositions(other.address)).to.eq(osTokenShares) + expect(await vault.getShares(other.address)).to.eq(shares) + await expect(receipt) + .to.emit(vault, 'Deposited') + .withArgs(other.address, other.address, assets, shares, ZERO_ADDRESS) + await expect(receipt) + .to.emit(vault, 'OsTokenMinted') + .withArgs(other.address, receiver.address, osTokenAssets, osTokenShares, ZERO_ADDRESS) + await snapshotGasCost(receipt) + }) + + it('can update state, deposit, and mint osToken in one transaction', async () => { + await setAvgRewardPerSecond(dao, vault, keeper, 0) + const vaultAddr = await vault.getAddress() + + await updateRewards( + keeper, + [getHarvestParams(vaultAddr, ethers.parseEther('1'), ethers.parseEther('0'))], + 0 + ) + + const tree = await updateRewards( + keeper, + [getHarvestParams(vaultAddr, ethers.parseEther('1.2'), ethers.parseEther('0'))], + 0 + ) + const vaultReward = getHarvestParams( + vaultAddr, + ethers.parseEther('1.2'), + ethers.parseEther('0') + ) + const harvestParams: IKeeperRewards.HarvestParamsStruct = { + rewardsRoot: tree.root, + reward: vaultReward.reward, + unlockedMevReward: vaultReward.unlockedMevReward, + proof: getRewardsRootProof(tree, vaultReward), + } + const sharesBefore = await vault.convertToShares(assets) + + expect(await vault.osTokenPositions(other.address)).to.eq(0n) + expect(await vault.getShares(other.address)).to.eq(0n) + + const config = await osTokenConfig.getConfig(await vault.getAddress()) + let osTokenAssets = (assets * config.ltvPercent) / ethers.parseEther('1') + const osTokenShares = await osTokenVaultController.convertToShares(osTokenAssets) + + const receipt = await vault + .connect(other) + .updateStateAndDepositAndMintOsToken(receiver.address, ZERO_ADDRESS, harvestParams, { + value: assets, + }) + let sharesAfter = await vault.convertToShares(assets) + sharesAfter += 1n // rounding error + + if (MAINNET_FORK.enabled) { + osTokenAssets -= 1n // rounding error + } + + expect(sharesBefore).to.gt(sharesAfter) + expect(await osToken.balanceOf(receiver.address)).to.eq(osTokenShares) + expect(await vault.osTokenPositions(other.address)).to.eq(osTokenShares) + expect(await vault.getShares(other.address)).to.eq(sharesAfter) + await expect(receipt) + .to.emit(vault, 'Deposited') + .withArgs(other.address, other.address, assets, sharesAfter, ZERO_ADDRESS) + await expect(receipt) + .to.emit(vault, 'OsTokenMinted') + .withArgs(other.address, receiver.address, osTokenAssets, osTokenShares, ZERO_ADDRESS) + await snapshotGasCost(receipt) + }) }) diff --git a/test/__snapshots__/DepositDataRegistry.spec.ts.snap b/test/__snapshots__/DepositDataRegistry.spec.ts.snap index 193d7172..9876ff44 100644 --- a/test/__snapshots__/DepositDataRegistry.spec.ts.snap +++ b/test/__snapshots__/DepositDataRegistry.spec.ts.snap @@ -3,41 +3,41 @@ exports[`DepositDataRegistry deposit data manager update succeeds 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 63721, + "gasUsed": 63787, } `; exports[`DepositDataRegistry deposit data root update success 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 64529, + "gasUsed": 64551, } `; exports[`DepositDataRegistry migrate succeeds 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 164874, + "gasUsed": 164940, } `; exports[`DepositDataRegistry multiple validators succeeds 1`] = ` Object { "calldataByteLength": 3364, - "gasUsed": 688151, + "gasUsed": 688195, } `; exports[`DepositDataRegistry single validator can update state and register validator 1`] = ` Object { "calldataByteLength": 1636, - "gasUsed": 407161, + "gasUsed": 407205, } `; exports[`DepositDataRegistry single validator succeeds 1`] = ` Object { "calldataByteLength": 1156, - "gasUsed": 333777, + "gasUsed": 333821, } `; diff --git a/test/__snapshots__/EthBlocklistErc20Vault.spec.ts.snap b/test/__snapshots__/EthBlocklistErc20Vault.spec.ts.snap index 53803d9b..e6336959 100644 --- a/test/__snapshots__/EthBlocklistErc20Vault.spec.ts.snap +++ b/test/__snapshots__/EthBlocklistErc20Vault.spec.ts.snap @@ -3,7 +3,7 @@ exports[`EthBlocklistErc20Vault deposit can be called by not blocked user 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 71093, + "gasUsed": 71137, } `; @@ -17,13 +17,13 @@ Object { exports[`EthBlocklistErc20Vault mint osToken can mint from not blocked user 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 177293, + "gasUsed": 177634, } `; exports[`EthBlocklistErc20Vault transfer can transfer 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 58921, + "gasUsed": 58888, } `; diff --git a/test/__snapshots__/EthBlocklistVault.spec.ts.snap b/test/__snapshots__/EthBlocklistVault.spec.ts.snap index a9482693..98abb518 100644 --- a/test/__snapshots__/EthBlocklistVault.spec.ts.snap +++ b/test/__snapshots__/EthBlocklistVault.spec.ts.snap @@ -3,7 +3,7 @@ exports[`EthBlocklistVault deposit can be called by not blocked user 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 68968, + "gasUsed": 69045, } `; @@ -17,6 +17,6 @@ Object { exports[`EthBlocklistVault mint osToken can mint from not blocked user 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 177110, + "gasUsed": 177451, } `; diff --git a/test/__snapshots__/EthErc20Vault.spec.ts.snap b/test/__snapshots__/EthErc20Vault.spec.ts.snap index 06d196d5..87fc1736 100644 --- a/test/__snapshots__/EthErc20Vault.spec.ts.snap +++ b/test/__snapshots__/EthErc20Vault.spec.ts.snap @@ -1,9 +1,23 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`EthErc20Vault can deposit and mint osToken in one transaction 1`] = ` +Object { + "calldataByteLength": 68, + "gasUsed": 212573, +} +`; + +exports[`EthErc20Vault can update state, deposit, and mint osToken in one transaction 1`] = ` +Object { + "calldataByteLength": 260, + "gasUsed": 266104, +} +`; + exports[`EthErc20Vault deposit emits transfer event 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 68776, + "gasUsed": 68820, } `; @@ -17,7 +31,7 @@ Object { exports[`EthErc20Vault enter exit queue emits transfer event 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 96269, + "gasUsed": 96214, } `; diff --git a/test/__snapshots__/EthGenesisVault.spec.ts.snap b/test/__snapshots__/EthGenesisVault.spec.ts.snap index d6b5a144..bcf1cbe4 100644 --- a/test/__snapshots__/EthGenesisVault.spec.ts.snap +++ b/test/__snapshots__/EthGenesisVault.spec.ts.snap @@ -10,28 +10,28 @@ Object { exports[`EthGenesisVault migrate migrates from rewardEthToken 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 79583, + "gasUsed": 79627, } `; exports[`EthGenesisVault pulls withdrawals on claim exited assets 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 77206, + "gasUsed": 77228, } `; exports[`EthGenesisVault pulls withdrawals on multiple validators registration 1`] = ` Object { "calldataByteLength": 3748, - "gasUsed": 652669, + "gasUsed": 652713, } `; exports[`EthGenesisVault pulls withdrawals on single validator registration 1`] = ` Object { "calldataByteLength": 1188, - "gasUsed": 312860, + "gasUsed": 312904, } `; diff --git a/test/__snapshots__/EthPrivErc20Vault.spec.ts.snap b/test/__snapshots__/EthPrivErc20Vault.spec.ts.snap index 768e5f33..c35725b0 100644 --- a/test/__snapshots__/EthPrivErc20Vault.spec.ts.snap +++ b/test/__snapshots__/EthPrivErc20Vault.spec.ts.snap @@ -3,7 +3,7 @@ exports[`EthPrivErc20Vault deposit can be called by whitelisted user 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 71081, + "gasUsed": 71125, } `; @@ -17,13 +17,13 @@ Object { exports[`EthPrivErc20Vault mint osToken can mint from whitelisted user 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 177318, + "gasUsed": 177659, } `; exports[`EthPrivErc20Vault transfer can transfer to whitelisted user 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 58949, + "gasUsed": 58916, } `; diff --git a/test/__snapshots__/EthPrivVault.spec.ts.snap b/test/__snapshots__/EthPrivVault.spec.ts.snap index 493223fb..ec940bf9 100644 --- a/test/__snapshots__/EthPrivVault.spec.ts.snap +++ b/test/__snapshots__/EthPrivVault.spec.ts.snap @@ -3,6 +3,6 @@ exports[`EthPrivVault mint osToken can mint from not whitelisted user 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 177135, + "gasUsed": 177476, } `; diff --git a/test/__snapshots__/EthVault.burn.spec.ts.snap b/test/__snapshots__/EthVault.burn.spec.ts.snap index a51cb50b..38a818a3 100644 --- a/test/__snapshots__/EthVault.burn.spec.ts.snap +++ b/test/__snapshots__/EthVault.burn.spec.ts.snap @@ -3,13 +3,13 @@ exports[`EthVault - burn burns osTokens 1`] = ` Object { "calldataByteLength": 36, - "gasUsed": 101881, + "gasUsed": 101925, } `; exports[`EthVault - burn updates position accumulated fee 1`] = ` Object { "calldataByteLength": 36, - "gasUsed": 101881, + "gasUsed": 101925, } `; diff --git a/test/__snapshots__/EthVault.deposit.spec.ts.snap b/test/__snapshots__/EthVault.deposit.spec.ts.snap index f95ebfc3..630f1d08 100644 --- a/test/__snapshots__/EthVault.deposit.spec.ts.snap +++ b/test/__snapshots__/EthVault.deposit.spec.ts.snap @@ -3,14 +3,14 @@ exports[`EthVault - deposit empty vault: no assets & no shares deposit 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 66651, + "gasUsed": 66728, } `; exports[`EthVault - deposit full vault: assets & shares deposit 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 66651, + "gasUsed": 66728, } `; @@ -24,6 +24,6 @@ Object { exports[`EthVault - deposit full vault: assets & shares update state and deposit 1`] = ` Object { "calldataByteLength": 260, - "gasUsed": 155242, + "gasUsed": 155301, } `; diff --git a/test/__snapshots__/EthVault.liquidate.spec.ts.snap b/test/__snapshots__/EthVault.liquidate.spec.ts.snap index 85eac6df..25845be7 100644 --- a/test/__snapshots__/EthVault.liquidate.spec.ts.snap +++ b/test/__snapshots__/EthVault.liquidate.spec.ts.snap @@ -3,13 +3,13 @@ exports[`EthVault - liquidate calculates liquidation correctly 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 112434, + "gasUsed": 112425, } `; exports[`EthVault - liquidate can liquidate 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 112434, + "gasUsed": 112425, } `; diff --git a/test/__snapshots__/EthVault.mint.spec.ts.snap b/test/__snapshots__/EthVault.mint.spec.ts.snap index f4f28236..a1df8a3c 100644 --- a/test/__snapshots__/EthVault.mint.spec.ts.snap +++ b/test/__snapshots__/EthVault.mint.spec.ts.snap @@ -1,15 +1,29 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`EthVault - mint can deposit and mint osToken in one transaction 1`] = ` +Object { + "calldataByteLength": 68, + "gasUsed": 210457, +} +`; + +exports[`EthVault - mint can update state, deposit, and mint osToken in one transaction 1`] = ` +Object { + "calldataByteLength": 260, + "gasUsed": 262099, +} +`; + exports[`EthVault - mint mints osTokens to the receiver 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 174835, + "gasUsed": 175230, } `; exports[`EthVault - mint updates position accumulated fee 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 119952, + "gasUsed": 120345, } `; diff --git a/test/__snapshots__/EthVault.multicall.spec.ts.snap b/test/__snapshots__/EthVault.multicall.spec.ts.snap index 6c4503d0..aaddd1de 100644 --- a/test/__snapshots__/EthVault.multicall.spec.ts.snap +++ b/test/__snapshots__/EthVault.multicall.spec.ts.snap @@ -3,13 +3,13 @@ exports[`EthVault - multicall can update state and queue for exit 1`] = ` Object { "calldataByteLength": 516, - "gasUsed": 168255, + "gasUsed": 168266, } `; exports[`EthVault - multicall can update state and queue for exit 2`] = ` Object { "calldataByteLength": 548, - "gasUsed": 109636, + "gasUsed": 109702, } `; diff --git a/test/__snapshots__/EthVault.register.spec.ts.snap b/test/__snapshots__/EthVault.register.spec.ts.snap index 51942e45..ea9ad39f 100644 --- a/test/__snapshots__/EthVault.register.spec.ts.snap +++ b/test/__snapshots__/EthVault.register.spec.ts.snap @@ -3,13 +3,13 @@ exports[`EthVault - register multiple validators succeeds from validators manager 1`] = ` Object { "calldataByteLength": 2596, - "gasUsed": 631206, + "gasUsed": 631228, } `; exports[`EthVault - register single validator succeeds from validators manager 1`] = ` Object { "calldataByteLength": 1028, - "gasUsed": 298394, + "gasUsed": 298416, } `; diff --git a/test/__snapshots__/EthVault.settings.spec.ts.snap b/test/__snapshots__/EthVault.settings.spec.ts.snap index 1fea2389..3bc2250a 100644 --- a/test/__snapshots__/EthVault.settings.spec.ts.snap +++ b/test/__snapshots__/EthVault.settings.spec.ts.snap @@ -3,20 +3,20 @@ exports[`EthVault - settings fee recipient can update 1`] = ` Object { "calldataByteLength": 36, - "gasUsed": 43976, + "gasUsed": 44020, } `; exports[`EthVault - settings metadata IPFS hash only admin can update 1`] = ` Object { "calldataByteLength": 132, - "gasUsed": 32601, + "gasUsed": 32623, } `; exports[`EthVault - settings validators manager can be updated by admin 1`] = ` Object { "calldataByteLength": 36, - "gasUsed": 52753, + "gasUsed": 52775, } `; diff --git a/test/__snapshots__/EthVault.state.spec.ts.snap b/test/__snapshots__/EthVault.state.spec.ts.snap index d1b4a8cd..d7e4a7eb 100644 --- a/test/__snapshots__/EthVault.state.spec.ts.snap +++ b/test/__snapshots__/EthVault.state.spec.ts.snap @@ -3,14 +3,14 @@ exports[`EthVault - state allocates fee to recipient when delta is above zero 1`] = ` Object { "calldataByteLength": 196, - "gasUsed": 117456, + "gasUsed": 117478, } `; exports[`EthVault - state applies penalty when delta is below zero 1`] = ` Object { "calldataByteLength": 196, - "gasUsed": 117253, + "gasUsed": 117275, } `; diff --git a/test/__snapshots__/EthVault.token.spec.ts.snap b/test/__snapshots__/EthVault.token.spec.ts.snap index 1e7ef408..688acb40 100644 --- a/test/__snapshots__/EthVault.token.spec.ts.snap +++ b/test/__snapshots__/EthVault.token.spec.ts.snap @@ -17,34 +17,34 @@ Object { exports[`EthVault - token permit accepts owner signature 1`] = ` Object { "calldataByteLength": 228, - "gasUsed": 82335, + "gasUsed": 82379, } `; exports[`EthVault - token transfer from when the spender has enough allowance when the token owner has enough balance transfers the requested amount 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 54780, + "gasUsed": 54703, } `; exports[`EthVault - token transfer from when the spender has unlimited allowance does not decrease the spender allowance 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 61256, + "gasUsed": 61179, } `; exports[`EthVault - token transfer when the sender transfers all balance transfers the requested amount 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 54399, + "gasUsed": 54366, } `; exports[`EthVault - token transfer when the sender transfers zero tokens transfers the requested amount 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 36475, + "gasUsed": 36442, } `; diff --git a/test/__snapshots__/EthVault.upgrade.spec.ts.snap b/test/__snapshots__/EthVault.upgrade.spec.ts.snap index eb6ecb44..d76e3bdd 100644 --- a/test/__snapshots__/EthVault.upgrade.spec.ts.snap +++ b/test/__snapshots__/EthVault.upgrade.spec.ts.snap @@ -3,41 +3,41 @@ exports[`EthVault - upgrade does not modify the state variables 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 186933, + "gasUsed": 186999, } `; exports[`EthVault - upgrade does not modify the state variables 2`] = ` Object { "calldataByteLength": 100, - "gasUsed": 187729, + "gasUsed": 187795, } `; exports[`EthVault - upgrade does not modify the state variables 3`] = ` Object { "calldataByteLength": 100, - "gasUsed": 187197, + "gasUsed": 187263, } `; exports[`EthVault - upgrade does not modify the state variables 4`] = ` Object { "calldataByteLength": 100, - "gasUsed": 187981, + "gasUsed": 188047, } `; exports[`EthVault - upgrade does not modify the state variables 5`] = ` Object { "calldataByteLength": 100, - "gasUsed": 187023, + "gasUsed": 187089, } `; exports[`EthVault - upgrade works with valid call data 1`] = ` Object { "calldataByteLength": 132, - "gasUsed": 76023, + "gasUsed": 76089, } `; diff --git a/test/__snapshots__/EthVault.whitelist.spec.ts.snap b/test/__snapshots__/EthVault.whitelist.spec.ts.snap index a2dd1c85..1c38af0a 100644 --- a/test/__snapshots__/EthVault.whitelist.spec.ts.snap +++ b/test/__snapshots__/EthVault.whitelist.spec.ts.snap @@ -3,7 +3,7 @@ exports[`EthVault - whitelist deposit can be called by whitelisted user 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 68956, + "gasUsed": 69033, } `; @@ -17,7 +17,7 @@ Object { exports[`EthVault - whitelist set whitelister admin can update whitelister 1`] = ` Object { "calldataByteLength": 36, - "gasUsed": 36135, + "gasUsed": 36179, } `; diff --git a/test/__snapshots__/EthVault.withdraw.spec.ts.snap b/test/__snapshots__/EthVault.withdraw.spec.ts.snap index c93685ab..990791d5 100644 --- a/test/__snapshots__/EthVault.withdraw.spec.ts.snap +++ b/test/__snapshots__/EthVault.withdraw.spec.ts.snap @@ -3,35 +3,35 @@ exports[`EthVault - withdraw claim exited assets for single user in multiple checkpoints in multiple transactions 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 75936, + "gasUsed": 75958, } `; exports[`EthVault - withdraw claim exited assets for single user in multiple checkpoints in multiple transactions 2`] = ` Object { "calldataByteLength": 100, - "gasUsed": 48772, + "gasUsed": 48789, } `; exports[`EthVault - withdraw claim exited assets for single user in multiple checkpoints in single transaction 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 51372, + "gasUsed": 51394, } `; exports[`EthVault - withdraw claim exited assets for single user in single checkpoint 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 48772, + "gasUsed": 48789, } `; exports[`EthVault - withdraw enter exit queue locks assets for the time of exit 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 77366, + "gasUsed": 77311, } `; diff --git a/test/__snapshots__/KeeperRewards.spec.ts.snap b/test/__snapshots__/KeeperRewards.spec.ts.snap index f43aac8e..547a7cc5 100644 --- a/test/__snapshots__/KeeperRewards.spec.ts.snap +++ b/test/__snapshots__/KeeperRewards.spec.ts.snap @@ -24,21 +24,21 @@ Object { exports[`KeeperRewards harvest (shared escrow) succeeds for latest rewards root 1`] = ` Object { "calldataByteLength": 292, - "gasUsed": 143858, + "gasUsed": 143880, } `; exports[`KeeperRewards harvest (shared escrow) succeeds for previous rewards root 1`] = ` Object { "calldataByteLength": 292, - "gasUsed": 146012, + "gasUsed": 146034, } `; exports[`KeeperRewards harvest (shared escrow) succeeds for previous rewards root 2`] = ` Object { "calldataByteLength": 196, - "gasUsed": 90377, + "gasUsed": 90399, } `; diff --git a/test/__snapshots__/KeeperValidators.spec.ts.snap b/test/__snapshots__/KeeperValidators.spec.ts.snap index 37bab303..e5f8401b 100644 --- a/test/__snapshots__/KeeperValidators.spec.ts.snap +++ b/test/__snapshots__/KeeperValidators.spec.ts.snap @@ -3,28 +3,28 @@ exports[`KeeperValidators register multiple validators succeeds 1`] = ` Object { "calldataByteLength": 3748, - "gasUsed": 694556, + "gasUsed": 694600, } `; exports[`KeeperValidators register multiple validators succeeds 2`] = ` Object { "calldataByteLength": 3748, - "gasUsed": 602788, + "gasUsed": 602832, } `; exports[`KeeperValidators register single validator succeeds 1`] = ` Object { "calldataByteLength": 1540, - "gasUsed": 340203, + "gasUsed": 340247, } `; exports[`KeeperValidators register single validator succeeds 2`] = ` Object { "calldataByteLength": 1540, - "gasUsed": 286546, + "gasUsed": 286590, } `; diff --git a/test/__snapshots__/RewardSplitter.spec.ts.snap b/test/__snapshots__/RewardSplitter.spec.ts.snap index b233e7cd..254e5b12 100644 --- a/test/__snapshots__/RewardSplitter.spec.ts.snap +++ b/test/__snapshots__/RewardSplitter.spec.ts.snap @@ -3,7 +3,7 @@ exports[`RewardSplitter decrease shares owner can decrease shares 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 66997, + "gasUsed": 67063, } `; @@ -17,20 +17,20 @@ Object { exports[`RewardSplitter sync rewards anyone can sync rewards 1`] = ` Object { "calldataByteLength": 4, - "gasUsed": 73022, + "gasUsed": 73088, } `; exports[`RewardSplitter withdraw rewards can claim vault tokens for ERC-20 vault 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 78136, + "gasUsed": 78103, } `; exports[`RewardSplitter withdraw rewards can enter exit queue with multicall 1`] = ` Object { "calldataByteLength": 612, - "gasUsed": 170789, + "gasUsed": 170800, } `; diff --git a/test/gnosis/__snapshots__/GnoBlocklistErc20Vault.spec.ts.snap b/test/gnosis/__snapshots__/GnoBlocklistErc20Vault.spec.ts.snap index 308c5105..7c2f92a4 100644 --- a/test/gnosis/__snapshots__/GnoBlocklistErc20Vault.spec.ts.snap +++ b/test/gnosis/__snapshots__/GnoBlocklistErc20Vault.spec.ts.snap @@ -10,13 +10,13 @@ Object { exports[`GnoBlocklistErc20Vault mint osToken can mint from not blocked user 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 177249, + "gasUsed": 177583, } `; exports[`GnoBlocklistErc20Vault transfer can transfer 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 58911, + "gasUsed": 58834, } `; diff --git a/test/gnosis/__snapshots__/GnoBlocklistVault.spec.ts.snap b/test/gnosis/__snapshots__/GnoBlocklistVault.spec.ts.snap index a5d71e8c..9a8f4f66 100644 --- a/test/gnosis/__snapshots__/GnoBlocklistVault.spec.ts.snap +++ b/test/gnosis/__snapshots__/GnoBlocklistVault.spec.ts.snap @@ -10,6 +10,6 @@ Object { exports[`GnoBlocklistVault mint osToken can mint from not blocked user 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 177066, + "gasUsed": 177400, } `; diff --git a/test/gnosis/__snapshots__/GnoErc20Vault.spec.ts.snap b/test/gnosis/__snapshots__/GnoErc20Vault.spec.ts.snap index 82f6176e..68bc178c 100644 --- a/test/gnosis/__snapshots__/GnoErc20Vault.spec.ts.snap +++ b/test/gnosis/__snapshots__/GnoErc20Vault.spec.ts.snap @@ -10,6 +10,6 @@ Object { exports[`GnoErc20Vault enter exit queue emits transfer event 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 96259, + "gasUsed": 96182, } `; diff --git a/test/gnosis/__snapshots__/GnoPrivErc20Vault.spec.ts.snap b/test/gnosis/__snapshots__/GnoPrivErc20Vault.spec.ts.snap index fe6319aa..f7fde38c 100644 --- a/test/gnosis/__snapshots__/GnoPrivErc20Vault.spec.ts.snap +++ b/test/gnosis/__snapshots__/GnoPrivErc20Vault.spec.ts.snap @@ -10,13 +10,13 @@ Object { exports[`GnoPrivErc20Vault mint osToken can mint from not whitelisted user 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 177274, + "gasUsed": 177608, } `; exports[`GnoPrivErc20Vault transfer can transfer to whitelisted user 1`] = ` Object { "calldataByteLength": 68, - "gasUsed": 58939, + "gasUsed": 58862, } `; diff --git a/test/gnosis/__snapshots__/GnoPrivVault.spec.ts.snap b/test/gnosis/__snapshots__/GnoPrivVault.spec.ts.snap index 097013a1..6becd2be 100644 --- a/test/gnosis/__snapshots__/GnoPrivVault.spec.ts.snap +++ b/test/gnosis/__snapshots__/GnoPrivVault.spec.ts.snap @@ -10,6 +10,6 @@ Object { exports[`GnoPrivVault mint osToken can mint from not whitelisted user 1`] = ` Object { "calldataByteLength": 100, - "gasUsed": 177091, + "gasUsed": 177425, } `;