Skip to content

Commit

Permalink
ci(workflow): standardize using kleros-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
0xferit committed Sep 12, 2018
1 parent 2aa83a8 commit 7abb4d6
Show file tree
Hide file tree
Showing 34 changed files with 9,122 additions and 2,567 deletions.
30 changes: 9 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
sudo: required
language: node_js
node_js:
- "8"
- "v9.4.0"
cache:
directories:
- node_modules
env:
-
- SOLIDITY_COVERAGE=true
- SOLC_NIGHTLY=true
matrix:
fast_finish: true
allow_failures:
- env: SOLIDITY_COVERAGE=true
- env: SOLC_NIGHTLY=true
before_script:
- truffle version
yarn: true
install: yarn install --pure-lockfile
script:
- npm test
#notifications:
# slack:
# rooms:
# - secure: uEhwUkuwJp5pBNh+VTEytPHz3FDKsnPrKO+8MTAKv5hKi4PCRoVhLv6pklr82HUpL6pvSvJbUPA0HVebOXA+MMSxdny/BHZTh2mtw5Y78l2Ad0svDTWuV2Lus2pmhYigRhT0Wo00/SRX9+pxm0kg4EIFJSTS+uR9G76x0l9NljpEGXrqxlDxjxoHBgk8Ciru2LHaLzX/utE3jlABts4Sb1F3wc2BwFkjd6BDCRTGAPhVJwwFk41ZfnmLVbgSNUyk46Cb38oG5oXHb0FI3d3jV/k1OUhRyFfmA2fLXRk0wavibW8TG1gGJJWZ7xTCKzw/Cvup6mpehSAeQef8eekMdjpWEhF9hYRq1BvOs0384UU8NQ0O+BtdXU+X3Nyr84TMJN/iIfgN7gYX7AsvXH3jC0JfNUcIkWlJvyXdE6l2GV1hMmhL09GFEBbSpuSXRIWlOXTcYBlp5NbvE8xO8PUW+T6N5RG2XXjv1g8wCpr6Wwk1+LmRkX5trv8MFBZ2pM8p4H5da5++Ov8egLonNGK2jbx6aBLBX3tPf+g70LZEkiQ4eBfZw8VIgXIvKreisicppNuCD27gNmSEPNt0NkwiEBcTCJ9GSVAO0CU2g4ggvHDX2A+RW5XPET9bGkBXKLfFyV7Qe+MSQjXkCnW3bIRh7Wo1V31XiUiYOLuZPIiH3EQ=
# on_success: change
# on_failure: always
# on_pull_requests: false
- yarn run lint
- yarn test
- yarn run build
notifications:
kleros:
slack: 'kleros:Ub8n81EgKJ3iRrMDyWyQIVJp'
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
# Kleros Interaction Smart Contracts

<p align="center">
<b style="font-size: 32px;">Kleros</b>
</p>

<p align="center">
<a href="https://standardjs.com"><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg" alt="JavaScript Style Guide"></a>
<a href="https://travis-ci.org/kleros/kleros-interaction"><img src="https://travis-ci.org/kleros/kleros-interaction.svg?branch=master" alt="Build Status"></a>
<a href="https://david-dm.org/kleros/kleros-interaction"><img src="https://david-dm.org/kleros/kleros-interaction.svg" alt="Dependencies"></a>
<a href="https://david-dm.org/kleros/kleros-interaction?type=dev"><img src="https://david-dm.org/kleros/kleros-interaction/dev-status.svg" alt="Dev Dependencies"></a>
<a href="https://github.com/trufflesuite/truffle"><img src="https://img.shields.io/badge/tested%20with-truffle-red.svg" alt="Tested with Truffle"></a>
<a href="https://conventionalcommits.org"><img src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg" alt="Conventional Commits"></a>
<a href="http://commitizen.github.io/cz-cli/"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" alt="Commitizen Friendly"></a>
<a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" alt="Styled with Prettier"></a>
<a href="https://gitter.im/kleros/kleros-interaction?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://badges.gitter.im/kleros/kleros-interaction.svg" alt="Chat on Gitter"></a>
</p>

Smart contracts able to interact with Kleros and standard proposals.

[![Join the chat at https://gitter.im/kleros/kleros](https://badges.gitter.im/kleros/kleros.svg)](https://gitter.im/kleros/kleros?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

## Getting Started

Expand All @@ -21,6 +36,19 @@ Run tests
truffle test
```

## Other Scripts

- `yarn run prettify` - Apply prettier to the entire project.
- `yarn run lint:sol` - Lint the entire project's .sol files.
- `yarn run lint:js` - Lint the entire project's .js files.
- `yarn run lint:sol --fix` - Fix fixable linting errors in .sol files.
- `yarn run lint:js --fix` - Fix fixable linting errors in .js files.
- `yarn run lint` - Lint the entire project's .sol and .js files.
- `yarn test` - Run the truffle tests.
- `yarn run cz` - Run commitizen.
- `yarn run build` - Compile contracts.


## Troubleshooting
> Could not connect to your Ethereum client. Please check that your Ethereum client:
- is running
Expand Down
30 changes: 15 additions & 15 deletions contracts/Migrations.sol
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
pragma solidity ^0.4.4;

contract Migrations {
address public owner;
uint public last_completed_migration;
address public owner;
uint public last_completed_migration;

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

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

function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
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);
}
function upgrade(address new_address) public restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}
Loading

0 comments on commit 7abb4d6

Please sign in to comment.