Skip to content

Commit

Permalink
chore: Refactored to simpler setup
Browse files Browse the repository at this point in the history
  • Loading branch information
stevedylandev committed Dec 22, 2024
1 parent 13f5e51 commit ffbda7c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions script/IPCM.s.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;
pragma solidity ^0.8.23;

import {Script, console} from "forge-std/Script.sol";
import {IPCM} from "../src/IPCM.sol";
Expand All @@ -12,7 +12,7 @@ contract IPCMScript is Script {
function run() public {
vm.startBroadcast();

ipcm = new IPCM(msg.sender, "ipfs://");
ipcm = new IPCM(msg.sender);

vm.stopBroadcast();
}
Expand Down
6 changes: 2 additions & 4 deletions src/IPCM.sol
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.22;
pragma solidity ^0.8.23;

import {Ownable} from "../lib/openzeppelin-contracts/contracts/access/Ownable.sol";

contract IPCM is Ownable {
string private cidMapping;

constructor(address owner, string memory initialCID) Ownable(owner) {
cidMapping = initialCID;
}
constructor(address owner) Ownable(owner) {}

event MappingUpdated(string value);

Expand Down
5 changes: 3 additions & 2 deletions test/IPCM.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;
pragma solidity ^0.8.23;

import {Test, console} from "forge-std/Test.sol";
import {IPCM} from "../src/IPCM.sol";
Expand All @@ -10,7 +10,7 @@ contract IPCMTest is Test {
string testCid = "QmTest123";

function setUp() public {
ipcm = new IPCM(owner, testCid);
ipcm = new IPCM(owner);
vm.startPrank(owner);
}

Expand All @@ -32,6 +32,7 @@ contract IPCMTest is Test {
}

function testGetValue() public {
ipcm.updateMapping(testCid);
string memory initialValue = ipcm.getMapping();
assertEq(initialValue, testCid);

Expand Down

0 comments on commit ffbda7c

Please sign in to comment.