GithubHelp home page GithubHelp logo

golem-contracts's Introduction

CircleCI

Contracts

  • GNT token
  • GNTB for missing parts of ERC20 interface and modified ERC667 implementation
  • GNTDeposit that implements timelocked deposits and deposit burning
  • GNTPaymentChannels for small payments to Concent (R&D)

Requirements

  • nodejs + truffle (for tests)

Compiling and running tests

$ npm install
$ node_modules/.bin/truffle test

golem-contracts's People

Contributors

chfast avatar elfoniok avatar krigpl avatar maaktweluit avatar paulperegud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

golem-contracts's Issues

Add `actual_amount` parameter to `reimburseForNoPayment`

to enable processing of partial payments, we need to add an array parameter _actual_amount to reimburseForNoPayment.

the _actual_amount should always be verified to be smaller than the respective _amount in the promissory note

the total_amount should be the sum of _actual_amount values and that's what should be passed into the _reimburse call

Change files layout

  • Move batchTransfer() to Token contract.
  • Move Token contract to its own file.

Docker Image CircleCi2.0

Right now preparing tests environment takes up much time because, environment is set up from clean ubuntu 16.04 docker image. It would be better to prepare custom docker image for this repo.

Typo or deliberate?

In golem-contracts/contracts/GNTDeposit.sol you used a variable called concent. Is it meant to be consent?

a closure time parameter in the function GNTDeposit.reimburse()

Contract GNTDeposit has only one function to transfer GNTW to a given Ethreum addres, namely it is reimburse(address _owner, address _receiver, uint256 _reimbursement).
Concent need to use it in three cases:

  • to pay Provider for a given subtask (forced accept, additional verification)
  • to cover Concent cost (additional verification)
  • to force overdue payments (forced payment)

The current function reimburse is not sufficient. There should be more information in events. For the forced payments a closure time is mandatory, for the subtask payment and the Concent cost coverage a subtask number is nice to have.

May be there should be three different functions with different parameters, may be it is ok just to add new parameter(s) to the existing reimburse function. Anyway we need at least to have the closure time and we need to distinct force payments from Concent cost coverages and subtask payments.

Implement limits in Golem Deposit Contract

We'd like to introduce flexible limits to the Concent's GNT Depost Contract

  • Add a private variable, maximum_deposits_total, to the contract to limit the maximum cumulative amount of GNTB under Contract's control anytime.
    ** when a call is made to register a new deposit or add to an existing deposit, this value should be consulted and in case the total amount of deposits exceeds this amount, the deposit should be disallowed,
    ** the default value should be null, in which case, the contract has no maximum limit,
    ** there a setter this value, available only to the owner of the contract

  • Secondly, add a private variable, maximum_deposit_amount to the contract to limit the value of a single deposit
    ** when a call is made to register a new deposit or add to an existing deposit, this value should be consulted and in case the deposit would exceed the amount, the deposit should be disallowed,
    ** the default value should be null, in which case, the contract has no limit on a single deposit
    ** there a setter this value, available only to the owner of the contract

  • there should be a call to verify if a requested deposit will be able to be registered

  • Add a daily payout limit for reimbursements made by Concent from the deposit over the period of 24 hours, working in an analogous way as the above two values.

TODO artifacts

Clean this up:

contracts
modernize contract’s language style
replace “always ticking” timelock with “withdrawal delay” mechanism
limit oracle’s power to amounts declared by parties
consider createChannel to be dependent on arguments

and not on hidden variable id; one channel per (owner, receiver) pair
rework GNTW to be ERC223 compliant
and merge channel creation with channel funding in single transaction
reconsider names of some of events
golem node id registration in the deposit
create a script that deploys contracts on Rinkeby
create and deploy a faucet contract
should it do the crowdfunding?
on deposits security
timeout nie jest konieczny bo oracle nie widzi wszystkich spraw
counter-argument: other guys can attempt to reuse those to replay
jezeli “dochody” oracla sa w cold wallet, to nie mozna zarobic hackując oracla
jeżeli poszkodowany nie może zarobić na byciu poszkodowanym, to niema powodu atakować oracla
palenie części tokenów winnego jest lepsze od redystrybucji tych tokenów ponieważ

powoduje to że bycie ofiarą nie jest dochodowe

Check license

We've used GNTW contract code that was implemented on the blockchain. Do we have a right to use this code? What is a license here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.