Skip to content

Commit aa249cc

Browse files
committed
upgrade cosmetic contract for new equip position
1 parent 551042f commit aa249cc

2 files changed

Lines changed: 226 additions & 14 deletions

File tree

.openzeppelin/sonic.json

Lines changed: 217 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148348,31 +148348,31 @@
148348148348
"label": "_itemNFT",
148349148349
"offset": 0,
148350148350
"slot": "0",
148351-
"type": "t_contract(IItemNFT)56681",
148351+
"type": "t_contract(IItemNFT)77799",
148352148352
"contract": "Cosmetics",
148353148353
"src": "contracts\\Cosmetics.sol:24"
148354148354
},
148355148355
{
148356148356
"label": "_playerNFT",
148357148357
"offset": 0,
148358148358
"slot": "1",
148359-
"type": "t_contract(IPlayerNFT)56807",
148359+
"type": "t_contract(IPlayerNFT)77932",
148360148360
"contract": "Cosmetics",
148361148361
"src": "contracts\\Cosmetics.sol:25"
148362148362
},
148363148363
{
148364148364
"label": "_cosmetics",
148365148365
"offset": 0,
148366148366
"slot": "2",
148367-
"type": "t_mapping(t_uint16,t_struct(CosmeticInfo)55695_storage)",
148367+
"type": "t_mapping(t_uint16,t_struct(CosmeticInfo)76744_storage)",
148368148368
"contract": "Cosmetics",
148369148369
"src": "contracts\\Cosmetics.sol:26"
148370148370
},
148371148371
{
148372148372
"label": "_equippedCosmetics",
148373148373
"offset": 0,
148374148374
"slot": "3",
148375-
"type": "t_mapping(t_uint256,t_mapping(t_enum(EquipPosition)55377,t_uint16))",
148375+
"type": "t_mapping(t_uint256,t_mapping(t_enum(EquipPosition)76426,t_uint16))",
148376148376
"contract": "Cosmetics",
148377148377
"src": "contracts\\Cosmetics.sol:27"
148378148378
}
@@ -148386,7 +148386,7 @@
148386148386
"label": "bool",
148387148387
"numberOfBytes": "1"
148388148388
},
148389-
"t_struct(InitializableStorage)988_storage": {
148389+
"t_struct(InitializableStorage)1126_storage": {
148390148390
"label": "struct Initializable.InitializableStorage",
148391148391
"members": [
148392148392
{
@@ -148404,7 +148404,7 @@
148404148404
],
148405148405
"numberOfBytes": "32"
148406148406
},
148407-
"t_struct(OwnableStorage)928_storage": {
148407+
"t_struct(OwnableStorage)1066_storage": {
148408148408
"label": "struct OwnableUpgradeable.OwnableStorage",
148409148409
"members": [
148410148410
{
@@ -148420,15 +148420,15 @@
148420148420
"label": "uint64",
148421148421
"numberOfBytes": "8"
148422148422
},
148423-
"t_contract(IItemNFT)56681": {
148423+
"t_contract(IItemNFT)77799": {
148424148424
"label": "contract IItemNFT",
148425148425
"numberOfBytes": "20"
148426148426
},
148427-
"t_contract(IPlayerNFT)56807": {
148427+
"t_contract(IPlayerNFT)77932": {
148428148428
"label": "contract IPlayerNFT",
148429148429
"numberOfBytes": "20"
148430148430
},
148431-
"t_enum(EquipPosition)55377": {
148431+
"t_enum(EquipPosition)76426": {
148432148432
"label": "enum EquipPosition",
148433148433
"members": [
148434148434
"NONE",
@@ -148459,24 +148459,24 @@
148459148459
],
148460148460
"numberOfBytes": "1"
148461148461
},
148462-
"t_mapping(t_enum(EquipPosition)55377,t_uint16)": {
148462+
"t_mapping(t_enum(EquipPosition)76426,t_uint16)": {
148463148463
"label": "mapping(enum EquipPosition => uint16)",
148464148464
"numberOfBytes": "32"
148465148465
},
148466-
"t_mapping(t_uint16,t_struct(CosmeticInfo)55695_storage)": {
148466+
"t_mapping(t_uint16,t_struct(CosmeticInfo)76744_storage)": {
148467148467
"label": "mapping(uint16 => struct CosmeticInfo)",
148468148468
"numberOfBytes": "32"
148469148469
},
148470-
"t_mapping(t_uint256,t_mapping(t_enum(EquipPosition)55377,t_uint16))": {
148470+
"t_mapping(t_uint256,t_mapping(t_enum(EquipPosition)76426,t_uint16))": {
148471148471
"label": "mapping(uint256 => mapping(enum EquipPosition => uint16))",
148472148472
"numberOfBytes": "32"
148473148473
},
148474-
"t_struct(CosmeticInfo)55695_storage": {
148474+
"t_struct(CosmeticInfo)76744_storage": {
148475148475
"label": "struct CosmeticInfo",
148476148476
"members": [
148477148477
{
148478148478
"label": "cosmeticPosition",
148479-
"type": "t_enum(EquipPosition)55377",
148479+
"type": "t_enum(EquipPosition)76426",
148480148480
"offset": 0,
148481148481
"slot": "0"
148482148482
},
@@ -164059,6 +164059,209 @@
164059164059
]
164060164060
}
164061164061
}
164062+
},
164063+
"1d111f36ba9050fbbbeff5ef94edcbb1821308a71381c882760de284a4341fe2": {
164064+
"address": "0x721F742aDF2C08949ab72eBed58990CBD3A1eac2",
164065+
"txHash": "0x5d0e7c79bc83cbdf71adaa65a8b855ff0b5b74675609978d0bc8721026cf48e3",
164066+
"layout": {
164067+
"solcVersion": "0.8.28",
164068+
"storage": [
164069+
{
164070+
"label": "_itemNFT",
164071+
"offset": 0,
164072+
"slot": "0",
164073+
"type": "t_contract(IItemNFT)78410",
164074+
"contract": "Cosmetics",
164075+
"src": "contracts\\Cosmetics.sol:24"
164076+
},
164077+
{
164078+
"label": "_playerNFT",
164079+
"offset": 0,
164080+
"slot": "1",
164081+
"type": "t_contract(IPlayerNFT)78543",
164082+
"contract": "Cosmetics",
164083+
"src": "contracts\\Cosmetics.sol:25"
164084+
},
164085+
{
164086+
"label": "_cosmetics",
164087+
"offset": 0,
164088+
"slot": "2",
164089+
"type": "t_mapping(t_uint16,t_struct(CosmeticInfo)77355_storage)",
164090+
"contract": "Cosmetics",
164091+
"src": "contracts\\Cosmetics.sol:26"
164092+
},
164093+
{
164094+
"label": "_equippedCosmetics",
164095+
"offset": 0,
164096+
"slot": "3",
164097+
"type": "t_mapping(t_uint256,t_mapping(t_enum(EquipPosition)77037,t_uint16))",
164098+
"contract": "Cosmetics",
164099+
"src": "contracts\\Cosmetics.sol:27"
164100+
}
164101+
],
164102+
"types": {
164103+
"t_address": {
164104+
"label": "address",
164105+
"numberOfBytes": "20"
164106+
},
164107+
"t_bool": {
164108+
"label": "bool",
164109+
"numberOfBytes": "1"
164110+
},
164111+
"t_struct(InitializableStorage)1126_storage": {
164112+
"label": "struct Initializable.InitializableStorage",
164113+
"members": [
164114+
{
164115+
"label": "_initialized",
164116+
"type": "t_uint64",
164117+
"offset": 0,
164118+
"slot": "0"
164119+
},
164120+
{
164121+
"label": "_initializing",
164122+
"type": "t_bool",
164123+
"offset": 8,
164124+
"slot": "0"
164125+
}
164126+
],
164127+
"numberOfBytes": "32"
164128+
},
164129+
"t_struct(OwnableStorage)1066_storage": {
164130+
"label": "struct OwnableUpgradeable.OwnableStorage",
164131+
"members": [
164132+
{
164133+
"label": "_owner",
164134+
"type": "t_address",
164135+
"offset": 0,
164136+
"slot": "0"
164137+
}
164138+
],
164139+
"numberOfBytes": "32"
164140+
},
164141+
"t_uint64": {
164142+
"label": "uint64",
164143+
"numberOfBytes": "8"
164144+
},
164145+
"t_contract(IItemNFT)78410": {
164146+
"label": "contract IItemNFT",
164147+
"numberOfBytes": "20"
164148+
},
164149+
"t_contract(IPlayerNFT)78543": {
164150+
"label": "contract IPlayerNFT",
164151+
"numberOfBytes": "20"
164152+
},
164153+
"t_enum(EquipPosition)77037": {
164154+
"label": "enum EquipPosition",
164155+
"members": [
164156+
"NONE",
164157+
"HEAD",
164158+
"NECK",
164159+
"BODY",
164160+
"ARMS",
164161+
"LEGS",
164162+
"FEET",
164163+
"RING",
164164+
"SPARE2",
164165+
"LEFT_HAND",
164166+
"RIGHT_HAND",
164167+
"BOTH_HANDS",
164168+
"QUIVER",
164169+
"MAGIC_BAG",
164170+
"FOOD",
164171+
"AUX",
164172+
"BOOST_VIAL",
164173+
"EXTRA_BOOST_VIAL",
164174+
"GLOBAL_BOOST_VIAL",
164175+
"CLAN_BOOST_VIAL",
164176+
"PASSIVE_BOOST_VIAL",
164177+
"LOCKED_VAULT",
164178+
"TERRITORY",
164179+
"AVATAR",
164180+
"AVATAR_BORDER",
164181+
"TITLE"
164182+
],
164183+
"numberOfBytes": "1"
164184+
},
164185+
"t_mapping(t_enum(EquipPosition)77037,t_uint16)": {
164186+
"label": "mapping(enum EquipPosition => uint16)",
164187+
"numberOfBytes": "32"
164188+
},
164189+
"t_mapping(t_uint16,t_struct(CosmeticInfo)77355_storage)": {
164190+
"label": "mapping(uint16 => struct CosmeticInfo)",
164191+
"numberOfBytes": "32"
164192+
},
164193+
"t_mapping(t_uint256,t_mapping(t_enum(EquipPosition)77037,t_uint16))": {
164194+
"label": "mapping(uint256 => mapping(enum EquipPosition => uint16))",
164195+
"numberOfBytes": "32"
164196+
},
164197+
"t_struct(CosmeticInfo)77355_storage": {
164198+
"label": "struct CosmeticInfo",
164199+
"members": [
164200+
{
164201+
"label": "cosmeticPosition",
164202+
"type": "t_enum(EquipPosition)77037",
164203+
"offset": 0,
164204+
"slot": "0"
164205+
},
164206+
{
164207+
"label": "itemTokenId",
164208+
"type": "t_uint16",
164209+
"offset": 1,
164210+
"slot": "0"
164211+
},
164212+
{
164213+
"label": "avatarId",
164214+
"type": "t_uint24",
164215+
"offset": 3,
164216+
"slot": "0"
164217+
}
164218+
],
164219+
"numberOfBytes": "32"
164220+
},
164221+
"t_uint16": {
164222+
"label": "uint16",
164223+
"numberOfBytes": "2"
164224+
},
164225+
"t_uint24": {
164226+
"label": "uint24",
164227+
"numberOfBytes": "3"
164228+
},
164229+
"t_uint256": {
164230+
"label": "uint256",
164231+
"numberOfBytes": "32"
164232+
}
164233+
},
164234+
"namespaces": {
164235+
"erc7201:openzeppelin.storage.Ownable": [
164236+
{
164237+
"contract": "OwnableUpgradeable",
164238+
"label": "_owner",
164239+
"type": "t_address",
164240+
"src": "@openzeppelin\\contracts-upgradeable\\access\\OwnableUpgradeable.sol:24",
164241+
"offset": 0,
164242+
"slot": "0"
164243+
}
164244+
],
164245+
"erc7201:openzeppelin.storage.Initializable": [
164246+
{
164247+
"contract": "Initializable",
164248+
"label": "_initialized",
164249+
"type": "t_uint64",
164250+
"src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:69",
164251+
"offset": 0,
164252+
"slot": "0"
164253+
},
164254+
{
164255+
"contract": "Initializable",
164256+
"label": "_initializing",
164257+
"type": "t_bool",
164258+
"src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:73",
164259+
"offset": 8,
164260+
"slot": "0"
164261+
}
164262+
]
164263+
}
164264+
}
164062164265
}
164063164266
}
164064164267
}

scripts/deployPetNFTReroll.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
import {MetaTransactionData, OperationType} from "@safe-global/types-kit";
1010
import {
1111
BRUSH_ADDRESS,
12+
COSMETICS_ADDRESS,
1213
DEV_ADDRESS,
1314
ESTFOR_LIBRARY_ADDRESS,
1415
ITEM_NFT_ADDRESS,
@@ -77,6 +78,13 @@ async function main() {
7778
})) as string;
7879
console.log(`petNFT = "${petNFT.toLowerCase()}"`);
7980

81+
const Cosmetics = await ethers.getContractFactory("Cosmetics", proposer);
82+
const cosmetics = (await upgrades.prepareUpgrade(COSMETICS_ADDRESS, Cosmetics, {
83+
kind: "uups",
84+
timeout,
85+
})) as string;
86+
console.log(`cosmetics = "${cosmetics.toLowerCase()}"`);
87+
8088
const Players = await ethers.getContractFactory("Players", proposer);
8189
const players = (await upgrades.prepareUpgrade(PLAYERS_ADDRESS, Players, {
8290
kind: "uups",
@@ -130,6 +138,7 @@ async function main() {
130138
const transactionSet: MetaTransactionData[] = [
131139
getSafeUpgradeTransaction(ITEM_NFT_ADDRESS, itemNFT),
132140
getSafeUpgradeTransaction(PET_NFT_ADDRESS, petNFT),
141+
getSafeUpgradeTransaction(COSMETICS_ADDRESS, cosmetics),
133142
getSafeUpgradeTransaction(PLAYERS_ADDRESS, players),
134143
{
135144
to: ethers.getAddress(PLAYERS_ADDRESS),

0 commit comments

Comments
 (0)