Skip to content

Commit 03b2d4c

Browse files
committed
deploy: Amoy after ETH-793
1 parent 7f3354b commit 03b2d4c

File tree

4 files changed

+270
-13
lines changed

4 files changed

+270
-13
lines changed

packages/network-contracts/.openzeppelin/unknown-80002.json

Lines changed: 245 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,39 +2529,31 @@
25292529
"slot": "301",
25302530
"type": "t_mapping(t_string_memory_ptr,t_mapping(t_bytes32,t_struct(Permission)20835_storage))",
25312531
"contract": "StreamRegistryV5_1",
2532-
"src": "contracts/StreamRegistry/StreamRegistryV5_1.sol:60"
2532+
"src": "contracts/StreamRegistry/StreamRegistryV5_1.sol:48"
25332533
},
25342534
{
25352535
"label": "streamIdToMetadata",
25362536
"offset": 0,
25372537
"slot": "302",
25382538
"type": "t_mapping(t_string_memory_ptr,t_string_storage)",
25392539
"contract": "StreamRegistryV5_1",
2540-
"src": "contracts/StreamRegistry/StreamRegistryV5_1.sol:61"
2540+
"src": "contracts/StreamRegistry/StreamRegistryV5_1.sol:49"
25412541
},
25422542
{
25432543
"label": "ensCache",
25442544
"offset": 0,
25452545
"slot": "303",
25462546
"type": "t_contract(ENSCache)24364",
25472547
"contract": "StreamRegistryV5_1",
2548-
"src": "contracts/StreamRegistry/StreamRegistryV5_1.sol:62"
2548+
"src": "contracts/StreamRegistry/StreamRegistryV5_1.sol:50"
25492549
},
25502550
{
25512551
"label": "streamIdToVersion",
25522552
"offset": 0,
25532553
"slot": "304",
25542554
"type": "t_mapping(t_string_memory_ptr,t_uint32)",
25552555
"contract": "StreamRegistryV5_1",
2556-
"src": "contracts/StreamRegistry/StreamRegistryV5_1.sol:65"
2557-
},
2558-
{
2559-
"label": "streamIdToPublicPermissionUserKey",
2560-
"offset": 0,
2561-
"slot": "305",
2562-
"type": "t_mapping(t_string_memory_ptr,t_bytes32)",
2563-
"contract": "StreamRegistryV5_1",
2564-
"src": "contracts/StreamRegistry/StreamRegistryV5_1.sol:68"
2556+
"src": "contracts/StreamRegistry/StreamRegistryV5_1.sol:53"
25652557
}
25662558
],
25672559
"types": {
@@ -2689,6 +2681,247 @@
26892681
}
26902682
}
26912683
}
2684+
},
2685+
"ab73bf38ac788178f15970227a96e5f4a7e5bd31198a9f882c328a984b8dc8da": {
2686+
"address": "0xD2D07b9F64202b0AB999700398cE1486f6F99BF7",
2687+
"txHash": "0x084203cecb3a63c459d8ae8734950748c242d5fe40e53536cf4f6203f86c8d2c",
2688+
"layout": {
2689+
"solcVersion": "0.8.9",
2690+
"storage": [
2691+
{
2692+
"label": "_initialized",
2693+
"offset": 0,
2694+
"slot": "0",
2695+
"type": "t_bool",
2696+
"contract": "Initializable",
2697+
"src": "@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol:39"
2698+
},
2699+
{
2700+
"label": "_initializing",
2701+
"offset": 1,
2702+
"slot": "0",
2703+
"type": "t_bool",
2704+
"contract": "Initializable",
2705+
"src": "@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/Initializable.sol:44"
2706+
},
2707+
{
2708+
"label": "__gap",
2709+
"offset": 0,
2710+
"slot": "1",
2711+
"type": "t_array(t_uint256)50_storage",
2712+
"contract": "ERC1967UpgradeUpgradeable",
2713+
"src": "@openzeppelin/contracts-upgradeable-4.4.2/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:215"
2714+
},
2715+
{
2716+
"label": "__gap",
2717+
"offset": 0,
2718+
"slot": "51",
2719+
"type": "t_array(t_uint256)50_storage",
2720+
"contract": "UUPSUpgradeable",
2721+
"src": "@openzeppelin/contracts-upgradeable-4.4.2/proxy/utils/UUPSUpgradeable.sol:81"
2722+
},
2723+
{
2724+
"label": "__gap",
2725+
"offset": 0,
2726+
"slot": "101",
2727+
"type": "t_array(t_uint256)50_storage",
2728+
"contract": "ContextUpgradeable",
2729+
"src": "@openzeppelin/contracts-upgradeable-4.4.2/utils/ContextUpgradeable.sol:31"
2730+
},
2731+
{
2732+
"label": "_trustedForwarder",
2733+
"offset": 0,
2734+
"slot": "151",
2735+
"type": "t_address",
2736+
"contract": "ERC2771ContextUpgradeable",
2737+
"src": "contracts/StreamRegistry/ERC2771ContextUpgradeable.sol:15"
2738+
},
2739+
{
2740+
"label": "__gap",
2741+
"offset": 0,
2742+
"slot": "152",
2743+
"type": "t_array(t_uint256)49_storage",
2744+
"contract": "ERC2771ContextUpgradeable",
2745+
"src": "contracts/StreamRegistry/ERC2771ContextUpgradeable.sol:51"
2746+
},
2747+
{
2748+
"label": "__gap",
2749+
"offset": 0,
2750+
"slot": "201",
2751+
"type": "t_array(t_uint256)50_storage",
2752+
"contract": "ERC165Upgradeable",
2753+
"src": "@openzeppelin/contracts-upgradeable-4.4.2/utils/introspection/ERC165Upgradeable.sol:36"
2754+
},
2755+
{
2756+
"label": "_roles",
2757+
"offset": 0,
2758+
"slot": "251",
2759+
"type": "t_mapping(t_bytes32,t_struct(RoleData)2219_storage)",
2760+
"contract": "AccessControlUpgradeable",
2761+
"src": "@openzeppelin/contracts-upgradeable-4.4.2/access/AccessControlUpgradeable.sol:64"
2762+
},
2763+
{
2764+
"label": "__gap",
2765+
"offset": 0,
2766+
"slot": "252",
2767+
"type": "t_array(t_uint256)49_storage",
2768+
"contract": "AccessControlUpgradeable",
2769+
"src": "@openzeppelin/contracts-upgradeable-4.4.2/access/AccessControlUpgradeable.sol:232"
2770+
},
2771+
{
2772+
"label": "streamIdToPermissions",
2773+
"offset": 0,
2774+
"slot": "301",
2775+
"type": "t_mapping(t_string_memory_ptr,t_mapping(t_bytes32,t_struct(Permission)4121_storage))",
2776+
"contract": "StreamRegistryV5",
2777+
"src": "contracts/StreamRegistry/StreamRegistryV5.sol:61"
2778+
},
2779+
{
2780+
"label": "streamIdToMetadata",
2781+
"offset": 0,
2782+
"slot": "302",
2783+
"type": "t_mapping(t_string_memory_ptr,t_string_storage)",
2784+
"contract": "StreamRegistryV5",
2785+
"src": "contracts/StreamRegistry/StreamRegistryV5.sol:62"
2786+
},
2787+
{
2788+
"label": "ensCache",
2789+
"offset": 0,
2790+
"slot": "303",
2791+
"type": "t_contract(ENSCache)6869",
2792+
"contract": "StreamRegistryV5",
2793+
"src": "contracts/StreamRegistry/StreamRegistryV5.sol:63"
2794+
},
2795+
{
2796+
"label": "streamIdToVersion",
2797+
"offset": 0,
2798+
"slot": "304",
2799+
"type": "t_mapping(t_string_memory_ptr,t_uint32)",
2800+
"contract": "StreamRegistryV5",
2801+
"src": "contracts/StreamRegistry/StreamRegistryV5.sol:66"
2802+
}
2803+
],
2804+
"types": {
2805+
"t_address": {
2806+
"label": "address",
2807+
"numberOfBytes": "20"
2808+
},
2809+
"t_array(t_uint256)49_storage": {
2810+
"label": "uint256[49]",
2811+
"numberOfBytes": "1568"
2812+
},
2813+
"t_array(t_uint256)50_storage": {
2814+
"label": "uint256[50]",
2815+
"numberOfBytes": "1600"
2816+
},
2817+
"t_bool": {
2818+
"label": "bool",
2819+
"numberOfBytes": "1"
2820+
},
2821+
"t_bytes32": {
2822+
"label": "bytes32",
2823+
"numberOfBytes": "32"
2824+
},
2825+
"t_contract(ENSCache)6869": {
2826+
"label": "contract ENSCache",
2827+
"numberOfBytes": "20"
2828+
},
2829+
"t_mapping(t_address,t_bool)": {
2830+
"label": "mapping(address => bool)",
2831+
"numberOfBytes": "32"
2832+
},
2833+
"t_mapping(t_bytes32,t_struct(Permission)4121_storage)": {
2834+
"label": "mapping(bytes32 => struct StreamRegistryV5.Permission)",
2835+
"numberOfBytes": "32"
2836+
},
2837+
"t_mapping(t_bytes32,t_struct(RoleData)2219_storage)": {
2838+
"label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)",
2839+
"numberOfBytes": "32"
2840+
},
2841+
"t_mapping(t_string_memory_ptr,t_mapping(t_bytes32,t_struct(Permission)4121_storage))": {
2842+
"label": "mapping(string => mapping(bytes32 => struct StreamRegistryV5.Permission))",
2843+
"numberOfBytes": "32"
2844+
},
2845+
"t_mapping(t_string_memory_ptr,t_string_storage)": {
2846+
"label": "mapping(string => string)",
2847+
"numberOfBytes": "32"
2848+
},
2849+
"t_mapping(t_string_memory_ptr,t_uint32)": {
2850+
"label": "mapping(string => uint32)",
2851+
"numberOfBytes": "32"
2852+
},
2853+
"t_string_memory_ptr": {
2854+
"label": "string",
2855+
"numberOfBytes": "32"
2856+
},
2857+
"t_string_storage": {
2858+
"label": "string",
2859+
"numberOfBytes": "32"
2860+
},
2861+
"t_struct(Permission)4121_storage": {
2862+
"label": "struct StreamRegistryV5.Permission",
2863+
"members": [
2864+
{
2865+
"label": "canEdit",
2866+
"type": "t_bool",
2867+
"offset": 0,
2868+
"slot": "0"
2869+
},
2870+
{
2871+
"label": "canDelete",
2872+
"type": "t_bool",
2873+
"offset": 1,
2874+
"slot": "0"
2875+
},
2876+
{
2877+
"label": "publishExpiration",
2878+
"type": "t_uint256",
2879+
"offset": 0,
2880+
"slot": "1"
2881+
},
2882+
{
2883+
"label": "subscribeExpiration",
2884+
"type": "t_uint256",
2885+
"offset": 0,
2886+
"slot": "2"
2887+
},
2888+
{
2889+
"label": "canGrant",
2890+
"type": "t_bool",
2891+
"offset": 0,
2892+
"slot": "3"
2893+
}
2894+
],
2895+
"numberOfBytes": "128"
2896+
},
2897+
"t_struct(RoleData)2219_storage": {
2898+
"label": "struct AccessControlUpgradeable.RoleData",
2899+
"members": [
2900+
{
2901+
"label": "members",
2902+
"type": "t_mapping(t_address,t_bool)",
2903+
"offset": 0,
2904+
"slot": "0"
2905+
},
2906+
{
2907+
"label": "adminRole",
2908+
"type": "t_bytes32",
2909+
"offset": 0,
2910+
"slot": "1"
2911+
}
2912+
],
2913+
"numberOfBytes": "64"
2914+
},
2915+
"t_uint256": {
2916+
"label": "uint256",
2917+
"numberOfBytes": "32"
2918+
},
2919+
"t_uint32": {
2920+
"label": "uint32",
2921+
"numberOfBytes": "4"
2922+
}
2923+
}
2924+
}
26922925
}
26932926
}
26942927
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
set -euxo pipefail
3+
4+
# export CHAIN=dev2
5+
export CHAIN=polygonAmoy
6+
7+
read -p "Enter deployer private key: " KEY
8+
export KEY="$KEY"
9+
10+
export CONTRACT_NAME=StreamRegistryV5
11+
export OUTPUT_FILE=newImplementationAddress.txt
12+
export SCRIPT_FILE=scripts/upgradeStreamRegistry.ts
13+
npm run hardhatScript
14+
15+
read -p "Enter Polygonscan API key: " ETHERSCAN_KEY
16+
export ETHERSCAN_KEY="$ETHERSCAN_KEY"
17+
18+
export ADDRESS=$(cat newImplementationAddress.txt)
19+
npm run verify
20+
21+
rm newImplementationAddress.txt

packages/network-contracts/scripts/upgradeStreamRegistry.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,15 @@ async function main() {
8080
log("Checking new StreamRegistry at %s", upgradedStreamRegistry.address)
8181
log(" %s [OK]", await upgradedStreamRegistry.getUserKeyForUserId("test.eth/1", "0x1234"))
8282

83+
const implementationAddress = await upgrades.erc1967.getImplementationAddress(streamRegistry.address)
84+
log("Implementation address: %s", implementationAddress)
85+
8386
const balanceAfter = await provider.getBalance(signer.address)
8487
const gasSpent = balanceBefore.sub(balanceAfter)
8588
log("Spent %s ETH for gas", formatEther(gasSpent))
8689

8790
if (OUTPUT_FILE) {
88-
writeFileSync(OUTPUT_FILE, upgradedStreamRegistry.address)
91+
writeFileSync(OUTPUT_FILE, implementationAddress)
8992
}
9093
}
9194

0 commit comments

Comments
 (0)