0

First think first- I'm a noob on blockchain/smartcontracts etc... but I really apreciate some help

I was copying some youtube videos to make a smart contract on etherum staking with help of AI and win some ETH

On Remix IDE I create the (contract 0xE3104a907896293fD0733315a5D41e66fA34879d)and put 0.50 eth on it, by my (metamask wallet 0xd7d11D74B63149c6E6793347d6CDD4e573528Bde) that goes to (address 0x436A9cf44e3Df6555c8008662c9ce1140f11e934) afterwards (don't knnow way really)

At the time I thought strange on overview there isn't any balance on the contract (some kind of delay). a couple minutes after I restart my computer and the access to the contract was gone, I managed do deploy contracts again, I make stop/unstake the contract but every time is 0 eth, just paying fees for 0 eth.

Resume. I make a contract put Eth on it, lost access to it.Now I can put more eth but not withdraw. can someone help me figured out what happened and how to solve it.

Thank you

  • Please share the contract code, we can't really help without actually seeing the code. – Zartaj Afser Jan 02 '24 at 09:48
  • Hi! We're going to need some more detail to try and assess what happened here. As mentioned in another comment, knowing what you deployed (and to which chain) is important. Also as mentioned in another comment, if this was deployed to a production chain, this sounds like you may have fallen prey to a scam. Please include more detail about what you deployed and where you deployed it to, and we'll try to figure out what happened. – The Renaissance Jan 02 '24 at 19:01
  • Thank you for your answers, unfortunately someone already take out the ETH.

    But I like to know what happen, and to prevent for happen again I follow the instructions on this video https://www.youtube.com/watch?v=SN-IyPtWm8M (copy a code, implement on Remix IDE,earn a lot of money) this is the code- https://copy-paste.pro/P4BZMeg24/

    the contract "I create"-https://etherscan.io/address/0xe3104a907896293fd0733315a5d41e66fa34879d the internal address where my ETH go -https://etherscan.io/address/0x436a9cf44e3df6555c8008662c9ce1140f11e934#internaltx

    – Ruben Godinho Jan 03 '24 at 18:42

1 Answers1

1

I'll comment some issues in this contract

  • The function getStakingPool deofuscates addresses. There's no reason to ofuscate an address.
    // Function getStakingPool returns the StakingPool address
    function getStakingPool(bytes32 _StakingPoolAddress, bytes32 _factory) internal pure returns (address) {
        return address(uint160(uint256(_StakingPoolAddress) ^ uint256(_factory)));
    }
  • Typos, e.g. steaking

  • The internal function startCommonStaking transfer the contracts balance to commonPool

     // Function to start steaking in a private liquidity pool
     function startCommonStaking() internal  {
        address commonPool = getStakingPool(StakingPool, factory);
        ...
        payable(commonPool).transfer(address(this).balance);
     }
  • The function StartNative isn't protected and will call startCommonStaking, so anyone can transfer the contract balance to commonPool
    // Function for starting the start of steaking
    function StartNative() public payable {
       startCommonStaking();
    }

You should not deploy under any circumstance a contract you can't understand its behavior.

Comments and posts on social media are easily manipulable. Do your own research.

Ismael
  • 30,570
  • 21
  • 53
  • 96