Skip to main content

Questions tagged [fallback-function]

Questions dealing with the Solidity fallback function

1 vote
1 answer
38 views

I was trying to test something, and found that we can have function type inside a mapping like this: contract Test { uint public number; // Internal function to set the number function ...
bghad1's user avatar
  • 13
1 vote
1 answer
44 views

Can a contract be designed in such a way that it will always have a balance of zero ETH? Maybe this can be achieved by skipping the payable modifier in all functions, and not implementing the fallback ...
Paul Razvan Berg's user avatar
1 vote
0 answers
36 views

I am working on the ethernaut CTF level (code below)...I need to take over ownership of the instance (it's been deployed). I thought I could do it by sending a small amount of ETH to the instance ...
user127148's user avatar
1 vote
2 answers
359 views

I am using examples in soliditylang.org special functions My simple contracts are extracted from the link // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.6.2 <0.9.0; contract ...
oldpride's user avatar
  • 131
0 votes
2 answers
204 views

Here is my code contract SimpleUpgrade { address public implementation; address public admin; string public words; constructor(address _implementation) { admin = msg.sender; ...
Corbin_Guo's user avatar
3 votes
2 answers
762 views

Ethereum validators set a withdrawal address to automatically receive their staking rewards. These rewards are distributed gas free at the protocol level through a process called "validator ...
CBobRobison's user avatar
  • 1,245
0 votes
1 answer
279 views

Hey guys, I was reading about low-level methods of calling other contract functions and I found the following description of call method: This is the recommended method to use when you're just ...
Nurnberg_Meistersinger's user avatar
1 vote
1 answer
1k views

I have a contract that needs to be able to receive Ether. The contract includes a receive function to receive Ether but I wonder if it's good practice to also have a fallback function in case someone ...
RishtarCode47's user avatar
0 votes
1 answer
44 views

hey guys I come across this video about re-entrancy attack posted by Chainlink, but I have some questions about the syntax being covered. please help. // SPDX-License-Identifier: MIT pragma solidity ^...
Simon Zhao's user avatar
0 votes
1 answer
96 views

function () payable external { address impl = methodsImplementations[msg.sig]; require(impl != address(0x00), "Method not found. 404"); assembly { let p := mload(...
Vidhan Mangla's user avatar
0 votes
1 answer
196 views

Code is : contract sendEther{ //to send ether, we need to deposit some ether first in this contract //We can do it by declaring constructor as payable which enables us to deposit some ether ...
shikamaru's user avatar
2 votes
1 answer
717 views

According to the official Solidity documentation: The low-level functions call, delegatecall and staticcall return true as their first return value if the account called is non-existent, as part of ...
Liron Achdut's user avatar
1 vote
1 answer
137 views

I am trying to write a game on smart contract which is a game in which the player has to type in 5 guesses, and based on how close they were to the actual number, they would receive ether as prize. ...
Rjey's user avatar
  • 17
1 vote
1 answer
48 views

i scanned the smart contract in the decompiler, how will the withdrawal function be translated?
tomas's user avatar
  • 41
0 votes
0 answers
59 views

I encountered such a problem, when i imported the smart contract unto remix, i did this through ABI...ok one wallet created two contracts, different times, the first contract is now worthless. i'm ...
tomas's user avatar
  • 41

15 30 50 per page
1
2 3 4 5
10