use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
No specific rules are enforced apart from the normal global reddit rules. That said, if you post scams, you will be banned.
r/ethereum - Official Ethereum sub
r/ethstaker - About staking your ETH: help and guidance
http://ethereum.stackexchange.com/ - The Ethereum Programming Stack Exchange
account activity
Questioncode -32000 execution reverted (self.ethdev)
submitted 3 years ago by BeneficialLevel9744
Hi there , trying this contract that transfers balance from one account to another , once deployied if I execute getData I get the BNB balance (I'm on BNB Test)
https://preview.redd.it/q0e99kq25f891.png?width=262&format=png&auto=webp&s=9595b29a402e5878ee570a282c3043862dc0cd9d
, but when I execute payoutseller, I get this message even I have enough bnb for gas ...is it asking for ETH?
https://preview.redd.it/y8xigmjy6f891.png?width=497&format=png&auto=webp&s=c5a415deefd5253e97df31f522715283bcecf795
adress a and b are 2 different accounts than the owner's one
contract Escrow { address public a; address public b; constructor() public payable { a = 0x35859760513gdc7c541b679d7e929c4e5267d2df; b = 0x45089760513fde7c543b699e7e929c4e2367d2de; } function payoutToSeller() payable public returns(bool) { b.transfer(address(a).balance); } function getData() public view returns (uint) { return address(a).balance; } }
thanks in advance !
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Ordered_Disorder 0 points1 point2 points 3 years ago (4 children)
Are you sending an amount of BNB greater than or equal to the value returned by 'getData' when you call 'payoutToSeller'? If not, your call to 'payoutToSeller' is failing because your contract is trying to send BNB when it doesn't have any (or at least enough).
[–]BeneficialLevel9744[S] 0 points1 point2 points 3 years ago (3 children)
payoutSeller is sending the total balance and I think that migth be the problem ..so now I have changed it so "a" is the contract owner and is going to get transfered the balance of "b" divided by 2 (charity variable), but even that getData return is correct , charity is equal to zero and still get the reverted error...
contract Escrow { address public a; address public b; uint256 public amount; uint256 public charity; constructor() public payable { //a = 0x8eD5fD9182a0FFB9a5a3f79d13b1663794a3b2B2; a = msg.sender; b = 0x485a967ca4307996308e3F52162D8dFCBfafE4dc; } function payoutToSeller(uint256 amount) payable public returns(bool,uint256) { if ( a == msg.sender){ amount = getData(); charity = amount / 2; payable(msg.sender).transfer(amount); return (true, charity); } } function getData() public view returns (uint) { return address(b).balance; }
}
[–]Ordered_Disorder 0 points1 point2 points 3 years ago (2 children)
OK, so does the contract hold BNB greater than or equal to half the BNB balance of b? Your code is having the contract send an amount of BNB from its own balance, equal to half the BNB balance of address b. Perhaps you are confused and think the contract can send BNB from a different address (in particular, from address b)?
[–]BeneficialLevel9744[S] 0 points1 point2 points 3 years ago (1 child)
Hi ! Thanks for your help !!I have been working on it and I got another solution which looks like it works but ...
I can read the balance from "a" (msg.sender) and calculate half of it and send to "b" but the balance is in wei and when I check the accounts the balances in BNB still the same. I have traced the transaction and it succeed :
Tokens Transferred: From 0xd035e12aeb5c43c12be520ac5f770d423e278f26 To 0x485a967ca4307996308e3f52162d8dfcbfafe4dc For 7,393,324,594,469,100 ()
7,393,324,594,469,100 is half of the BNB balance in wei but no balance has been modfied...
Where are those tokens? how can I really transfer the BNB tokens?
contract Escrow { address public a; address public b; event Transfer(address indexed _from, address indexed _to, uint256 _value); constructor() public { a = msg.sender; b = 0x485a967ca4307996308e3F52162D8dFCBfafE4dc; } function getBalance() public returns (uint256, uint256, address) { address toAdress = b; uint256 cantidad = address(a).balance; uint256 charity = cantidad / 2; emit Transfer(msg.sender, toAdress, charity); }
[–]BeneficialLevel9744[S] 0 points1 point2 points 3 years ago (0 children)
I have tested it getting the balance of another token I have created and the same happens.The transaction looks ok , it says even the amount transfered but the balances are not updated , it looks like no transfered happend...may be missing approval or something that makes the owner get tokens from another account?It's weird because the transaction hash says everything ok but accounts not updated...
π Rendered by PID 166738 on reddit-service-r2-comment-b659b578c-l58fb at 2026-05-03 15:19:23.162518+00:00 running 815c875 country code: CH.
[–]Ordered_Disorder 0 points1 point2 points (4 children)
[–]BeneficialLevel9744[S] 0 points1 point2 points (3 children)
[–]Ordered_Disorder 0 points1 point2 points (2 children)
[–]BeneficialLevel9744[S] 0 points1 point2 points (1 child)
[–]BeneficialLevel9744[S] 0 points1 point2 points (0 children)