-
Notifications
You must be signed in to change notification settings - Fork 1
tests, debug, deploy #848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
n0umen0n
wants to merge
3
commits into
main
Choose a base branch
from
debug1v1v
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
tests, debug, deploy #848
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
51 changes: 51 additions & 0 deletions
51
packages/storage-evm/scripts/base-mainnet-contracts-scripts/debug-decaying-factory.ts
This file contains hidden or 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,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); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.