Coder Social home page Coder Social logo

b9labs-eth20-proj1's People

Contributors

abbbe avatar

Stargazers

 avatar

Watchers

 avatar  avatar

b9labs-eth20-proj1's Issues

Use gasUsed correctly

You are comparing apples and oranges gas and weis. .gasUsed * tx.gasPrice, yes, that gives you weis.

optimize costs

  • add memory/storage keywords to internal function parameters
  • use memory when invoking functions, where possible
  • measure impact of these changes on execution cost
  • use memory for temp vars
  • to avoid internal transaction
  • compiler optimization

Implement withdraw pattern

xavierlepretre 4 hours ago:

Talking to 2 untrusted addresses in 1 tx is an anti-pattern.
Non-only can the other sabotage the whole tx by calling revert(), but more importantly, by handing over the execution, it is possible for the other address to call back on your contract, aka reenter, and possibly do things.
So it is better to find a way to not break the pattern of 1 tx - talk to 1 or fewer untrusted addresses.
How?

use beforeEach() when testing

Actually, you should not use the deployed instance, which is meant for Ropsten, say. Yes, you can check that it was deployed according to your specs, i.e. the migration file is correct. But for the other tests, you should do beforeEach(... Splitter.new and use that instance. Otherwise your its depend on the previous one passing.

Make the contract a splitting utility

Make the contract a utility that can be used by David, Emma and anybody with an address to split Ether between any 2 other addresses of their own choice.

publish

Deployed on rinkeby: 0x8849cddf20779c0bf0e65ef3aab4bee070299d29

Test accounts:

  • TEST 0xe2DBC1817A18d345d051a348ceF998f3c14C2033
  • Alice 0xdFb73a488f8a9A45E9ac2B433E061ee60AB2fEde
  • Bob 0xdDDCd59331363191a2e9788212962A7EA7D9b4e1
  • Carol 0x1028CCbE83dCebb568152f747AEfD4f3fe29b046

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.