Skip to content

Commit

Permalink
fix: deploy sepolia deposit paymaster, rm overrides in frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
wsdt committed Aug 14, 2024
1 parent 8b6475f commit 78672a4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
11 changes: 7 additions & 4 deletions contracts/script/deploy-sepolia.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ pragma solidity ^0.8.13;

import "forge-std/Script.sol";
import "../contracts/samples/HybridAccount.sol";
import "../contracts/samples/TokenPaymaster.sol";
import "../contracts/core/HCHelper.sol";
import {HybridAccountFactory} from "../contracts/samples/HybridAccountFactory.sol";
import {TokenPrice} from "../contracts/TokenPrice.sol";
import "../contracts/samples/HybridAccountFactory.sol";
import "../contracts/TokenPrice.sol";

contract DeployExample is Script {
// Configs
Expand All @@ -17,16 +18,18 @@ contract DeployExample is Script {
// Contracts
address public entrypoint = vm.envAddress("ENTRY_POINT"); // system wide
address public haFactory = address(0x3DD6EE2e539CCd7EaB881173fB704f766e877848); // System-wide Account factory
address public tokenPaymaster = address(0x8223388f7aF211d84289783ed97ffC5Fefa14256);

// Contracts
HybridAccount public hybridAccount;
HCHelper public hcHelper;
TokenPrice public tokenPrice;
TokenPaymaster public tokenPaymaster;

function run() public {
deployerAddress = vm.addr(deployerPrivateKey);

tokenPaymaster = TokenPaymaster(address(0x8223388f7aF211d84289783ed97ffC5Fefa14256));

vm.startBroadcast(deployerPrivateKey);

hcHelper = new HCHelper(
Expand All @@ -37,7 +40,7 @@ contract DeployExample is Script {
// Deploy using HybridAccountFactory, salt = block.number to force redeploy HybridAccount if already existing from this wallet
hybridAccount = HybridAccountFactory(haFactory).createAccount(deployerAddress, block.number);
IEntryPoint(entrypoint).depositTo{value: 0.001 ether}(address(hybridAccount));
IEntryPoint(entrypoint).depositTo{value: 0.001 ether}(address(tokenPaymaster));
tokenPaymaster.deposit{value: 0.001 ether}();

console.log(address(hybridAccount));

Expand Down
4 changes: 2 additions & 2 deletions contracts/script/deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ contract DeployExample is Script {
tokenPaymaster = new TokenPaymaster(haf, entrypoint, deployerAddress);

entrypoint.depositTo{value: 0.1 ether}(address(hybridAccount)); // only needed for HA
entrypoint.depositTo{value: 0.1 ether}(address(verifyingPaymaster));
entrypoint.depositTo{value: 0.1 ether}(address(tokenPaymaster));
verifyingPaymaster.deposit{value: 0.1 ether}();
tokenPaymaster.deposit{value: 0.1 ether}();
console.log(address(hybridAccount));

simpleAccount = saf.createAccount(deployerAddress, block.number);
Expand Down
2 changes: 1 addition & 1 deletion frontend/.env-boba-sepolia
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VITE_SMART_CONTRACT=0x68e95db47214f6df9a4b3073f17220e2b3107443
VITE_SMART_CONTRACT=0x6b94ac8b16c0034fe0284ea6559b34ecc5e108b4
VITE_RPC_PROVIDER=https://sepolia.boba.network
VITE_SNAP_ORIGIN=npm:@bobanetwork/snap-account-abstraction-keyring-hc
VITE_SNAP_VERSION=1.1.3
2 changes: 1 addition & 1 deletion frontend/.env-boba-sepolia-snaplocal
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VITE_SMART_CONTRACT=0x68e95db47214f6df9a4b3073f17220e2b3107443
VITE_SMART_CONTRACT=0x6b94ac8b16c0034fe0284ea6559b34ecc5e108b4
VITE_RPC_PROVIDER=https://sepolia.boba.network
VITE_SNAP_ORIGIN=local:http://localhost:8080
VITE_SNAP_VERSION=1.1.3
4 changes: 2 additions & 2 deletions frontend/src/components/TokenPriceFetcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ const FormComponent = () => {
to: import.meta.env.VITE_SMART_CONTRACT,
value: "0",
data: txData,
overrides: {
/*overrides: {
callGasLimitReq: 11_000_000_000_000,
maxFeePerGasReq: 11_000_000_000_000,
maxPriorityFeePerGasReq: 11_000_000_000_000,
},
},*/
},
account: state.selectedAcount.id,
scope: `eip155:${state.chain}`,
Expand Down

0 comments on commit 78672a4

Please sign in to comment.