Skip to content

Commit

Permalink
feat: clean up / prepare for public repo (#4)
Browse files Browse the repository at this point in the history
* feat: remove create2 and update readme.md

* feat: updated readme with testnet deployment
  • Loading branch information
ChefMist authored Oct 23, 2024
1 parent fe0da95 commit e7f6e7f
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 290 deletions.
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Pancake-create2-factory
# Pancake-create3-factory

create2-factory to be used by PCS for v4 or future deployments for deterministic address
create3-factory to be used by PCS for v4 or future deployments for deterministic address

## Context

create1 was rejected as
- its under an EOA (tied to 1 person)

create2 was rejected as
- some of v4 contracts takes `WETH` as constructor args
- `WETH` address can differs across chains
- this would result in different address across chains

create3 was selected as
- deterministic address based on just `salt`
- a tweak on the proxy `CustomisedProxyChild.sol` allows us to run some methods (`transferOwnership`)

## Deployment

Expand All @@ -16,6 +30,11 @@ export PRIVATE_KEY=0x
export ETHERSCAN_API_KEY=xx
```

### Create3Factory verification on explorer
In case contract verification fail when running deployment script, run

`forge verify-contract <address> Create3Factory --watch --chain <chain_id>`

## Address

Below list the chains this contract has been deployed on:
Expand All @@ -24,8 +43,8 @@ Below list the chains this contract has been deployed on:

| Chain | Address |
| ------------- | ------------- |
| BSC | 0x.. |
| Sepolia | 0x.. |
| BSC | 0xCC4cBFD415C6cBC67a94E3e231CEA82D145D08df |
| Sepolia | 0xCC4cBFD415C6cBC67a94E3e231CEA82D145D08df |

### Mainnet

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
pragma solidity ^0.8.24;

import "forge-std/src/Script.sol";
import {Create2Factory} from "../src/Create2Factory.sol";
import {Create3Factory} from "../src/Create3Factory.sol";

/**
* forge script script/01_DeployCreate2Factory.s.sol:DeployCreate2FactoryScript -vvv \
* forge script script/01_DeployCreate3Factory.s.sol:DeployCreate3FactoryScript -vvv \
* --rpc-url $RPC_URL \
* --broadcast \
* --slow \
* --verify
*/
contract DeployCreate2FactoryScript is Script {
contract DeployCreate3FactoryScript is Script {
function run() public {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);
Expand All @@ -20,8 +20,8 @@ contract DeployCreate2FactoryScript is Script {
uint64 nonce = vm.getNonce(vm.addr(deployerPrivateKey));
vm.assertEq(nonce, 0, "Must create contract with nonce 0");

Create2Factory create2Factory = new Create2Factory();
console.log("Create2Factory contract deployed at ", address(create2Factory));
Create3Factory create3Factory = new Create3Factory();
console.log("Create3Factory contract deployed at ", address(create3Factory));

vm.stopBroadcast();
}
Expand Down
54 changes: 0 additions & 54 deletions src/Create2Factory.sol

This file was deleted.

18 changes: 0 additions & 18 deletions src/interfaces/ICreate2Factory.sol

This file was deleted.

148 changes: 0 additions & 148 deletions test/Create2Factory.t.sol

This file was deleted.

61 changes: 0 additions & 61 deletions test/Create2FactoryFork.t.sol

This file was deleted.

0 comments on commit e7f6e7f

Please sign in to comment.