@towns-protocol/contracts 0.0.306 → 0.0.307

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@towns-protocol/contracts",
3
- "version": "0.0.306",
3
+ "version": "0.0.307",
4
4
  "packageManager": "yarn@3.8.0",
5
5
  "scripts": {
6
6
  "build": "forge build",
@@ -32,7 +32,7 @@
32
32
  "@layerzerolabs/oapp-evm": "^0.3.2",
33
33
  "@openzeppelin/merkle-tree": "^1.0.8",
34
34
  "@prb/test": "^0.6.4",
35
- "@towns-protocol/prettier-config": "^0.0.306",
35
+ "@towns-protocol/prettier-config": "^0.0.307",
36
36
  "@wagmi/cli": "^2.2.0",
37
37
  "account-abstraction": "https://github.com/eth-infinitism/account-abstraction/archive/refs/tags/v0.7.0.tar.gz",
38
38
  "forge-std": "github:foundry-rs/forge-std#v1.10.0",
@@ -53,5 +53,5 @@
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "439633cf1571af6312b1cda88b578853be38afc4"
56
+ "gitHead": "43c43f1806bf74ad2836210d93b7e007d8a607ce"
57
57
  }
@@ -11,7 +11,6 @@ import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.s
11
11
  import {Deployer} from "scripts/common/Deployer.s.sol";
12
12
  import {Towns} from "src/tokens/towns/base/Towns.sol";
13
13
  import {TownsDeployer} from "src/tokens/towns/base/TownsDeployer.sol";
14
- import {TownsDeployer} from "src/tokens/towns/base/TownsDeployer.sol";
15
14
  import {MockTowns} from "test/mocks/MockTowns.sol";
16
15
  import {MockTownsDeployer} from "test/mocks/MockTownsDeployer.sol";
17
16
 
@@ -24,21 +23,23 @@ contract DeployTownsBase is Deployer {
24
23
  return "utils/towns";
25
24
  }
26
25
 
27
- function __deploy(address deployer) internal override returns (address) {
26
+ function __deploy(address deployer) internal override returns (address proxy) {
28
27
  (implSalt, proxySalt) = _getSalts();
29
28
 
30
29
  address vault = _getVault(deployer);
31
- address proxy = _proxyAddress(_implAddress(implSalt), proxySalt, l1Token, vault);
32
-
33
- vm.startBroadcast(deployer);
34
- if (isAnvil()) {
35
- new MockTownsDeployer(l1Token, vault, implSalt, proxySalt);
30
+ proxy = _proxyAddress(_implAddress(implSalt), proxySalt, l1Token, vault);
31
+
32
+ if (!isTesting()) {
33
+ vm.broadcast(deployer);
34
+ if (isAnvil()) {
35
+ new MockTownsDeployer(l1Token, vault, implSalt, proxySalt);
36
+ } else {
37
+ new TownsDeployer(l1Token, vault, implSalt, proxySalt);
38
+ }
36
39
  } else {
37
- new TownsDeployer(l1Token, vault, implSalt, proxySalt);
40
+ vm.prank(deployer);
41
+ new MockTownsDeployer(l1Token, vault, implSalt, proxySalt);
38
42
  }
39
- vm.stopBroadcast();
40
-
41
- return proxy;
42
43
  }
43
44
 
44
45
  function _implAddress(bytes32 salt) internal view returns (address impl) {
@@ -55,12 +56,9 @@ contract DeployTownsBase is Deployer {
55
56
  address remoteToken,
56
57
  address owner
57
58
  ) internal pure returns (address proxy) {
58
- bytes memory byteCode = abi.encodePacked(
59
+ bytes memory byteCode = bytes.concat(
59
60
  type(ERC1967Proxy).creationCode,
60
- abi.encode(
61
- impl,
62
- abi.encodePacked(Towns.initialize.selector, abi.encode(remoteToken, owner))
63
- )
61
+ abi.encode(impl, abi.encodeCall(Towns.initialize, (remoteToken, owner)))
64
62
  );
65
63
 
66
64
  proxy = Create2Utils.computeCreate2Address(salt, byteCode);
@@ -22,7 +22,6 @@ contract InteractBaseAlpha is AlphaHelper {
22
22
  DeployRiverAirdrop deployRiverAirdrop = new DeployRiverAirdrop();
23
23
 
24
24
  function __interact(address deployer) internal override {
25
- vm.setEnv("OVERRIDE_DEPLOYMENTS", "1");
26
25
  address space = getDeployment("space");
27
26
  address spaceOwner = getDeployment("spaceOwner");
28
27
  address spaceFactory = getDeployment("spaceFactory");
@@ -8,7 +8,7 @@ import {Create2Utils} from "../../../utils/libraries/Create2Utils.sol";
8
8
 
9
9
  // contracts
10
10
  import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
11
- import {Towns} from "src/tokens/towns/base/Towns.sol";
11
+ import {Towns} from "./Towns.sol";
12
12
 
13
13
  contract TownsDeployer {
14
14
  constructor(address l1Token, address owner, bytes32 implementationSalt, bytes32 proxySalt) {
@@ -18,12 +18,9 @@ contract TownsDeployer {
18
18
  );
19
19
 
20
20
  // Create proxy initialization bytecode
21
- bytes memory proxyBytecode = abi.encodePacked(
21
+ bytes memory proxyBytecode = bytes.concat(
22
22
  type(ERC1967Proxy).creationCode,
23
- abi.encode(
24
- implementation,
25
- abi.encodePacked(Towns.initialize.selector, abi.encode(l1Token, owner))
26
- )
23
+ abi.encode(implementation, abi.encodeCall(Towns.initialize, (l1Token, owner)))
27
24
  );
28
25
 
29
26
  // Deploy proxy using create2