-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
10,449 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
const Migrations = artifacts.require('Migrations'); | ||
|
||
module.exports = function deployer() { | ||
module.exports = function deployer(deployer) { | ||
deployer.deploy(Migrations); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
const Tether = artifacts.require('Tether'); | ||
const RWD = artifacts.require('RWD'); | ||
const DecentralBank = artifacts.require('DecentralBank'); | ||
|
||
|
||
module.exports =async function deployer(deployer) { | ||
//Deploye Mock Tether Contract | ||
await deployer.deploy(Tether); | ||
//Deploye RWD Contract | ||
await deployer.deploy(RWD); | ||
//Deploye Decentral Bank Contract | ||
await deployer.deploy(DecentralBank); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pragma solidity ^0.5.0; | ||
|
||
contract DecentralBank { | ||
string public name = 'Decentral Bank'; | ||
address public owner; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
pragma solidity ^0.5.0; | ||
|
||
contract RWD { | ||
string public name = 'Reward Token'; | ||
string public symbol = 'RWD'; | ||
uint256 totalSupply = 100000000000000000000000000000; // 1 million token | ||
uint8 public decimals = 18; | ||
|
||
|
||
event Transfer(address indexed _from, address indexed _to,uint _value); | ||
|
||
event Approval(address indexed _owner, address indexed _spender,uint _value); | ||
|
||
mapping(address => uint) public balanceOf; | ||
mapping(address => mapping(address => uint)) public allowance; | ||
|
||
constructor() public{ | ||
balanceOf[msg.sender] = totalSupply; | ||
} | ||
|
||
function transfer(address _to,uint _value) public returns (bool success){ | ||
//require that value greater or equal for transfer | ||
require(balanceOf[msg.sender]>=_value); | ||
|
||
//subtract balance and transfer | ||
balanceOf[msg.sender] -= _value; | ||
//add balance | ||
balanceOf[_to] += _value; | ||
emit Transfer(msg.sender, _to, _value); | ||
return true; | ||
} | ||
|
||
function approve (address _spender,uint256 _value) public returns (bool success){ | ||
allowance[msg.sender][_spender] = _value; | ||
emit Approval(msg.sender,_spender,_value); | ||
return true; | ||
} | ||
|
||
function TransferFrom(address _from,address _to,uint256 _value) public returns (bool success){ | ||
require(_value <=balanceOf[_from]); | ||
require(_value <=allowance[_from][msg.sender]); | ||
|
||
balanceOf[_to] -= _value; | ||
//add balance | ||
balanceOf[_from] += _value; | ||
allowance[msg.sender][_from] -=_value; | ||
emit Transfer(_from, _to, _value); | ||
return true; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.