Skip to content

Commit 71b0da7

Browse files
Jose Perera MoralesJose Perera Morales
authored andcommitted
Added SampleToken ERC20
1 parent 73cdb08 commit 71b0da7

347 files changed

Lines changed: 236591 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
2 KB
Binary file not shown.

Course_Identity_And_Smart_Contracts/SampleToken/build/contracts/ERC20.json

Lines changed: 11934 additions & 0 deletions
Large diffs are not rendered by default.

Course_Identity_And_Smart_Contracts/SampleToken/build/contracts/ERC20Detailed.json

Lines changed: 1548 additions & 0 deletions
Large diffs are not rendered by default.

Course_Identity_And_Smart_Contracts/SampleToken/build/contracts/IERC20.json

Lines changed: 1865 additions & 0 deletions
Large diffs are not rendered by default.

Course_Identity_And_Smart_Contracts/SampleToken/build/contracts/Migrations.json

Lines changed: 1402 additions & 0 deletions
Large diffs are not rendered by default.

Course_Identity_And_Smart_Contracts/SampleToken/build/contracts/SafeMath.json

Lines changed: 3287 additions & 0 deletions
Large diffs are not rendered by default.

Course_Identity_And_Smart_Contracts/SampleToken/build/contracts/SampleToken.json

Lines changed: 1462 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
pragma solidity >=0.4.21 <0.6.0;
2+
3+
contract Migrations {
4+
address public owner;
5+
uint public last_completed_migration;
6+
7+
constructor() public {
8+
owner = msg.sender;
9+
}
10+
11+
modifier restricted() {
12+
if (msg.sender == owner) _;
13+
}
14+
15+
function setCompleted(uint completed) public restricted {
16+
last_completed_migration = completed;
17+
}
18+
19+
function upgrade(address new_address) public restricted {
20+
Migrations upgraded = Migrations(new_address);
21+
upgraded.setCompleted(last_completed_migration);
22+
}
23+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
pragma solidity >=0.4.24;
2+
3+
import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
4+
import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol";
5+
6+
contract SampleToken is ERC20Detailed, ERC20 {
7+
8+
constructor(string memory _name, string memory _symbol, uint8 _decimals, uint _initialSupply)
9+
ERC20Detailed(_name, _symbol, _decimals) public {
10+
require(_initialSupply > 0, "INITIAL_SUPPLY has to be greater than 0");
11+
_mint(msg.sender, _initialSupply);
12+
}
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var Migrations = artifacts.require("./Migrations.sol");
2+
3+
module.exports = function(deployer) {
4+
deployer.deploy(Migrations);
5+
};

0 commit comments

Comments
 (0)