Skip to content

Commit

Permalink
feat: just use the automatic getters
Browse files Browse the repository at this point in the history
I'm keeping the encoding helper to avoid the ambiguity of the encoding
in javascript, although it's trivial and could be done with the beacon
  • Loading branch information
cpb8010 committed Dec 13, 2024
1 parent e1a48e7 commit 331d26e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions src/AAFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ contract AAFactory {
event AccountCreated(address indexed accountAddress, string uniqueAccountId);

/// @dev The bytecode hash of the beacon proxy, used for deploying proxy accounts.
bytes32 private immutable beaconProxyBytecodeHash;
address private immutable beacon;
bytes32 public immutable beaconProxyBytecodeHash;
address public immutable beacon;

/// @notice A mapping from unique account IDs to their corresponding deployed account addresses.
mapping(string => address) public accountMappings;
Expand All @@ -31,14 +31,6 @@ contract AAFactory {
beacon = _beacon;
}

function getBeaconProxyBytecodeHash() external view returns (bytes32) {
return beaconProxyBytecodeHash;
}

function getBeacon() external view returns (address) {
return beacon;
}

function getEncodedBeacon() external view returns (bytes memory) {
return abi.encode(beacon);
}
Expand Down
2 changes: 1 addition & 1 deletion test/BasicTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("Basic tests", function () {
const factoryAddress = await aaFactoryContract.getAddress();
expect(factoryAddress, "the factory address").to.equal(await fixtures.getAaFactoryAddress(), "factory address match");

const bytecodeHash = await aaFactoryContract.getBeaconProxyBytecodeHash();
const bytecodeHash = await aaFactoryContract.beaconProxyBytecodeHash();
const deployedAccountContract = await fixtures.getAccountProxyContract();
const deployedAccountContractCode = await deployedAccountContract.getDeployedCode();
assert(deployedAccountContractCode != null, "No account code deployed");
Expand Down

0 comments on commit 331d26e

Please sign in to comment.