-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from P4-Games/feature/update-deploy-scripts
removed DeployAllContracts.v2.s.sol
- Loading branch information
Showing
11 changed files
with
102 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {Script, console} from "forge-std/Script.sol"; | ||
import {ChatterPayWalletFactory} from "../src/L2/ChatterPayWalletFactory.sol"; | ||
import {DevOpsTools} from "lib/foundry-devops/src/DevOpsTools.sol"; | ||
import {ChatterPay} from "../src/L2/ChatterPay.sol"; | ||
|
||
contract UpdateChatterPay is Script { | ||
function run() external { | ||
vm.startBroadcast(); | ||
|
||
// Change this contract for the new version ChatterPay implementation contract you want to deploy | ||
ChatterPay chatterPay = new ChatterPay(); | ||
|
||
// This will get the address of the most recent deployment of the ChatterPay Factory contract | ||
// If you want to set the implementation to a different address, you can replace it here | ||
address factoryAddress = DevOpsTools.get_most_recent_deployment( | ||
"ChatterPayWalletFactory", | ||
block.chainid | ||
); | ||
|
||
ChatterPayWalletFactory factory = ChatterPayWalletFactory( | ||
factoryAddress | ||
); | ||
|
||
factory.setImplementationAddress(address(chatterPay)); | ||
|
||
console.log( | ||
"ChatterPay implementation updated to %s and updated in the factory", | ||
address(chatterPay) | ||
); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {Script, console} from "forge-std/Script.sol"; | ||
import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; | ||
import {DevOpsTools} from "lib/foundry-devops/src/DevOpsTools.sol"; | ||
import {HelperConfig} from "./utils/HelperConfig.s.sol"; | ||
import {ChatterPayNFT} from "../src/L2/ChatterPayNFT.sol"; | ||
|
||
contract DeployChatterPay is Script { | ||
HelperConfig helperConfig; | ||
|
||
function run() external { | ||
helperConfig = new HelperConfig(); | ||
HelperConfig.NetworkConfig memory config = helperConfig.getConfig(); | ||
|
||
// Set desired baseURI for NFT metadata | ||
string | ||
memory baseURI = "https://back.chatterpay.net/nft/metadata/opensea/"; | ||
// Set previously deployed NFT proxy contract address | ||
address proxy = address(0); | ||
bytes memory data = abi.encodeWithSignature( | ||
"initialize(address,string)", | ||
config.account, | ||
baseURI | ||
); | ||
|
||
vm.startBroadcast(); | ||
|
||
Upgrades.upgradeProxy( | ||
proxy, | ||
"ChatterPayNFT.v2.sol", | ||
data, | ||
config.account | ||
); | ||
|
||
console.log("NFT updated to:", address(proxy)); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters