Skip to content

Instantly share code, notes, and snippets.

View swordsoul646's full-sized avatar
💻
Working

Frank.R.Wu swordsoul646

💻
Working
View GitHub Profile
@swordsoul646
swordsoul646 / upgradable_smart_contract.sol
Created July 8, 2019 01:17
ERC-1504 Upgradable Smart Contract
pragma solidity ^0.4.0;
import './SafeMath.sol';
/**
* Here is an example of upgradable contract, consisting of three parts:
* - Data contract keeps the resources (data) and is controlled by the Handler contract;
* - Handler contract (implements Handler interface) defines operations and provides services. This contract can be upgraded;
* - Upgrader contract (optional) deals with the voting mechanism and upgrades the Handler contract. The voters are pre-defined
* by the contract owner.
@swordsoul646
swordsoul646 / upgradable_smart_contract.sol
Last active October 17, 2018 11:49
ERC-54 Upgradable Smart Contract
pragma solidity ^0.4.0;
import './SafeMath.sol';
/**
* Here is an example of upgradable contract, consisting of three parts:
* - Data contract keeps the resources (data) and is controlled by the Handler contract;
* - Handler contract (implements Handler interface) defines operations and provides services. This contract can be upgraded;
* - Upgrader contract (optional) deals with the voting mechanism and upgrades the Handler contract. The voters are pre-defined
* by the contract owner.