Content pfp
Content
@
1 reply
0 recast
2 reactions

Black Roseβ“‚οΈπŸŽ­βš‘πŸ’ŽπŸ—Ώ pfp
Black Roseβ“‚οΈπŸŽ­βš‘πŸ’ŽπŸ—Ώ
@blackrosemmav
Learn about Solidity πŸ’‘βš‘οΈ How functions work in Solidity: 1. **Definition**: Functions are defined using the `function` keyword, followed by the function name, parameters, and a return type if applicable. πŸ’Ž 2. **Visibility**: Functions can have visibility modifiers like `public`, `private`, `internal`, or `external`, determining who can call the function. The example above uses `public`, meaning it can be called from anywhere. πŸ’Ž 3. **Implementation**: The block of code within curly braces `{}` contains the function's logic, and you can return values using the `return` statement if a return type is specified. For instance: ```solidity return a + b; ``` πŸ’Ž Here's a complete example of a simple add function in a contract: ```solidity pragma solidity ^0.8.0; contract SimpleCalculator { function add(uint a, uint b) public pure returns (uint) { return a + b; } } ``` ❀️‍πŸ”₯ This contract allows you to add two numbers on the blockchain!
1 reply
0 recast
0 reaction

pepeπŸŽ©πŸ”΅πŸŒˆβ›“οΈπŸ”΄πŸΉ pfp
pepeπŸŽ©πŸ”΅πŸŒˆβ›“οΈπŸ”΄πŸΉ
@amirhz
hello 106 $DEGEN 4 U
0 reply
0 recast
0 reaction