Skip to content

Commit

Permalink
Migrate from mumbai to amoy
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffhall committed Apr 18, 2024
1 parent 0661410 commit 1ad3728
Show file tree
Hide file tree
Showing 10 changed files with 516 additions and 78 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Done or in progress are:
- ✅ Publish [NPM package](https://www.npmjs.com/package/fismo) with utilities and domain model for browser + node
- ✅ Publish documentation to [Fismo website](https://fismo.xyz)
- ✅ Fully permissive cloneable Operator for cheap deployments (~$45 vs ~$350)!!!
- ✅ Deploy to testnets (Rinkeby, Mumbai)
- ✅ Deploy to testnets (Rinkeby, Mumbai, Amoy)
- ✅ Add deployments to SDK
- ✅ Standalone demo project using SDK only
- 👉 Deploy to mainnets (Homestead, Matic)
Expand Down
3 changes: 2 additions & 1 deletion contracts/Operator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ contract Operator is FismoConstants {

/// Emitted when a user invokes an action
event ActionInvoked(
address indexed invokedBy,
bytes4 indexed machineId,
bytes4 indexed actionId,
FismoTypes.ActionResponse response
Expand Down Expand Up @@ -95,7 +96,7 @@ contract Operator is FismoConstants {
response = fismo.invokeAction(msg.sender, _machineId, _actionId);

// Notify watchers of state change
emit ActionInvoked(_machineId, _actionId, response);
emit ActionInvoked(msg.sender, _machineId, _actionId, response);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Mainly used to test the deployment script.

* ```npm run deploy:local```

### Deploy to Polygon Mumbai Testnet
### Deploy to Polygon Amoy Testnet
This runs the `scripts/deploy/deploy-and-verify-pair.js` script against Polygon testnet. It deploys Fismo and a paired Operator.

* ```npm run deploy:poly:test```
Expand Down
19 changes: 10 additions & 9 deletions environments_template.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module.exports = {

"apiKey": {
"block_explorer": "YOUR_POLYGONSCAN_API_KEY", // POLYGONSCAN
// "block_explorer": "YOUR_ETHERSCAN_API_KEY", // ETHERSCAN
"block_explorer": {
"poly-test": "YOUR_POLYGONSCAN_API_KEY",
"eth-main": "YOUR_ETHERSCAN_API_KEY"
},
"coinmarketcap": "YOUR_COINMARKETCAP_API_KEY"
},

"network": {

"hardhat": { // hardhat local network
Expand Down Expand Up @@ -36,15 +37,15 @@ module.exports = {
}
},

"poly-test": { // Polygon Mumbai testnet
"poly-test": { // Polygon Amoy testnet
"mnemonic": "your twelve word mnemonic phrase here...",
"txNode": "https://rpc-mumbai.maticvigil.com/v1/[API_KEY_HERE]",
"explorer": "https://mumbai.polygonscan.com/",
"txNode": "https://rpc-amoy.polygon.technology/[API_KEY_HERE]",
"explorer": "https://amoy.polygonscan.com/",
"gasLimit": "10000000",
"chain": {
"title": "Polygon Mumbai Testnet",
"name": "mumbai",
"chainId": 80001
"title": "Polygon Amoy Testnet",
"name": "amoy",
"chainId": 80002
}
},

Expand Down
19 changes: 16 additions & 3 deletions hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const environments = require('./environments');
require("@nomiclabs/hardhat-etherscan");
require("@nomicfoundation/hardhat-verify");
require("@nomiclabs/hardhat-waffle");
require('hardhat-contract-sizer');
require("hardhat-gas-reporter");
Expand Down Expand Up @@ -41,8 +41,21 @@ module.exports = {
}
},
etherscan: {
apiKey: environments.apiKey.block_explorer
apiKey: {
"poly-test": environments.apiKey['block_explorer']["poly-test"]
},
customChains: [
{
network: "poly-test",
chainId: 80002,
urls: {
apiURL: "https://api-amoy.polygonscan.com/api",
browserURL: "https://amoy.polygonscan.com"
}
}
]
},

solidity: {
version: "0.8.9",
settings: {
Expand All @@ -56,7 +69,7 @@ module.exports = {
alphaSort: true,
disambiguatePaths: true,
runOnCompile: false,
strict: false,
strict: false
},
gasReporter: {
currency: 'USD',
Expand Down
153 changes: 153 additions & 0 deletions logs/deploy.fismo.poly.test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,156 @@ The verification may still succeed but should be checked manually.
Reason: Already Verified


--------------------------------------------------------------------------------
💥 Deploy and verify Fismo / Operator pair
--------------------------------------------------------------------------------
⛓ Network: poly-test (amoy)
📅 Thu Apr 18 2024 11:53:38 GMT-0400 (Eastern Daylight Time)
🔱 Deployer account: 0xAc59a3da0E748b29e43FfaAEEa731E17250a4C47
--------------------------------------------------------------------------------
Nothing to compile
--------------------------------------------------------------------------------
💥 Deploy and verify Fismo / Operator pair
--------------------------------------------------------------------------------
⛓ Network: poly-test (amoy)
📅 Thu Apr 18 2024 12:02:00 GMT-0400 (Eastern Daylight Time)
🔱 Deployer account: 0xAc59a3da0E748b29e43FfaAEEa731E17250a4C47
--------------------------------------------------------------------------------
Nothing to compile
✅ Fismo deployed to: 0x607A97Aa9f523c20c0cd5B49EF8C1450F8678b67
✅ Operator deployed to: 0xc763AdBb1a274787b7404f20E9a7590F76f368AE
✋ Be sure to update scripts/domain/util/deployments.js
➡️ Set Deployments.amoy.Fismo to "0x607A97Aa9f523c20c0cd5B49EF8C1450F8678b67"
➡️ Set Deployments.amoy.Operator to "0xc763AdBb1a274787b7404f20E9a7590F76f368AE"
⏲ Pause one minute, allowing deployments to propagate to Etherscan backend...
🔍 Verifying contracts on Etherscan...

📋 Verifying Fismo
❌ Failed to verify Fismo on etherscan. Unsupported network ("poly-test", chainId: 80002).

📋 Verifying Operator
❌ Failed to verify Operator on etherscan. Unsupported network ("poly-test", chainId: 80002).



--------------------------------------------------------------------------------
💥 Deploy and verify Fismo / Operator pair
--------------------------------------------------------------------------------
⛓ Network: poly-test (amoy)
📅 Thu Apr 18 2024 12:09:02 GMT-0400 (Eastern Daylight Time)
🔱 Deployer account: 0xAc59a3da0E748b29e43FfaAEEa731E17250a4C47
--------------------------------------------------------------------------------
Nothing to compile
✅ Fismo deployed to: 0xa5947FED4e0D88bAF12559e55D4903d59CC7dDD1
✅ Operator deployed to: 0x048495eFA896ecbec56060C99C2dbF43B649352A
✋ Be sure to update scripts/domain/util/deployments.js
➡️ Set Deployments.amoy.Fismo to "0xa5947FED4e0D88bAF12559e55D4903d59CC7dDD1"
➡️ Set Deployments.amoy.Operator to "0x048495eFA896ecbec56060C99C2dbF43B649352A"
⏲ Pause one minute, allowing deployments to propagate to Etherscan backend...
🔍 Verifying contracts on Etherscan...

📋 Verifying Fismo
❌ Failed to verify Fismo on etherscan. Trying to verify a contract in a network with chain id 80002, but the plugin doesn't recognize it as a supported chain.

You can manually add support for it by following these instructions: https://hardhat.org/verify-custom-networks

To see the list of supported networks, run this command:

npx hardhat verify --list-networks

📋 Verifying Operator
❌ Failed to verify Operator on etherscan. Trying to verify a contract in a network with chain id 80002, but the plugin doesn't recognize it as a supported chain.

You can manually add support for it by following these instructions: https://hardhat.org/verify-custom-networks

To see the list of supported networks, run this command:

npx hardhat verify --list-networks


--------------------------------------------------------------------------------
💥 Deploy and verify Fismo / Operator pair
--------------------------------------------------------------------------------
⛓ Network: poly-test (amoy)
📅 Thu Apr 18 2024 12:21:25 GMT-0400 (Eastern Daylight Time)
🔱 Deployer account: 0xAc59a3da0E748b29e43FfaAEEa731E17250a4C47
--------------------------------------------------------------------------------
Nothing to compile
--------------------------------------------------------------------------------
💥 Deploy and verify Fismo / Operator pair
--------------------------------------------------------------------------------
⛓ Network: poly-test (amoy)
📅 Thu Apr 18 2024 12:22:38 GMT-0400 (Eastern Daylight Time)
🔱 Deployer account: 0xAc59a3da0E748b29e43FfaAEEa731E17250a4C47
--------------------------------------------------------------------------------
Nothing to compile
✅ Fismo deployed to: 0x677524aaD90FfE895688521A3870781bf297beB7
✅ Operator deployed to: 0x8D67A676A5Ace2C9FFa0758A454d771F2af57bb3
✋ Be sure to update scripts/domain/util/deployments.js
➡️ Set Deployments.amoy.Fismo to "0x677524aaD90FfE895688521A3870781bf297beB7"
➡️ Set Deployments.amoy.Operator to "0x8D67A676A5Ace2C9FFa0758A454d771F2af57bb3"
⏲ Pause one minute, allowing deployments to propagate to Etherscan backend...
🔍 Verifying contracts on Etherscan...

📋 Verifying Fismo
❌ Failed to verify Fismo on etherscan. Trying to verify a contract in a network with chain id 80002, but the plugin doesn't recognize it as a supported chain.

You can manually add support for it by following these instructions: https://hardhat.org/verify-custom-networks

To see the list of supported networks, run this command:

npx hardhat verify --list-networks

📋 Verifying Operator
❌ Failed to verify Operator on etherscan. Trying to verify a contract in a network with chain id 80002, but the plugin doesn't recognize it as a supported chain.

You can manually add support for it by following these instructions: https://hardhat.org/verify-custom-networks

To see the list of supported networks, run this command:

npx hardhat verify --list-networks


--------------------------------------------------------------------------------
💥 Deploy and verify Fismo / Operator pair
--------------------------------------------------------------------------------
⛓ Network: poly-test (amoy)
📅 Thu Apr 18 2024 12:32:35 GMT-0400 (Eastern Daylight Time)
🔱 Deployer account: 0xAc59a3da0E748b29e43FfaAEEa731E17250a4C47
--------------------------------------------------------------------------------
Nothing to compile
--------------------------------------------------------------------------------
💥 Deploy and verify Fismo / Operator pair
--------------------------------------------------------------------------------
⛓ Network: poly-test (amoy)
📅 Thu Apr 18 2024 12:40:45 GMT-0400 (Eastern Daylight Time)
🔱 Deployer account: 0xAc59a3da0E748b29e43FfaAEEa731E17250a4C47
--------------------------------------------------------------------------------
Nothing to compile
✅ Fismo deployed to: 0x677524aaD90FfE895688521A3870781bf297beB7
✅ Operator deployed to: 0x8D67A676A5Ace2C9FFa0758A454d771F2af57bb3
✋ Be sure to update scripts/domain/util/deployments.js
➡️ Set Deployments.amoy.Fismo to "0x677524aaD90FfE895688521A3870781bf297beB7"
➡️ Set Deployments.amoy.Operator to "0x8D67A676A5Ace2C9FFa0758A454d771F2af57bb3"
⏲ Pause one minute, allowing deployments to propagate to Etherscan backend...
🔍 Verifying contracts on Etherscan...

📋 Verifying Fismo
Successfully submitted source code for contract
contracts/Fismo.sol:Fismo at 0x677524aaD90FfE895688521A3870781bf297beB7
for verification on the block explorer. Waiting for verification result...

Successfully verified contract Fismo on the block explorer.
https://amoy.polygonscan.com/address/0x677524aaD90FfE895688521A3870781bf297beB7#code


📋 Verifying Operator
Successfully submitted source code for contract
contracts/Operator.sol:Operator at 0x8D67A676A5Ace2C9FFa0758A454d771F2af57bb3
for verification on the block explorer. Waiting for verification result...

Successfully verified contract Operator on the block explorer.
https://amoy.polygonscan.com/address/0x8D67A676A5Ace2C9FFa0758A454d771F2af57bb3#code



Loading

0 comments on commit 1ad3728

Please sign in to comment.