Skip to content

Instantly share code, notes, and snippets.

View kungfurabbit's full-sized avatar

Alexei kungfurabbit

  • SKGames
  • Ukraine
View GitHub Profile
@kungfurabbit
kungfurabbit / README.md
Created May 12, 2021 08:25
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.0+commit.1d4f565a.js&optimize=true&runs=200&gist=

ERC223 token standard.

ERC223 is a modification of ERC20 token standard.

The main goals of developing ERC223 token standard were:

  1. Accidentally lost tokens inside contracts: there are two different ways to transfer ERC20 tokens depending on is the receiver address a contract or a wallet address. You should call transfer to send tokens to a wallet address or call approve on token contract then transferFrom on receiver contract to send tokens to contract. Accidentally call of transfer function to a contract address will cause a loss of tokens inside receiver contract where tokens will never be accessible.
  2. Inability of handling incoming token transactions: ERC20 token transaction is a call of transfer function inside token contract. ERC20 token contract is not notifying receiver that transaction occurs. Also there is no way to handle incoming token transactions on contract and no way to reject any non-supported tokens.
  3. ERC20 token transaction between wallet address and contract is
@kungfurabbit
kungfurabbit / LCN.sol
Created May 11, 2021 15:55
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.26+commit.4563c3fc.js&optimize=false&runs=200&gist=
pragma solidity ^0.4.25;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
**/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}