-
Notifications
You must be signed in to change notification settings - Fork 559
Stylus CLI updates #7502
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
kumaryash90
wants to merge
15
commits into
main
Choose a base branch
from
yash/stylus-cli-update
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
Stylus CLI updates #7502
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c01e0a8
erc721 template
kumaryash90 54826fa
detect and parse constructor
kumaryash90 6e9a9ad
erc1155
kumaryash90 3fdb5be
airdrop erc20
kumaryash90 feb0e4d
airdrop erc721
kumaryash90 99b7764
airdrop erc1155
kumaryash90 c9dfa00
stylus deployer for deployment with constructor
kumaryash90 c37aff8
Merge branch 'main' into yash/stylus-cli-update
kumaryash90 11149a3
fix lint
kumaryash90 a041415
deploy with stylus constructor
kumaryash90 16cabef
check prerequisites in cli
kumaryash90 a9771c4
Merge branch 'main' into yash/stylus-cli-update
kumaryash90 58fda78
activate codehash, import metadata
kumaryash90 3f976f6
Merge branch 'main' into yash/stylus-cli-update
kumaryash90 4962bbc
Merge branch 'yash/stylus-cli-update' of github.com:thirdweb-dev/js i…
kumaryash90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[ | ||
"function activateProgram(address program) returns (uint16,uint256)" | ||
"function activateProgram(address program) returns (uint16,uint256)", | ||
"function codehashVersion(bytes32 codehash) external view returns (uint16 version)" | ||
] |
3 changes: 3 additions & 0 deletions
3
packages/thirdweb/scripts/generate/abis/stylus/IStylusConstructor.json
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,3 @@ | ||
[ | ||
"function stylus_constructor()" | ||
] |
4 changes: 4 additions & 0 deletions
4
packages/thirdweb/scripts/generate/abis/stylus/IStylusDeployer.json
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,4 @@ | ||
[ | ||
"function deploy(bytes calldata bytecode,bytes calldata initData,uint256 initValue,bytes32 salt) public payable returns (address)", | ||
"event ContractDeployed(address deployedContract)" | ||
] |
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
34 changes: 34 additions & 0 deletions
34
packages/thirdweb/src/cli/commands/stylus/check-prerequisites.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,34 @@ | ||
import { spawnSync } from "node:child_process"; | ||
import type { Ora } from "ora"; | ||
|
||
export function checkPrerequisites( | ||
spinner: Ora, | ||
cmd: string, | ||
args: string[] = ["--version"], | ||
name = cmd, | ||
) { | ||
try { | ||
const res = spawnSync(cmd, args, { encoding: "utf-8" }); | ||
|
||
if (res.error && (res.error as NodeJS.ErrnoException).code === "ENOENT") { | ||
spinner.fail( | ||
`Error: ${name} is not installed or not in PATH.\n` + | ||
`Install it and try again.`, | ||
); | ||
process.exit(1); | ||
} | ||
|
||
if (res.status !== 0) { | ||
spinner.fail( | ||
`Error: ${name} returned a non-zero exit code (${res.status}).`, | ||
); | ||
process.exit(1); | ||
} | ||
|
||
const ver = res.stdout.trim().split("\n")[0]; | ||
spinner.succeed(`${name} detected (${ver}).`); | ||
} catch (err) { | ||
spinner.fail(`Error while checking ${name}: ${err}`); | ||
process.exit(1); | ||
} | ||
} |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add explicit type annotation to comply with coding guidelines.
The variable declaration violates the coding guidelines which require explicit types and avoiding
any
. The implicitany
type should be replaced with the proper return type.📝 Committable suggestion
🤖 Prompt for AI Agents