🍿 master solidity

This commit is contained in:
bt3gl 2022-09-23 06:58:17 -07:00 committed by GitHub
parent 56e452de44
commit 558ccb7297
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,9 +1,9 @@
# 👾 Becoming a Solidity Expert # 🍿 master solidity
<br> <br>
## Predefined global variables and functions ## predefined global variables and functions
<br> <br>
@ -13,7 +13,7 @@
<br> <br>
### msg #### msg
* msg object: the transaction that triggered the execution of the contract. * msg object: the transaction that triggered the execution of the contract.
* msg.sender: sender address of the transaction. * msg.sender: sender address of the transaction.
@ -23,14 +23,14 @@
<br> <br>
## tx #### tx
* tx.gasprice: gas price in the calling transaction. * tx.gasprice: gas price in the calling transaction.
* tx.origin: address of the originating EOA for this transaction. WARNING: unsafe! * tx.origin: address of the originating EOA for this transaction. WARNING: unsafe!
<br> <br>
### block #### block
* block.coinbase: address of the recipient of the current block's fees and block reward. * block.coinbase: address of the recipient of the current block's fees and block reward.
* block.gaslimit: maximum amount of gas that can be spent across all transactions included in the current block. * block.gaslimit: maximum amount of gas that can be spent across all transactions included in the current block.
@ -39,7 +39,7 @@
<br> <br>
### address #### address
* address.balance: balance of the address, in wei. * address.balance: balance of the address, in wei.
* address.transfer(__amount__): Transfers the amount (in wei) to this address, throwing an exception on any error. * address.transfer(__amount__): Transfers the amount (in wei) to this address, throwing an exception on any error.
@ -50,7 +50,7 @@
<br> <br>
### built-in functions #### built-in functions
* addmod, mulmod: for modulo addition and multiplication. For example, addmod(x,y,k) calculates (x + y) % k. * addmod, mulmod: for modulo addition and multiplication. For example, addmod(x,y,k) calculates (x + y) % k.
* keccak256, sha256, sha3, ripemd160: calculate hashes with various standard hash algorithms. * keccak256, sha256, sha3, ripemd160: calculate hashes with various standard hash algorithms.
@ -64,7 +64,7 @@
--- ---
## TL;DR Solidity x Python/C++ ## TL;DR solidity x python/C++
<br> <br>
@ -258,7 +258,7 @@ Interesting facts:
---- ----
## Calling another contract ## calling another contract
<br> <br>