Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
264 changes: 264 additions & 0 deletions packages/storage-evm/.openzeppelin/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -7454,6 +7454,270 @@
}
]
}
},
"allAddresses": [
"0x0A6bB8d5FE1042146a63f3C36261E97840b6eC00"
]
},
"9008243dd9d49862e7f3150b03f84507ae2d28f85dbcfbfad9b8d312afaecba1": {
"address": "0x0A6bB8d5FE1042146a63f3C36261E97840b6eC00",
"layout": {
"solcVersion": "0.8.28",
"storage": [
{
"label": "spacesContract",
"offset": 0,
"slot": "0",
"type": "t_address",
"contract": "DecayingTokenFactoryStorage",
"src": "contracts/storage/DecayingTokenFactoryStorage.sol:7"
},
{
"label": "decayVotingPowerContract",
"offset": 0,
"slot": "1",
"type": "t_address",
"contract": "DecayingTokenFactoryStorage",
"src": "contracts/storage/DecayingTokenFactoryStorage.sol:8"
},
{
"label": "isTokenDeployedByFactory",
"offset": 0,
"slot": "2",
"type": "t_mapping(t_address,t_bool)",
"contract": "DecayingTokenFactoryStorage",
"src": "contracts/storage/DecayingTokenFactoryStorage.sol:9"
},
{
"label": "spaceTokens",
"offset": 0,
"slot": "3",
"type": "t_mapping(t_uint256,t_address)",
"contract": "DecayingTokenFactoryStorage",
"src": "contracts/storage/DecayingTokenFactoryStorage.sol:12"
},
{
"label": "proposalsContract",
"offset": 0,
"slot": "4",
"type": "t_address",
"contract": "DecayingTokenFactory",
"src": "contracts/DecayingTokenFactory.sol:55"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_struct(InitializableStorage)73_storage": {
"label": "struct Initializable.InitializableStorage",
"members": [
{
"label": "_initialized",
"type": "t_uint64",
"offset": 0,
"slot": "0"
},
{
"label": "_initializing",
"type": "t_bool",
"offset": 8,
"slot": "0"
}
],
"numberOfBytes": "32"
},
"t_struct(OwnableStorage)13_storage": {
"label": "struct OwnableUpgradeable.OwnableStorage",
"members": [
{
"label": "_owner",
"type": "t_address",
"offset": 0,
"slot": "0"
}
],
"numberOfBytes": "32"
},
"t_uint64": {
"label": "uint64",
"numberOfBytes": "8"
},
"t_mapping(t_address,t_bool)": {
"label": "mapping(address => bool)",
"numberOfBytes": "32"
},
"t_mapping(t_uint256,t_address)": {
"label": "mapping(uint256 => address)",
"numberOfBytes": "32"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
}
},
"namespaces": {
"erc7201:openzeppelin.storage.Ownable": [
{
"contract": "OwnableUpgradeable",
"label": "_owner",
"type": "t_address",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24",
"offset": 0,
"slot": "0"
}
],
"erc7201:openzeppelin.storage.Initializable": [
{
"contract": "Initializable",
"label": "_initialized",
"type": "t_uint64",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69",
"offset": 0,
"slot": "0"
},
{
"contract": "Initializable",
"label": "_initializing",
"type": "t_bool",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73",
"offset": 8,
"slot": "0"
}
]
}
}
},
"cfe26594eb69db7bce6e71e9c28d59fed0c67a650661d46f7550708cbfa9e03a": {
"address": "0xc6F74D6555c9f77097F01590f5C404b5150603de",
"txHash": "0xea42071940a5908e4fc6af16feaf4ec94b3ede30316624eedeacc1c1372dabe6",
"layout": {
"solcVersion": "0.8.28",
"storage": [
{
"label": "spacesContract",
"offset": 0,
"slot": "0",
"type": "t_address",
"contract": "OwnershipTokenFactoryStorage",
"src": "contracts/storage/OwnershipTokenFactoryStorage.sol:7"
},
{
"label": "votingPowerContract",
"offset": 0,
"slot": "1",
"type": "t_address",
"contract": "OwnershipTokenFactoryStorage",
"src": "contracts/storage/OwnershipTokenFactoryStorage.sol:8"
},
{
"label": "isTokenDeployedByFactory",
"offset": 0,
"slot": "2",
"type": "t_mapping(t_address,t_bool)",
"contract": "OwnershipTokenFactoryStorage",
"src": "contracts/storage/OwnershipTokenFactoryStorage.sol:9"
},
{
"label": "spaceTokens",
"offset": 0,
"slot": "3",
"type": "t_mapping(t_uint256,t_address)",
"contract": "OwnershipTokenFactoryStorage",
"src": "contracts/storage/OwnershipTokenFactoryStorage.sol:12"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_struct(InitializableStorage)73_storage": {
"label": "struct Initializable.InitializableStorage",
"members": [
{
"label": "_initialized",
"type": "t_uint64",
"offset": 0,
"slot": "0"
},
{
"label": "_initializing",
"type": "t_bool",
"offset": 8,
"slot": "0"
}
],
"numberOfBytes": "32"
},
"t_struct(OwnableStorage)13_storage": {
"label": "struct OwnableUpgradeable.OwnableStorage",
"members": [
{
"label": "_owner",
"type": "t_address",
"offset": 0,
"slot": "0"
}
],
"numberOfBytes": "32"
},
"t_uint64": {
"label": "uint64",
"numberOfBytes": "8"
},
"t_mapping(t_address,t_bool)": {
"label": "mapping(address => bool)",
"numberOfBytes": "32"
},
"t_mapping(t_uint256,t_address)": {
"label": "mapping(uint256 => address)",
"numberOfBytes": "32"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
}
},
"namespaces": {
"erc7201:openzeppelin.storage.Ownable": [
{
"contract": "OwnableUpgradeable",
"label": "_owner",
"type": "t_address",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24",
"offset": 0,
"slot": "0"
}
],
"erc7201:openzeppelin.storage.Initializable": [
{
"contract": "Initializable",
"label": "_initialized",
"type": "t_uint64",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69",
"offset": 0,
"slot": "0"
},
{
"contract": "Initializable",
"label": "_initializing",
"type": "t_bool",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73",
"offset": 8,
"slot": "0"
}
]
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions packages/storage-evm/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,9 @@ npx nx run storage-evm:script ./scripts/token-voting-power.upgrade.ts --network
```bash
npx nx run storage-evm:script ./scripts/votedecay-voting-power.upgrade.ts --network base-mainnet
```

### Upgrade Decaying Token Factory

```bash
npx nx run storage-evm:script ./scripts/decaying-token-factory.upgrade.ts --network base-mainnet
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import dotenv from 'dotenv';
import { ethers } from 'ethers';

dotenv.config();

const DECAYING_TOKEN_FACTORY = '0x299f4D2327933c1f363301dbd2a28379ccD5539b';

async function main(): Promise<void> {
if (!process.env.RPC_URL) {
throw new Error('Missing required environment variable: RPC_URL');
}

const provider = new ethers.JsonRpcProvider(process.env.RPC_URL);

// Try to get the contract code to see if it's deployed
const code = await provider.getCode(DECAYING_TOKEN_FACTORY);
console.log('Contract code length:', code.length);

if (code === '0x') {
console.log('No contract deployed at this address!');
return;
}

// Try calling with a broader ABI to see what happens
const testAbi = [
'function getSpaceToken(uint256) view returns (address)',
'function spaceTokens(uint256) view returns (address)',
'function tokens(uint256) view returns (address)',
];

const contract = new ethers.Contract(
DECAYING_TOKEN_FACTORY,
testAbi,
provider,
);

// Test different possible function names
const testFunctions = ['getSpaceToken', 'spaceTokens', 'tokens'];

for (const funcName of testFunctions) {
try {
console.log(`\nTrying function: ${funcName}(94)`);
const result = await contract[funcName](94);
console.log(`Result: ${result}`);
} catch (error: any) {
console.log(`Failed: ${error.message.split('(')[0]}`);
}
}
}

main().catch(console.error);
Loading
Loading