Skip to content

Commit

Permalink
chore: revert deployment with constructor args
Browse files Browse the repository at this point in the history
  • Loading branch information
mehtaculous committed Dec 5, 2023
1 parent 75eb8c1 commit 0c81cf4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
5 changes: 1 addition & 4 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ contract Deploy is Script {
STORAGE
//////////////////////////////////////////////////////////////////////////*/

address internal contentStore;
bytes internal creationCode;
bytes internal constructorArgs;
bytes32 internal salt;
Expand All @@ -23,8 +22,6 @@ contract Deploy is Script {
function setUp() public virtual {
salt = keccak256(abi.encode("ONCHFS"));
creationCode = type(FileSystem).creationCode;
contentStore = (block.chainid == 1) ? MAINNET_CONTENT_STORE : GOERLI_CONTENT_STORE;
constructorArgs = abi.encode(contentStore);
}

/*//////////////////////////////////////////////////////////////////////////
Expand All @@ -33,7 +30,7 @@ contract Deploy is Script {

function run() public virtual {
vm.startBroadcast();
_deployCreate2(creationCode, constructorArgs, salt);
_deployCreate2(creationCode, salt);
vm.stopBroadcast();
}

Expand Down
4 changes: 0 additions & 4 deletions script/utils/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ uint256 constant GOERLI = 5;
uint256 constant HOLESKY = 17000;
uint256 constant SEPOLIA = 11155111;

// Content Store
address constant GOERLI_CONTENT_STORE = 0x7c1730B7bE9424D0b983B84aEb254e3a2a105d91;
address constant MAINNET_CONTENT_STORE = 0xC6806fd75745bB5F5B32ADa19963898155f9DB91;

// File Store
address constant GOERLI_FILE_STORE = 0x5E348d0975A920E9611F8140f84458998A53af94;
address constant MAINNET_FILE_STORE = 0x9746fD0A77829E12F8A9DBe70D7a322412325B91;
4 changes: 2 additions & 2 deletions src/FileSystem.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ contract FileSystem is IFileSystem {
/**
* @dev Initializes the ContentStore contract
*/
constructor(address _contentStore) {
contentStore = _contentStore;
constructor() {
contentStore = (block.chainid == 1) ? MAINNET_CONTENT_STORE : GOERLI_CONTENT_STORE;
}

/*//////////////////////////////////////////////////////////////////////////
Expand Down
6 changes: 3 additions & 3 deletions src/interfaces/IFileSystem.sol
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ interface IFileSystem {
) external returns (bytes32 fileChecksum);

/**
* @notice Gets inode within list of path segments
* @param _inodeChecksum Checksum value of inode
* @param _pathSegments List of path segments
* @notice Traverses a directory and returns an inode
* @param _inodeChecksum Checksum value of the inode
* @param _pathSegments List of path segments being traversed
*/
function getInodeAt(
bytes32 _inodeChecksum,
Expand Down
5 changes: 5 additions & 0 deletions src/utils/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ pragma solidity 0.8.23;
CONSTANTS
//////////////////////////////////////////////////////////////////////////*/

// Content Store
address constant GOERLI_CONTENT_STORE = 0x7c1730B7bE9424D0b983B84aEb254e3a2a105d91;
address constant MAINNET_CONTENT_STORE = 0xC6806fd75745bB5F5B32ADa19963898155f9DB91;

// ASCII Characters
bytes constant FORBIDDEN_CHARS = ":/?#[]@!$&'()*+,;=";
2 changes: 1 addition & 1 deletion test/FileSystem/FileSystemTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ contract FileSystemTest is Test {
function setUp() public virtual {
contentStore = GOERLI_CONTENT_STORE;
vm.etch(contentStore, CONTENT_STORE_BYTE_CODE);
fileSystem = new FileSystem(contentStore);
fileSystem = new FileSystem();
metadata = "file metadata";
fileContent = bytes("asdf");
(checksum, ) = IContentStore(contentStore).addContent(fileContent);
Expand Down

0 comments on commit 0c81cf4

Please sign in to comment.