-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Add opcode info in compiling-smart-contracts #12217
Conversation
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Thanks @allwin199! Left a suggestion... if that looks good, just drop a comment, or go ahead and commit this suggestion and we'll get it in
public/content/developers/docs/smart-contracts/compiling/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Paul Wackerow <[email protected]>
WalkthroughThis update introduces a new section on Ethereum Virtual Machine (EVM) opcodes in the documentation for compiling smart contracts. It aims to enhance understanding by explaining the role of opcodes as the low-level instructions that drive the execution of smart contracts on the Ethereum blockchain. A link for further information is also provided, enriching the content with valuable resources for deeper exploration. Changes
Assessment against linked issues
The code changes effectively address the primary objectives outlined in the linked issue by adding detailed information about EVM opcodes and their importance in the context of compiling smart contracts. The inclusion of an external link for further reading also aligns with the goal of providing comprehensive information on the subject. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 2
Configuration used: CodeRabbit UI
Files selected for processing (1)
- public/content/developers/docs/smart-contracts/compiling/index.md (1 hunks)
Additional comments: 2
public/content/developers/docs/smart-contracts/compiling/index.md (2)
- 36-39: The addition of the section on EVM opcodes is well-integrated and provides valuable information to the reader. It's concise and directly addresses the knowledge gap identified in the PR objectives. However, consider adding a few examples of common opcodes and their use cases to further enrich this section.
- 33-42: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [12-12]
Consider revising "smart contracts" and "Ethereum virtual machine" to ensure consistency in capitalization throughout the document. Typically, "Ethereum Virtual Machine" is capitalized as it's a proper noun.
PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x41 JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0xCFAE3217 EQ PUSH2 0x46 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x52 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x5B PUSH2 0xD6 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x9B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x80 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xC8 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x60 PUSH1 0x40 DUP1 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x5 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x48656C6C6F000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP SWAP1 POP SWAP1 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 SLT 0xec 0xe 0xf5 0xf8 SLT 0xc7 0x2d STATICCALL ADDRESS SHR 0xdb COINBASE 0xb1 BALANCE 0xe8 0xf8 DUP14 0xda 0xad DUP13 LOG1 0x4c 0xb4 0x26 0xc2 DELEGATECALL PUSH7 0x8994D3E002900 | ||
``` | ||
|
||
These are called **opcodes**. EVM opcodes are the low-level instructions that the Ethereum Virtual Machine (EVM) can execute. Each opcode represents a specific operation, such as arithmetic operations, logical operations, data manipulation, control flow, etc. | ||
|
||
[More on opcodes](/developers/docs/evm/opcodes/) | ||
|
||
## Web applications {#web-applications} | ||
|
||
The compiler will also produce the **Application Binary Interface (ABI)** which you need in order for your application to understand the contract and call the contract's functions. |
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.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [16-16]
To improve readability, consider adding a comma after "contract" in the phrase "to be able to run your contract it needs to be in bytecode."
- to be able to run your contract it needs to be in **bytecode**.
+ to be able to run your contract, it needs to be in **bytecode**.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [46-46]
The phrase "in order for you to" can be simplified to "for you to" for conciseness without losing meaning.
- in order for you to call on your smart contract in your web app's interface.
+ for you to call on your smart contract in your web app's interface.
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.
Looks good! Thanks @allwin199!
Congrats, your important contribution to this open-source project has earned you a GitPOAP! Be sure to join the Ethereum.org discord if you are interested in contributing further to the project or have any questions for the team. GitPOAP: 2024 Ethereum.org Contributor: Head to gitpoap.io & connect your GitHub account to mint! Learn more about GitPOAPs here. |
@all-contributors please add @allwin199 for content |
I've put up a pull request to add @allwin199! 🎉 |
Compiling smart contract page doesn't have info about opcodes.
Description
In compiling smart contracts page an example of how smart contract is converted to opcodes is provided. But there is missing info about opcodes. This PR adds info about what are opcodes and what is the relation between opcodes and EVM.
Related Issue
Summary by CodeRabbit