hq20 / contracts Goto Github PK
View Code? Open in Web Editor NEWA set of reusable smart-contracts
Home Page: https://hq20-contracts.netlify.com/
License: Apache License 2.0
A set of reusable smart-contracts
Home Page: https://hq20-contracts.netlify.com/
License: Apache License 2.0
I think this would be a use case, more than an example or reusable code:
https://hackernoon.com/how-to-represent-physical-assets-on-a-blockchain-with-erc20-fu1yo3vkz
A use case I guess?
https://www.techhq.io/8594/blockchain-development-tokenize-digital-assets/
Describe the solution you'd like
In StateMachine, the states (SETUP_STATE, currentState, transitions, and states) are all bytes32. Would it be cheaper to use an enum?
Let's use our tool to simplify and clean it a bit https://github.com/HQ20/girino
Consider how a voting library could be built for DAO.sol.
The idea is that there are several actions that can be voted. The actions are known at coding time (for example, investing in a new venture, distributing dividends and raising funds).
Voting is the same for all actions. There is a staking token and each token is one vote. Each token cannot be used for more than one voting simultaneously.
I would like the logic to be reused between voting actions, only changing the resulting action if the vote is successful.
We might have to mess with function signatures and things like that, no idea really.
This should be one of the conditions to get out of drafts :(
Describe the solution you'd like
We currently do not have security checks. I think securify v2 might be interesting.
Get it out of drafts and increase test coverage until tests pass.
This could be something like an ERC20 factory, where the ERC20s created get the RBAC.sol contract and user defined roles for minters and recipients.
It might need a bit of a frontend to make sense.
The withdraw
functions needs to be limited, and require messages should be as for IssuanceEth.sol.
OpenZeppelin has Escrow contracts, but I see no examples. I like examples. Maybe even a simple use case.
Try to use the same terms in issuance.sol.
After bringing the contract to this repo, obviously.
Only add, sub, mul and div.
Use base64 format from ABDK and SafeMath from OpenZeppelin
I think the main README.md folder scheme needs to be updated according to the changelog.
There is an issue with the current formula for token issuance, which is
amount(issuanceToken) = amount(currencyToken)/issuePrice
because you cannot set a subunitary issuePrice. It should be:
amount(issuanceToken) = amount(currencyToken).fixedDiv(issuePrice, 10**18)
or something similar using fixed point math. See ABDK or Fixidity.
Is there a reason we can't just use ERC20Detailed?
Such as the following folders
contracts/drafts/
contracts/examples/
contracts/test/
contracts/Migrations.sol
The latest evolution of ERC165, in that it includes a global registry of contracts and the interfaces they implement. A bit mind-bending. Obviously needs an example.
,/home/alberto/Code/hq20-contracts/contracts/drafts/classifieds/ClassifiedsAdvanced.sol:35:9: Warning: Unused function parameter. Remove or comment out the variable name to silence this warning.
address operator,
^--------------^
Thus yarn start:geth:local
and yarn start:ganache:local
don'twork.
Start by using a fixed price buy/sell market as for AB. Please write it from scratch instead of reusing their contract and name everything as for a craigslist classifieds board.
The mechanics are:
Instead of creating tokens in Issuance.sol, let's have two token contracts feed to the constructor, one for currency and one for issuance.
We need to be careful to restrict minting to the right address.
This contract will always be inherited from.
Could you please write a paragraph to add to the README.md? Just as a welcome message, describing what contracts repository is.
something like this https://github.com/airbnb/streamalert
or https://github.com/kamranahmedse/developer-roadmap
or https://github.com/puppeteer/puppeteer
or maybe the top 3 here https://github.com/uber
I think you get the idea. Just one paragraph. The everything else is one me ๐
Let's use this:
currencyToken
: The token that is accepted in payment for investments.
issuanceToken
: The token that will be issued if conditions are met.
I think this is the earliest try for a security token. There are more recent ones. It would be nice to show we know how to implement things with them.
How does it work? Is there a simpler version? How to implement for a specific use case?
https://github.com/TheDAO/DAO-1.0
Be aware that the repo linked still has the infamous DAO reentrancy bug.
This is a method for the owner to retrieve the currency stored in the issuance contract. Please come up with a suitable name.
It should be possible only on "LIVE" state.
Please merge #26 first and make this issue a PR of its own.
It's mature enough ๐ฆ
access
and lists
contain some mocks, which will make it into the package.
Increase coverage so that it can get out of drafts
into token
.
Either comment out the gas tests for LinkedList and friends, or move them somewhere where they don't run with yarn test
.
Rename Classifieds.sol as ClassifiedsAdvanced.sol.
Rename ClassifiedsV2.sol as Classifieds.sol and get it out of drafts.
Increase test coverage of the Classifieds.sol outside drafts until tests pass (90%?)
Follow the example from uniswap.
When opening the soldoc page there is no link to go to the repo. When opening the repo in github there is no link to go to the soldoc page.
Branch new/whitelist
This is a stripped down version of RBAC.sol, with just one Role.
An Ownable contract that keeps a mapping of address => bool
Methods:
isMember: returns mapping(address)
addMember: sets mapping(address) = true
removeMember: delete mapping(address)
There is no listing of members, that will be done in a separate issue and contract.
ERC777 is supposed to supersede ERC20. OpenZeppelin has an implementation. I would like to have an example of how to use it.
As we will be releasing the first beta version in two days, we must test it with an external project before doing it.
https://github.com/HQ20/contracts/milestone/2
Who can I assign it to?
Inside contracts/examples
Dividend distribution - Is this a reusable contract or an example pattern? Maybe implement inheriting from ERC20?
https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
Take the comments here and make sure we account for them.
From https://github.com/albertocuestacanada/MyUniswap
Let's just add tests to the code and add it to the repo. Maybe later we will simplify it.
Uniswap thought really out of the box with a very simple DEX. CementDAO was similar, but Uniswap is much simpler. I would use this for any solution requiring a DEX.
Our tests are getting longer to run as the package grows. Would it be a good idea to parallelize them?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.