Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
5eea131f
Commit
5eea131f
authored
Oct 14, 2016
by
Manuel Araoz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extract simpler version of Token into separate file
parent
d1c57c28
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
10 deletions
+35
-10
Bounty.sol
contracts/Bounty.sol
+7
-6
CrowdsaleToken.sol
contracts/token/CrowdsaleToken.sol
+6
-4
SimpleToken.sol
contracts/token/SimpleToken.sol
+22
-0
No files found.
contracts/Bounty.sol
View file @
5eea131f
pragma solidity ^0.4.0;
import './PullPayment.sol';
import './
examples/Exa
mpleToken.sol';
import './
token/Si
mpleToken.sol';
/*
* Bounty
* This bounty will pay out if you can cause a
Exa
mpleToken's balance
* This bounty will pay out if you can cause a
Si
mpleToken's balance
* to be lower than its totalSupply, which would mean that it doesn't
* have sufficient ether for everyone to withdraw.
*/
...
...
@@ -17,16 +17,17 @@ contract Bounty is PullPayment {
if (claimed) throw;
}
function createTarget() returns(
Exa
mpleToken) {
ExampleToken target = new Exa
mpleToken();
function createTarget() returns(
Si
mpleToken) {
SimpleToken target = new Si
mpleToken();
researchers[target] = msg.sender;
return target;
}
function claim(
Exa
mpleToken target) {
function claim(
Si
mpleToken target) {
address researcher = researchers[target];
if (researcher == 0) throw;
// check ExampleToken contract invariants
// Check SimpleToken contract invariants
// Customize this to the specifics of your contract
if (target.totalSupply() == target.balance) {
throw;
}
...
...
contracts/
examples/Examp
leToken.sol
→
contracts/
token/Crowdsa
leToken.sol
View file @
5eea131f
...
...
@@ -2,15 +2,17 @@ pragma solidity ^0.4.0;
import "../StandardToken.sol";
contract ExampleToken is StandardToken {
/*
* Simple ERC20 Token example, with crowdsale token creation
*/
contract CrowdsaleToken is StandardToken {
string public name = "
Examp
leToken";
string public symbol = "
TOK
";
string public name = "
Crowdsa
leToken";
string public symbol = "
CRW
";
uint public decimals = 18;
// 1 ether = 500 example tokens
uint PRICE = 500;
function () payable {
createTokens(msg.sender);
...
...
contracts/token/SimpleToken.sol
0 → 100644
View file @
5eea131f
pragma solidity ^0.4.0;
import "../StandardToken.sol";
/*
* Very simple ERC20 Token example, where all tokens are pre-assigned
* to the creator. Note they can later distribute these tokens
* as they wish using `transfer` and other `StandardToken` functions.
*/
contract SimpleToken is StandardToken {
string public name = "SimpleToken";
string public symbol = "SIM";
uint public decimals = 18;
uint public INITIAL_SUPPLY = 10000;
function SimpleToken() {
totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment