1

Many projects on BSC seems to have pretty much forked SafeMoon with this being a popular one.

For some reason - I see this particular contract storing BNB in the contract address itself. Is there a way to withdraw the BNB in there somehow with the current code layout without adding anything else in? (I don't see a withdraw function, but does seem like there are a few transfer functions).

https://bscscan.com/address/0x75856ea207ce7194e4e65c334bec143d77701e4a#code

For example ^ this one seems to have 32BNB in there.

2 Answers 2

1

In Solidity there are 3 ways to transfer Ether from the smart contract to an other address.

  1. address.transfer()

2.address.send()

3.address.call.value().gas()()

(4). Calling a payable function of another contract

So, you have to look for 1 of these 4 options in the smart contract code to see if the BNB is withdrawable.

In the swapETHForTokens function Ether can be sent to another address

In the addLiquidity function Ether can be sent to another address

In the transferToAddressETH function Ether can be sent to another address

So, whenever one of these 3 functions is called Ether can be sent away. Seems like it is not possible for anyone to withdraw Ether manually. =-]

0

Adding one more - but you should not - only in case of emergency.

There is the selfdestruct function that - „kills“ - a smart contract and transfers any remaining funds to an address

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.