0

I got this error on line 22, I'm trying to set up a presale contract for a new token.

event transfer.balance[msg.sender] = safeSub(balances[msg.sender], tokens);

 // SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0-solc-0.7/contracts/token/ERC20/ERC20.sol";

    // This is presale for 
    // All partisipants will recieve a 500 Token bonus for participating
    // Max buy participants will recieve 10000 Token bonus
contract Token is ERC20 {

    constructor () ERC20("", "") {
        _mint(msg.sender, 4000000 * (10 ** uint256(decimals())));
}
    address payable public owner;
  
uint256 public max_contribution = 50 ether; 
uint256 public min_contribution = 0.1 ether; 

function transfer(address to, uint tokens) public payable returns (bool success) {
    require(msg.value >= min_contribution);
    require(msg.value <= max_contribution);
    event transfer.balance[msg.sender] = safeSub(balances[msg.sender], tokens);
    balances[to] = safeAdd(balances[to], tokens);
    emit Transfer(msg.sender, to, tokens);
    return true;

    }
}

Any help is appreciated.

2
  • Please add the actual error you got. You only provided us with the code that produces this error
    – Paulus
    Nov 5 at 7:51
  • ParserError: Expected primary expression. event transfer.balance[msg.sender] = safeSub(balances[msg.sender], tokens);
    – matt.m37
    Nov 10 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.