Вопрос для ETH разработчика.
В чем разница между private, internal, public, and external functions?
Возможный вариант ответа:
Модификаторы видимости обязательны, всего их бывает 4. Указывает на то, откуда функция может быть вызвана:
external - внешние функции, могут быть вызваны только из другого контракта или через транзакцию, вызов func() не сработает внутри контракта, сработает this.func(), но практика с использованием this нежелательна, поскольку такая операция дороже. Если у вас появилась потребность вызвать external функцию внутри контракта, то лучше переименуйте её в public(следующий пункт)
public - функции с этим модификатором могут быть вызваны откуда угодно
internal - внутренние функции, нельзя вызвать через транзакцию, можно вызвать внутри контракта и контрактов, наследующих его. В этом случае this не работает
private - функции с этим модификатором можно вызвать только внутри текущего контракта
#вопрос #eth #собеседование
В чем разница между private, internal, public, and external functions?
Возможный вариант ответа:
Модификаторы видимости обязательны, всего их бывает 4. Указывает на то, откуда функция может быть вызвана:
external - внешние функции, могут быть вызваны только из другого контракта или через транзакцию, вызов func() не сработает внутри контракта, сработает this.func(), но практика с использованием this нежелательна, поскольку такая операция дороже. Если у вас появилась потребность вызвать external функцию внутри контракта, то лучше переименуйте её в public(следующий пункт)
public - функции с этим модификатором могут быть вызваны откуда угодно
internal - внутренние функции, нельзя вызвать через транзакцию, можно вызвать внутри контракта и контрактов, наследующих его. В этом случае this не работает
private - функции с этим модификатором можно вызвать только внутри текущего контракта
#вопрос #eth #собеседование
👍4
Вопрос для ETH разработчика.
What is the difference between create and create2?
What is CREATE
Smart contracts can be created both by other contracts and regular EOA.They both compute the new address the same way:
So each created address is associated with a nonce value.Nonce increased on every transaction.It is related to the number of transactions we make and is unpredictable. That’s why we need CREATE2.
What is CREATE2?
The whole idea behind this opcode is to make the resulting address independent of future events. Regardless of what may happen on the blockchain, it will always be possible to deploy the contract at the precomputed address.There are four parameters in CREATE2 function:
* 0xFF
* the address of sender
* A salt (random value from sender)
* bytecode (the code of the new contract)
Обьяснение на русском читайте по ССЫЛКЕ
#вопрос #eth #собеседование
What is the difference between create and create2?
What is CREATE
Smart contracts can be created both by other contracts and regular EOA.They both compute the new address the same way:
new_address = keccak256(sender, nonce)
So each created address is associated with a nonce value.Nonce increased on every transaction.It is related to the number of transactions we make and is unpredictable. That’s why we need CREATE2.
What is CREATE2?
The whole idea behind this opcode is to make the resulting address independent of future events. Regardless of what may happen on the blockchain, it will always be possible to deploy the contract at the precomputed address.There are four parameters in CREATE2 function:
* 0xFF
* the address of sender
* A salt (random value from sender)
* bytecode (the code of the new contract)
new_address = keccak256(0xFF, sender, salt, bytecode)
Обьяснение на русском читайте по ССЫЛКЕ
#вопрос #eth #собеседование
🔥3👍1
Вопрос для ETH разработчика.
Насколько большим может быть смарт-контракт?
Ответ:
The Solidity max contract size is 24,576 bytes. This contract code size limit was introduced in EIP-170 with the Spurious Dragon hard-fork. The purpose of this limit is to prevent denial-of-service (DOS) attacks.
Максимальный размер контракта Solidity составляет 24 576 байт. Это ограничение размера кода контракта было введено в EIP-170 с хард-форком Spurious Dragon. Целью этого ограничения является предотвращение DOS aтак.
#вопрос #eth #собеседование
Насколько большим может быть смарт-контракт?
Ответ:
Максимальный размер контракта Solidity составляет 24 576 байт. Это ограничение размера кода контракта было введено в
#вопрос #eth #собеседование
What prevents infinite loops from running forever?
Почему нет бесконечных циклов в Solidity?
The transaction gas limit prevents infinite loops from running forever.
Так как есть лимит газа.
#вопрос #eth #собеседование
Почему нет бесконечных циклов в Solidity?
Так как есть лимит газа.
#вопрос #eth #собеседование
🔥6👍1
Вопрос для SOLIDITY разработчика.
What major change with arithmetic happened with Solidity 0.8.0?
Starting with version 0.8.0, Solidity automatically includes checks for arithmetic underflows and overflows as a built-in feature of the language. Before version 0.8.0, integer underflows and overflows were allowed and would not cause an error. Since version 0.8.0, Solidity will revert if an expression causes an integer underflow or overflow.
На русском можно почитать по ссылке
#вопрос #eth #собеседование
What major change with arithmetic happened with Solidity 0.8.0?
На русском можно почитать по ссылке
#вопрос #eth #собеседование
Хабр
Solidity: Путешествие в сердце оптимизации
Приветствую, кодеры Solidity! Если вы здесь, то или у вас есть смарт-контракт, который готов к "похудению", или вы просто пытаетесь нарастить свои мышцы в области оптимизации Solidity. Как бы то ни...
Вопрос для solidity разработчика.
What special CALL is required for proxies to work?
DELEGATECALL is required for proxy contracts to work because this type of call will preserve the msg (msg.sender, msg.value, etc…) and run in the context of the calling contract instead of the called contract. This enables the proxy contract to call an implementation contract to modify the proxy contract’s state.
By using DELEGATECALL, the implementation contract can be upgraded without the smart contract system losing any information or having to change the address of the proxy.
Больше про DELEGATECALL по ссылке
#вопрос #eth #собеседование
What special CALL is required for proxies to work?
By using DELEGATECALL, the implementation contract can be upgraded without the smart contract system losing any information or having to change the address of the proxy.
Больше про DELEGATECALL по ссылке
#вопрос #eth #собеседование
Medium
Delegatecall in Solidity
In Solidity, delegatecall is a low-level function that allows one contract to call another contract and run its code within the context of…
👌2
Вопрос для ETH разработчика.
What are the challenges of creating a random number on the blockchain?
Answer: Random number generation on the blockchain is difficult because of its deterministic and public nature. The Ethereum Virtual Machine (EVM) must produce the same output given the same input, and all data on the blockchain is public.
Как сгенерировать настоящие случайные числа в Solidity с блокчейном
#вопрос #eth #собеседование
What are the challenges of creating a random number on the blockchain?
Как сгенерировать настоящие случайные числа в Solidity с блокчейном
#вопрос #eth #собеседование
Medium
Как сгенерировать настоящие случайные числа в Solidity с блокчейном
Для чего нужны случайные числа в блокчейне, какие задачи с ними связаны и какие лучшие решения для этого существуют.
👍2
Which is better to use for an address allowlist: a mapping or an array? Why?
Answer: A is better for an address allowlist because it is more gas efficient. With a mapping, it is possible to check if an address is on the by directly accessing its value. Using an , verifying an address could be costly because it would require looping through each element.
Mapping в Solidity
Расчет количества газа необходимого для выполнения транзакции в Ethereum
#вопрос #eth #собеседование
mapping
allowlist
array
Mapping в Solidity
Расчет количества газа необходимого для выполнения транзакции в Ethereum
#вопрос #eth #собеседование
Хабр
Solidity: mapping
Концепция mapping в Solidity аналогична HashMap в Java или dict в Python. Нет ничего лучше, чем аналогия с реальным миром, чтобы понять, что такое mapping в Solidity и как он себя ведет. Следующий...
👍2
What is the difference between
and serve different purposes. The function is commonly used for input validation or to validate the state before executing certain logic. The function is used to check for invariants, to ensure that there’s no error in the contract’s logic and to prevent conditions that should never be possible.
#вопрос #eth #собеседование
assert
and require
? assert
require
require
assert
#вопрос #eth #собеседование
👍1
What is the minimum amount of Ether required to run a solo staking node?
Каково минимальное количество эфира, необходимое для запуска соло-стейкинга?
32 ETH
Solo staking: The most secure option, you'll need to 32ETH to stake and have a dedicated computer with a reliable and constant connection.
Staking pools: You join a pool using any amount of ETH , which is used to create a node of 32 ETH .
Статья на русском
#вопрос #eth #собеседование
Каково минимальное количество эфира, необходимое для запуска соло-стейкинга?
Solo staking: The most secure option, you'll need to 32
Staking pools: You join a pool using any amount of
Статья на русском
#вопрос #eth #собеседование
hashmart.io
Все о стейкинге Ethereum в Hashmart Блог Hashmart
стейкинг криптовалют с чего начать
❤2👍1🤝1
Ethereum Smart Contract Development
Автор: Mayukh Mukhopadhyay
Год издания: 2018
#eth #en
Скачать книгу
Автор: Mayukh Mukhopadhyay
Год издания: 2018
#eth #en
Скачать книгу
👍2❤1