Token holder. The holder can “authorize” and “revoke” operators which can send tokens on their behalf. These operators are intended to be verified contracts such as an exchange, a cheque processor or an automatic charging system.
An operator is an address which is allowed to send and burn tokens on behalf of some holder.
One obvious point not emphasized in previously posted answers is that, YES, requiring
size := extcodesize(_addr)
will guarantee that only a contract can make it past the check if size > 0.
However, the opposite check to see that a sender is NOT a contract (but an EOA) is much more complicated and requires a signature verification scheme in ...
View and Pure functions are gasless only if they do not get called from the contract internally.
The function in the question would be gasless if called externally. Pure functions do not read or modify state, where as View functions read but do not modify state.
I see where your doubt is coming from.
Remix allows imports directly from github for quick development.
But development environments such as truffle & hardhat do not support HTTP/HTTPS imports. And hence, you need a package manager(mostly npm) to add additional contracts.
Even though you are using package managers or HTTP/HTTPS imports, after compiling ...
@openzeppelin refers to the the OpenZeppelin package you installed locally. This is not a reference to the Github page, the contracts are really stored in your project in the node_modules folder. Moreover, the version of the package can be found in the package.json file.
Using import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; is equivalent ...
The second way is correct. In Solidity, ** is the exponentiation operator, so 10 ** 18 is the same as 1018. So this:
uint256 totalSupply = 10000 * (10 ** uint256(decimals));
Means the total supply will be 10,000 × 1018 tokens. We use 10n because Solidity doesn´t (fully) support decimal numbers, only integers. In wallets, dApps, etc. this number is converted ...
Deep down, an array is a mapping with range-bound keys. The most expensive aspect is the SSTORE operations and SLOAD operations which are the same in both cases.
An array has additional steps (operations, so gas) to check that row is not out of range.
A dynamic array is significantly more expensive because each push overwrites the length and range checks ...
If array is in storage each slot modification will cost 5000 gas, so modifying an array with 10,000 items will cost about 50M gas, well beyond the current block gas limit of 12M.
Currently the EVM is not very good at handling much data, it is expensive. Usually it is better to use it as a settlement layer, and perform most computations off-chain.
As far as I know, no wallet would ever be recognised if no transaction was ever made
You are right. When a new wallet is created nodes do not know about it until it is involved in a transaction. Once it does, the nodes will save the new account in their local world state trie. There is no smart contract involved for address registration (the accounts are ...