Questions tagged [send]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
37 views

Ethernaut King: transfer() and send() doesn't work, but call() succeeds in taking Kingship

I was trying to solve the King challenge in Ethernaut, but taking Kingship proved to be a bit tricky: // Transaction fails function takeTheThroneWithTransfer() public payable{ payable(...
Richu A Kuttikattu's user avatar
1 vote
0 answers
27 views

Why smart contract call() is cheaper than sendTransaction when send ether to a wallet holding ether

// Solidity function sender(address payable _to, uint _value) private { (bool success,) = _to.call{value: _value}(""); require(success,"Fail Send By Call"); } // ethers ...
imelon2's user avatar
  • 528
0 votes
2 answers
52 views

Sending fix amount of ETH without manually input value in remix

I tried writing a contract so that we can send eth without inputting value manually in this field in remix. So, we just need to click the sendEth button below ( no need to input anything) The ...
tony's user avatar
  • 13
2 votes
1 answer
205 views

How can I send an NFT automatically when someone clicks on the claim NFT button?

I am working on a quiz site but I want the winners and participants to receive NFT at the end of the quiz. But I do not want to manually sign the transactions. I understand I can use ethers.js and use ...
Coding_templar's user avatar
0 votes
1 answer
2k views

Coinbase / Web3 - how are they connected? Where is my balance on Web3

I am brand new. I created a Coinbase Account and started investing. I heard someone say something about web3. I don't know what this is, but I think i have money in there. As I'm still waiting to be ...
TheBlackSheep's user avatar
0 votes
1 answer
25 views

Does a blank space matter? - (bool sent,)

In terms of sending ETH from a contract, if only the boolean is needed and the data gets omitted, I always see two different versions. Some people write it with a blank space (bool sent, ) and some ...
Andy's user avatar
  • 185
1 vote
2 answers
46 views

Can a simple ether refund without storage checks be hackable(reentrancy attack, ...)?

As the title says, I am wondering if the following ether refund(using .call) can be hackable. I am not entirely sure no reentrancy attack can be performed in it, but I think so since I am not updating ...
Demain's user avatar
  • 11
1 vote
1 answer
118 views

Recommended way to remove ETH balance from a contract?

There are multiple methods to withdraw the ETH balance of a contract to the owners' wallet: function withdrawal() external { payable(owner).transfer(address(this).balance); } function withdrawal()...
Andy's user avatar
  • 185
0 votes
1 answer
89 views

Is "msg.sender.token1().gas(msg.gas)" too low-level call?

Context : I decompiled this contract(https://bscscan.com/address/0x5cb11ce550a2e6c24ebfc8df86c5757b596e69c1#code) which is the attacker's smartcontract that hacked MEV-bot. You can check the ...
Shift_that's user avatar
1 vote
1 answer
84 views

How can I verify that a function (IERC777.send) is executed successfully if it doesn't return anything but only emits an event

In a solidity smart contract function, I want to verify that an IERC777.send function has executed successfully before proceeding. Unfortunately, IERC777 has no bool return that I could use in this ...
robertrongen's user avatar
0 votes
2 answers
458 views

What is causing this invalid opcode error when I call the transfer function?

I am working through the process of developing a simple ERC-20 token to learn more about smart contract development. I am running into an issue on my coin sale contract, however. When I wish to end ...
ho88it's user avatar
  • 21
1 vote
1 answer
546 views

Possible to send ether to another smart contract without function call?

I've created a contract, let's call it Contract A that mints an NFT when it receives .001 Ether. This is the receive() function in Contract A: receive() external payable { require( ...
juju's user avatar
  • 11
3 votes
2 answers
2k views

Front End: Transfer (send) your NFTs (ERC-721) using Ethers.js or Wagmi.sh

I'm a front-end dev getting my feet wet in the crypto nft space. I built a simple site for displaying all the NFTs in your wallet. Users can connect to the page using Rainbowkit (built on top of WAGMI,...
ken.ng's user avatar
  • 165
4 votes
1 answer
1k views

How to send ether to a contract (even if the contract doesn't implement receive or fallback functions)? [duplicate]

If the contract doesn't implement the receive or fallback function as payable, it can't receive funds?
Eric Nordelo Galiano's user avatar
0 votes
1 answer
79 views

How to send from a contract to a personal wallet

// SPDX-License_Identifier: MIT pragma solidity >=0.6.6 <0.9.0; //2.56 //import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; import "hardhat/console.sol&...
Francesco Pugliese's user avatar
0 votes
1 answer
106 views

Send Ether from SC to EAO

I came across many blogs saying the defacto standard to send ether from one contract to another and why one is better than the other. However, what is the best practice for sending ether from contract ...
Emrah's user avatar
  • 1,654
1 vote
2 answers
3k views

How to send a value to smart contract function using meta mask and web3.js?

I tried to follow a tutorial https://livecodestream.dev/post/interacting-with-smart-contracts-from-web-apps/ I was able to retrieve the number via call function, but was not able to update the number ...
Davborg82's user avatar
0 votes
2 answers
782 views

Transferring an NFT via MetaMask

Im onto developing my own NFT project. Im developing with the Truffle Suite and Ganache. I can mint the NFT to my address, but whats wondering me: I cant send the NFT because the "send" ...
Luex's user avatar
  • 61
0 votes
1 answer
57 views

Sending balance to contract fails

I'm playing ethernaut, the king of the hill level. I made a practice target contract and an attacking contract. I want to send value to the attacking contract (this works) then I want to send the ...
guernica's user avatar
0 votes
1 answer
625 views

What is the "bytes memory" in (bool success, bytes memory) = some_address.call{value: some_amount}("")

I understand that the success tells if the receive/fallback methods returned successfully but what does the memory give?
tythereum's user avatar
0 votes
0 answers
865 views

How to send BNB (or other networks) with web3 on a dapp?

So, I tried the many examples found around but I never manage to get it working. I have this snippet: async function pay(cost) { code = 0 message = "Please approve the tx" ...
Wyatt Gillette's user avatar
0 votes
0 answers
156 views

Calling a non-payable function that mutates state? (web3)

With web3, you can call read-only functions using 'call()' (eg, balanceOf), and functions that mutate state with 'send({from: adr, value: 10})' I'm able to call payable and non-payable functions fine, ...
greentriangles1's user avatar
0 votes
1 answer
1k views

Error calling web3.eth.Contract send() function gives error: Method not found

I just deployed a contract and wants to access it using web3 to read and write data. I have web3 working, passed the contract Address and ABI and I can access the contract and Read Data using: ...
Matt's user avatar
  • 1
0 votes
1 answer
441 views

EVM:out of gas while executing send

I want to consider a scenario, lets suppose that a contract performs a transfer using send. At this point, out of gas occurs and send returns -1. Now the contract has no gas, and send does not revert,...
zak100's user avatar
  • 1,406
0 votes
1 answer
522 views

Error: Member "send" not found or not visible after argument-dependent lookup

I am trying to compile the following smart contract: pragma solidity ^0.5.1; contract Governmental{ uint constant TWELVE_HOURS = 12; function lendGovernmentMoney ( address buddy ) public ...
zak100's user avatar
  • 1,406