This repository has been archived by the owner on May 14, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- includes docker, though we recommend running natively for now - helper scripts, specifically scripts/testrpc.sh which is required for running tests
- Loading branch information
Showing
16 changed files
with
8,104 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM node:8 | ||
|
||
RUN mkdir /code | ||
WORKDIR /code | ||
COPY package-lock.json . | ||
COPY package.json . | ||
|
||
RUN apt-get -qq update \ | ||
&& apt-get -qq install netcat \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists /tmp/* /var/tmp/* \ | ||
&& npm install -q | ||
|
||
ENV PATH="/code/node_modules/.bin:${PATH}" | ||
VOLUME ["/code"] | ||
EXPOSE 8545 | ||
CMD ["truffle"] |
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,57 @@ | ||
|
||
default: ; | ||
.DEFAULT_GOAL: default | ||
|
||
run_truffle := docker-compose run --rm truffle | ||
|
||
compile: | ||
$(run_truffle) truffle compile | ||
.PHONY: compile | ||
|
||
test: | ||
$(run_truffle) npm test | ||
.PHONY: test | ||
|
||
test-long: | ||
docker-compose run --rm -e LONG_TESTS=1 truffle npm test | ||
.PHONY: test-long | ||
|
||
coverage: | ||
$(run_truffle) npm run-script coverage | ||
.PHONY: coverage | ||
|
||
codecov: | ||
$(run_truffle) npm run-script codecov | ||
.PHONY: codecov | ||
|
||
migrate: | ||
$(run_truffle) truffle migrate | ||
.PHONY: migrate | ||
|
||
console: | ||
$(run_truffle) npm run-script console | ||
.PHONY: console | ||
|
||
testrpc: | ||
$(run_truffle) npm run-script testrpc | ||
.PHONY: testrpc | ||
|
||
build: | ||
docker-compose build | ||
.PHONY: build | ||
|
||
log: | ||
docker-compose logs | ||
.PHONY: log | ||
|
||
sh: | ||
$(run_truffle) sh | ||
.PHONY: sh | ||
|
||
down: | ||
docker-compose down -v | ||
.PHONY: down | ||
|
||
clean: down | ||
docker-compose down --rmi all | ||
.PHONY: clean |
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,27 @@ | ||
pragma solidity ^0.4.15; | ||
|
||
contract Migrations { | ||
address public owner; | ||
uint public lastCompletedMigration; | ||
|
||
modifier restricted() { | ||
if (msg.sender != owner) { | ||
revert(); | ||
} | ||
|
||
_; | ||
} | ||
|
||
function Migrations() { | ||
owner = msg.sender; | ||
} | ||
|
||
function setCompleted(uint completed) restricted { | ||
lastCompletedMigration = completed; | ||
} | ||
|
||
function upgrade(address new_address) restricted { | ||
Migrations upgraded = Migrations(new_address); | ||
upgraded.setCompleted(lastCompletedMigration); | ||
} | ||
} |
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,19 @@ | ||
version: "3" | ||
|
||
services: | ||
truffle: | ||
image: kikinteractive/truffle | ||
build: | ||
context: . | ||
volumes: | ||
- ./contracts:/code/contracts | ||
- ./coverage:/code/coverage | ||
- ./build:/code/build | ||
- ./migrations:/code/migrations | ||
- ./scripts:/code/scripts | ||
- ./test:/code/test | ||
- ./truffle.js:/code/truffle.js | ||
- ./.babelrc:/code/.babelrc | ||
- ./.solcover.js:/code/.solcover.js | ||
- ./.git:/code/.git | ||
|
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,5 @@ | ||
const Migrations = artifacts.require('./Migrations.sol'); | ||
|
||
module.exports = (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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const SafeMath = artifacts.require('./SafeMath.sol'); | ||
const Ownable = artifacts.require('./Ownable.sol'); | ||
|
||
const KinToken = artifacts.require('./KinToken.sol'); | ||
|
||
module.exports = (deployer) => { | ||
deployer.deploy(SafeMath); | ||
deployer.deploy(Ownable); | ||
|
||
deployer.link(Ownable, KinToken); | ||
deployer.link(SafeMath, KinToken); | ||
|
||
deployer.deploy(KinToken); | ||
}; |
Oops, something went wrong.