1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Does this function makes my contract weak?

Discussion in 'Programming/Internet' started by Ivan, Aug 2, 2020.

  1. Ivan

    Ivan Guest

    Ive just published a contract to etherscan, but notice something that i miss. One of my payable function (deposit()) is not set to be called only from owner. Is it going to make me troubles and should I redeploy?

    I was trying to do a transaction when the constructor is called. It was planned to be only once.

    here is how it looks:

    event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);

    function SimpleCrowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet, address _wallet2) public {
    require(_startTime >= now);
    require(_endTime >= _startTime);
    require(_rate > 0);
    require(_wallet != address(0));
    require(_wallet2!= address(0));

    startTime = _startTime;
    endTime = _endTime;
    rate = _rate;
    wallet = _wallet;
    token = new SimpleToken(TOKEN_SUPPLY);
    wallet= _wallet2;

    token.mint(_wallet2, DEPOSIT_TOKENS);
    deposit();
    }

    function deposit() public payable {
    TokenPurchase(msg.sender, wallet, msg.value, DEPOSIT_TOKENS);
    }

    Login To add answer/comment
     

Share This Page