Skip to content

Instantly share code, notes, and snippets.

View Dexaran's full-sized avatar

Dexaran Dexaran

View GitHub Profile
pragma solidity ^0.4.0;
contract ERC20Constant {
function totalSupply() constant returns (uint supply);
function balanceOf( address who ) constant returns (uint value);
function allowance(address owner, address spender) constant returns (uint _allowance);
}
contract ERC20Stateful {
function transfer( address to, uint value) returns (bool ok);
function transferFrom( address from, address to, uint value) returns (bool ok);
@Dexaran
Dexaran / token.md
Created March 5, 2017 09:50 — forked from frozeman/token.md
Token proposal

This is outdated: The ERC-20 is here: ethereum/EIPs#20

Token

Methods

totalSupply

@Dexaran
Dexaran / ETC23_tokens.sol
Created March 5, 2017 12:23
ERC23 tokens
pragma solidity ^0.4.9;
contract Owned {
function owned() { owner = msg.sender; }
address owner;
modifier onlyOwner {
if (msg.sender != owner)
throw;
_;
}
@Dexaran
Dexaran / standardaccount.sol
Created April 26, 2017 09:51 — forked from axic/standardaccount.sol
EIP101 Standard Account code in Solidity
//
// Implementation of the standard account contract as per EIP101 (Cryptocurrency
// abstraction). See: https://github.com/ethereum/EIPs/issues/28
//
// Written by Alex Beregszaszi, use under the MIT license.
//
contract StandardAccount {
uint256 nextSequence = 1;
0x222E674FB1a7910cCF228f8aECF760508426b482
@Dexaran
Dexaran / Rinkeby
Last active August 10, 2023 20:27
Rinkeby GitHub Authenticated Faucet
0x1b7947d0c06fef4f135cdd61bbadf97933e6b92e
@Dexaran
Dexaran / Rinkeby
Created May 26, 2017 07:50
Rinkeby GitHub Authenticated Faucet
0x222E674FB1a7910cCF228f8aECF760508426b482
@Dexaran
Dexaran / Report.md
Last active August 3, 2017 22:48
CORION audit report

CORION platform audit report

Summary

This is the report from a security audit performed on CORION platform by Dexaran. The audit focused primarily on the fault tolerance of the system. I can conclude that smart-contracts were not in the final state at the time of the audit start, and the changes were applied during the audit process, which made it more time consuming.

The whole system is modular. Contracts are upgradeable. The debug mode allows to intervene into contracts workflow to fix any error during the contracts workflow.

Findings

Problem that is solved by this project:

  • Prevents the burning of funds. Even unrevealed bids will not be completely lost now.

  • This also incentivises users to stay tuned with ECNS. You can just pick up 5% of the Deed value if someone has left his bid unrevealed.

  • Security improvements. ENS relies on block.timestamp, which is a potential security issue, since a miner can artificially affect the timestamp of a mined block. ECNS will rely on block number because the block number can not be directly affected by miners.

@Dexaran
Dexaran / ERC20_token_standard_vulnerability_classification.md
Last active October 8, 2023 13:34
ERC20 token standard vulnerability classification.

Previously described at: ERC20 critical problems medium article.

Description.

ERC20 is the most common Ethereum token standard. It should be noted that it is also the first Ethereum's token standard as well.

It is also important that the original ERC20 proposal is a definition of token interface. EIP20 does not define a reference implementation for this token standard. Here is OpenZeppelin implementation of ERC20 token: https://github.com/OpenZeppelin/zeppelin-solidity/tree/master/contracts/token/ERC20

ERC20 token standard implementation assumes two ways of token transferring: (1) transfer function and (2) approve + transferFrom pattern.