From d349d20c15605fbe6dd081f8073fa5074568c3b3 Mon Sep 17 00:00:00 2001 From: Jasonford323 <144928638+Jasonford323@users.noreply.github.com> Date: Sat, 7 Oct 2023 12:14:33 -0500 Subject: [PATCH] Revert "Update to solidity 0.4.24" --- contracts/erc20_tutorial.sol | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/contracts/erc20_tutorial.sol b/contracts/erc20_tutorial.sol index 70d8276..b7f7011 100644 --- a/contracts/erc20_tutorial.sol +++ b/contracts/erc20_tutorial.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.4.18; // ---------------------------------------------------------------------------- // '0Fucks' token contract @@ -74,7 +74,7 @@ contract Owned { event OwnershipTransferred(address indexed _from, address indexed _to); - constructor() public { + function Owned() public { owner = msg.sender; } @@ -88,7 +88,7 @@ contract Owned { } function acceptOwnership() public { require(msg.sender == newOwner); - emit OwnershipTransferred(owner, newOwner); + OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } @@ -112,13 +112,13 @@ contract FucksToken is ERC20Interface, Owned, SafeMath { // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ - constructor() public { + function FucksToken() public { symbol = "0FUCKS"; name = "0 Fucks Token"; decimals = 18; _totalSupply = 100000000000000000000000000; balances[0x5A86f0cafD4ef3ba4f0344C138afcC84bd1ED222] = _totalSupply; - emit Transfer(address(0), 0x5A86f0cafD4ef3ba4f0344C138afcC84bd1ED222, _totalSupply); + Transfer(address(0), 0x5A86f0cafD4ef3ba4f0344C138afcC84bd1ED222, _totalSupply); } @@ -146,7 +146,7 @@ contract FucksToken is ERC20Interface, Owned, SafeMath { function transfer(address to, uint tokens) public returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); - emit Transfer(msg.sender, to, tokens); + Transfer(msg.sender, to, tokens); return true; } @@ -161,7 +161,7 @@ contract FucksToken is ERC20Interface, Owned, SafeMath { // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; - emit Approval(msg.sender, spender, tokens); + Approval(msg.sender, spender, tokens); return true; } @@ -179,7 +179,7 @@ contract FucksToken is ERC20Interface, Owned, SafeMath { balances[from] = safeSub(balances[from], tokens); allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens); balances[to] = safeAdd(balances[to], tokens); - emit Transfer(from, to, tokens); + Transfer(from, to, tokens); return true; } @@ -200,7 +200,7 @@ contract FucksToken is ERC20Interface, Owned, SafeMath { // ------------------------------------------------------------------------ function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) { allowed[msg.sender][spender] = tokens; - emit Approval(msg.sender, spender, tokens); + Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data); return true; }