smart-contracts's Introduction
smart-contracts's People
Forkers
heorhiiburlakov alatushkin gorshenev vladimirtsyplyayev fjcalderons zhoudaqing stevengu999 xueliangliang vadim1korniychuksmart-contracts's Issues
AuthentificationManagers too many copy-past
May be it will be better to rewrite it with
struct GrantedAccess {
bool isAdmin;
bool canRead;
}
mapping(address => GrantedAccess) accessRights;
mapping(address => GrantedAccess) accessRightsHistory;
it helps:
1)reduce boilerplate code for "admin" and "reader" (now it's almost copy-pasted) roles and makes it more easily to add new roles
2)Remove iterating over history
3)operations over mapping instead of array in this case lreduce gas consumption
Is XWinBet:executeBet protected from calling with (betId,true)
I dont' clearly see how it must work but it looks like better can place the bet and then say "I'am a winner! Give me TheMoney!"
Copy-Past in AuthenticationManager
See pull request #2
What purpose of IcoPhaseManagement:abandonedIcoBalances?
Look at onlyPayloadSize usage
there is information that sometimes legal call of method can have data.length > sum of args lengths due to padding (transactions from parity multisig wallet for example)
So correct code for onlyPayloadSize should be
modifier onlyPayloadSize(uint size) { assert(msg.data.length >= size + 4); _; }
Also brief look at code shows what you check invariants of all arguments so actually this modifier maybe useless
Boilerplate code in XWinToken
Consider not using allTokenHolders[] in XWinToken and you can remove all related boilerplate
I understand it all appears cause of DividendManager.() payable( See #7) but without all this it will be much better
DividendManager fallback function costs to much (& dos't work)
DividendManager::function () payable
1)costs to much gas (gas limit for fallback function is 2300 )
2)Even without low gas limit it does't work as expected: if token becomes popular - you have to iterate over long array of owner addresses and do manipulation in storage. There is no gas-limit to complete this operation for sure. And this means that not all owners get their dividend record increase
3)Also - rewriting this code cause to remove all this allTokenHolders[] boilerplate code in XWinToken #8
AuthenticationManager is useless in XWinToken
I don't see why do you need all this whistles and blows with AuthenticationManager
In XWinToken You define accountReaderOnly function modifier but never use it.
I'am sure it will be better to completely remove it for now.
Also consider remove Reader access right from AuthenticationManager
Throw keyword is deprecated
From version 0.4.13 the throw keyword is deprecated and will be phased out in the future.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.