Skip to content
Permalink
Browse files

Initial commit

  • Loading branch information...
ilanolkies committed Mar 19, 2019
0 parents commit 99b9575c3e5d19da902a62310bfb7b584a984028
Showing with 33 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +3 −0 README.md
  3. +23 −0 contracts/Migrations.sol
  4. +5 −0 migrations/1_initial_migration.js
  5. +1 −0 truffle-config.js
@@ -0,0 +1 @@
/build
@@ -0,0 +1,3 @@
# donate-direct

See the blog post here.
@@ -0,0 +1,23 @@
pragma solidity >=0.4.21 <0.6.0;

contract Migrations {
address public owner;
uint public last_completed_migration;

constructor() public {
owner = msg.sender;
}

modifier restricted() {
if (msg.sender == owner) _;
}

function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}

function upgrade(address new_address) public restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}
@@ -0,0 +1,5 @@
const Migrations = artifacts.require("Migrations");

module.exports = function(deployer) {
deployer.deploy(Migrations);
};
@@ -0,0 +1 @@
module.exports = { };

0 comments on commit 99b9575

Please sign in to comment.
You can’t perform that action at this time.