mirror of
https://github.com/autistic-symposium/blockchains-security-toolkit.git
synced 2025-09-20 04:34:48 -04:00
🍿 master solidity
This commit is contained in:
parent
56e452de44
commit
558ccb7297
1 changed files with 9 additions and 9 deletions
|
@ -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>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue