Skip to content

Commit

Permalink
update contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
ZaK3939 committed Oct 14, 2024
1 parent 6daecb2 commit 00a9d6d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions script/UpgradeFactory.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract UpgradeFactory is BaseScript {
// address mostRecentlyDeployedProxy = DevOpsTools.get_most_recent_deployment("PhiFactory", block.chainid);
vm.startBroadcast();
PhiFactory newFactory = new PhiFactory();
address currentPhiFactoryProxy = address(0x3DcB7B219fB5AeCF01C9bBC54984f4106B84e5b8);
address currentPhiFactoryProxy = address(0x6a752405Abd3F7Ec88001F141E0A0FcFbb068502);
address proxy = upgradeFactory(currentPhiFactoryProxy, address(newFactory));
console2.log("Upgraded PhiFactory to address: %s", proxy);
vm.stopBroadcast();
Expand All @@ -27,7 +27,7 @@ contract UpgradeFactory is BaseScript {

function upgradeFactory(address oldfactoryProxyAddress, address newFactory) public returns (address) {
PhiFactory factoryProxy = PhiFactory(payable(oldfactoryProxyAddress));
// factoryProxy.upgradeToAndCall(address(newFactory), abi.encodeWithSelector(PhiFactory.initializeV2.selector));
factoryProxy.upgradeToAndCall(address(newFactory), abi.encodeWithSelector(PhiFactory.initializeV2.selector));
return address(factoryProxy);
}
}
30 changes: 17 additions & 13 deletions src/PhiFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@ contract PhiFactory is Initializable, UUPSUpgradeable, Ownable2StepUpgradeable,
_disableInitializers();
}

function initializeV2() external reinitializer(2) {
// V2 specific initializations
}

function version() public pure returns (uint256) {
return 1;
return 2;
}

function contractURI(address nftAddress) public view returns (string memory) {
Expand All @@ -75,16 +79,19 @@ contract PhiFactory is Initializable, UUPSUpgradeable, Ownable2StepUpgradeable,
abi.encodePacked(
"{",
'"name":"',
"PHI NFT",
"Phi",
'",',
'"description":"',
_buildDescription(art),
'",',
'"image":"',
"https://gateway.irys.xyz/H2OgtiAtsJRB8svr4d-kV2BtAE4BTI_q0wtAn5aKjcU",
"https://arweave.net/_oxKSZMtvAuGrRiNxVRYzpkzUSPsGQ7RJilQ7MYnZ70",
'",',
'"banner_image":"',
"https://arweave.net/qHojDzf6FvtjI7OV8eyjm1oXzm17klsrSJpUzbV5pNA",
'",',
'"featured_image":"',
"https://www.arweave.net/47AloaAgG7UFYuZjieYi4b2QOD1TG2pFYAbsshULtEY?ext=png",
"https://arweave.net/O1rPnGN7U3MDjYUHjzthEIyp0INLNYuY5RQRCZpELtc",
'",',
'"external_link":"https://phi.box/",',
'"collaborators":["',
Expand Down Expand Up @@ -847,19 +854,16 @@ contract PhiFactory is Initializable, UUPSUpgradeable, Ownable2StepUpgradeable,
function _buildDescription(PhiArt memory art) internal pure returns (string memory) {
return string(
abi.encodePacked(
"Phi Cred NFT for credId ",
"Phi Protocol is an open credential layer for onchain identity. ",
"Phi NFT collections represent your onchain achievement. ",
"Details about this collection: cred-id: ",
uint256(art.credId).toString(),
" on chain ",
", chain-id: ",
uint256(art.credChainId).toString(),
". ",
"This NFT represents a unique on-chain-action created by ",
", created by: ",
art.credCreator.toHexString(),
". ",
"The cred is verified using ",
art.verificationType,
". ",
"Holders of this NFT have proven their eligibility for the cred. ",
"Join the Phi community to collect and showcase your on-chain achievements."
"Explore https://phi.box/ to learn more."
)
);
}
Expand Down

0 comments on commit 00a9d6d

Please sign in to comment.