From 4e5fed8b60511c74dc7c6965c6e414e3b378437c Mon Sep 17 00:00:00 2001 From: livingrockrises <90545960+livingrockrises@users.noreply.github.com> Date: Sat, 11 Nov 2023 04:25:43 +0530 Subject: [PATCH] fix failing build and tests --- .../test/accounts/BiconomyAccountFactory.sol | 2 +- contracts/test/accounts/BiconomyAccountImpl.sol | 4 ++-- .../verifying/VerifyingSingletonPaymaster.sol | 7 ------- hardhat.config.ts | 1 + lib/scw-contracts | 2 +- package.json | 7 ++++--- test/TokenPaymaster.t.sol | 16 ++++++++-------- yarn.lock | 10 +++++----- 8 files changed, 22 insertions(+), 27 deletions(-) diff --git a/contracts/test/accounts/BiconomyAccountFactory.sol b/contracts/test/accounts/BiconomyAccountFactory.sol index 4fefb0d..87f4567 100644 --- a/contracts/test/accounts/BiconomyAccountFactory.sol +++ b/contracts/test/accounts/BiconomyAccountFactory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; // temp +pragma solidity ^0.8.20; // temp // Could also use published package or added submodule. diff --git a/contracts/test/accounts/BiconomyAccountImpl.sol b/contracts/test/accounts/BiconomyAccountImpl.sol index 2870b41..fc56520 100644 --- a/contracts/test/accounts/BiconomyAccountImpl.sol +++ b/contracts/test/accounts/BiconomyAccountImpl.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity ^0.8.20; import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {SmartAccount} from "../../../lib/scw-contracts/contracts/smart-account/SmartAccount.sol"; +import {SmartAccount} from "@biconomy-devx/account-contracts-v2/contracts/smart-account/SmartAccount.sol"; // Note: Could also use published package or added submodule. diff --git a/contracts/verifying/VerifyingSingletonPaymaster.sol b/contracts/verifying/VerifyingSingletonPaymaster.sol index a8a5bff..fcc69de 100644 --- a/contracts/verifying/VerifyingSingletonPaymaster.sol +++ b/contracts/verifying/VerifyingSingletonPaymaster.sol @@ -145,13 +145,6 @@ contract VerifyingSingletonPaymaster is emit GasWithdrawn(msg.sender, withdrawAddress, amount); } - /** - @dev Override the default implementation. - */ - function deposit() public payable virtual override { - revert("user DepositFor instead"); - } - /** * @dev This method is called by the off-chain service, to sign the request. * It is called on-chain from the validatePaymasterUserOp, to validate the signature. diff --git a/hardhat.config.ts b/hardhat.config.ts index 5dc25c2..2de922f 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -7,6 +7,7 @@ import "@typechain/hardhat"; import "hardhat-gas-reporter"; import "solidity-coverage"; import "@nomiclabs/hardhat-etherscan"; +import "@nomicfoundation/hardhat-foundry"; const walletUtils = require("./walletUtils"); diff --git a/lib/scw-contracts b/lib/scw-contracts index b5be539..215b464 160000 --- a/lib/scw-contracts +++ b/lib/scw-contracts @@ -1 +1 @@ -Subproject commit b5be5399ef0e411b62b4342e12a15e34c35bb83c +Subproject commit 215b46443013fc9e1a6cfad71b9dc7dab27c53d2 diff --git a/package.json b/package.json index c1a39e3..ded5715 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "test": "yarn test:hardhat && yarn test:foundry", "clean": "yarn hardhat clean && forge clean", - "build": "yarn hardhat compile && yarn hardhat typechain && yarn prepare-typechain && yarn build:foundry", + "build": "yarn hardhat compile && yarn hardhat typechain && yarn prepare-typechain && yarn prepare-sa && yarn build:foundry", "clean:build": "yarn clean && yarn build", "build:foundry": "forge build --via-ir", "build:hardhat": "yarn hardhat compile", @@ -25,6 +25,7 @@ "postpack": "pinst --enable && ./scripts/postpack-contracts.sh", "coverage": "COVERAGE=1 DISABLE_VIA_IR=true hardhat coverage", "prepare-typechain": "cd lib/account-abstraction && yarn install && yarn hardhat typechain", + "prepare-sa": "cd lib/scw-contracts && git checkout develop && cd ../..", "prepare": "husky install" }, "repository": { @@ -45,7 +46,7 @@ "devDependencies": { "@chainlink/contracts": "^0.6.0", "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", - "@nomicfoundation/hardhat-foundry": "^1.0.0", + "@nomicfoundation/hardhat-foundry": "^1.1.1", "@nomicfoundation/hardhat-network-helpers": "^1.0.8", "@nomicfoundation/hardhat-toolbox": "^2.0.2", "@nomiclabs/hardhat-ethers": "^2.2.3", @@ -88,7 +89,7 @@ }, "dependencies": { "@account-abstraction/contracts": "^0.6.0", - "@biconomy-devx/account-contracts-v2": "^2.0.2", + "@biconomy-devx/account-contracts-v2": "^2.0.3", "@biconomy/account-contracts": "^2.0.0", "@chainlink/contracts": "^0.6.0", "@ethersproject/abstract-signer": "^5.6.2", diff --git a/test/TokenPaymaster.t.sol b/test/TokenPaymaster.t.sol index 03f6486..37be690 100644 --- a/test/TokenPaymaster.t.sol +++ b/test/TokenPaymaster.t.sol @@ -232,7 +232,7 @@ contract TokenPaymasterTest is Test { function testCall() external { vm.deal(address(smartAccount), 1e18); (UserOperation memory op, uint256 prefund) = fillUserOp( - address(smartAccount), + smartAccount, keyUser, address(counter), 0, @@ -254,7 +254,7 @@ contract TokenPaymasterTest is Test { usdc.balanceOf(address(_btpm)) ); (UserOperation memory op, uint256 prefund) = fillUserOp( - address(smartAccount), + smartAccount, keyUser, address(usdc), 0, @@ -305,7 +305,7 @@ contract TokenPaymasterTest is Test { usdc.balanceOf(address(_btpm)) ); (UserOperation memory op, uint256 prefund) = fillUserOp( - address(smartAccount), + smartAccount, keyUser, address(usdc), 0, @@ -356,7 +356,7 @@ contract TokenPaymasterTest is Test { usdc.balanceOf(address(_btpm)) ); (UserOperation memory op, uint256 prefund) = fillUserOp( - address(smartAccount), + smartAccount, keyUser, address(usdc), 0, @@ -380,7 +380,7 @@ contract TokenPaymasterTest is Test { usdc.balanceOf(address(_btpm)) ); (UserOperation memory op, uint256 prefund) = fillUserOp( - address(smartAccount), + smartAccount, keyUser, address(usdc), 0, @@ -411,7 +411,7 @@ contract TokenPaymasterTest is Test { usdc.balanceOf(address(_btpm)) ); (UserOperation memory op, uint256 prefund) = fillUserOp( - address(smartAccount), + smartAccount, keyUser, address(usdc), 0, @@ -465,7 +465,7 @@ contract TokenPaymasterTest is Test { usdc.balanceOf(address(_btpm)) ); (UserOperation memory op, uint256 prefund) = fillUserOp( - address(smartAccount), + smartAccount, keyUser, address(usdc), 0, @@ -518,7 +518,7 @@ contract TokenPaymasterTest is Test { usdc.balanceOf(address(_btpm)) ); (UserOperation memory op, uint256 prefund) = fillUserOp( - address(smartAccount), + smartAccount, keyUser, address(usdc), 0, diff --git a/yarn.lock b/yarn.lock index 7c5a71b..5e36217 100644 --- a/yarn.lock +++ b/yarn.lock @@ -144,10 +144,10 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" -"@biconomy-devx/account-contracts-v2@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@biconomy-devx/account-contracts-v2/-/account-contracts-v2-2.0.2.tgz#306ef4de9259fb70e6a556186184a3a3b2561205" - integrity sha512-sBXIFWbsxzRTgjFKJ0sBDssHiFxThU1efKolEn6nvHkN5dvXpzwKWgD15ltgKh1XN7S0NRWLhn/myWMy6kGPGw== +"@biconomy-devx/account-contracts-v2@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@biconomy-devx/account-contracts-v2/-/account-contracts-v2-2.0.3.tgz#df8ee507b3c9fa4db3a8f6d729fe2dc97057be06" + integrity sha512-tv5KfzkyEwfuV+Hcl25/KjR2mXupPDRt55hTPMTGUagaAXjO9XNmQm5Ac1D0GMDN8ZHshAd6ytSRADLYhKZsLA== dependencies: "@account-abstraction/contracts" "^0.6.0" "@ethersproject/abstract-signer" "^5.6.2" @@ -1155,7 +1155,7 @@ deep-eql "^4.0.1" ordinal "^1.0.3" -"@nomicfoundation/hardhat-foundry@^1.0.0": +"@nomicfoundation/hardhat-foundry@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-foundry/-/hardhat-foundry-1.1.1.tgz#db72b1f33f9cfaecc27e67f69ad436f8710162d6" integrity sha512-cXGCBHAiXas9Pg9MhMOpBVQCkWRYoRFG7GJJAph+sdQsfd22iRs5U5Vs9XmpGEQd1yEvYISQZMeE68Nxj65iUQ==