Smart-contract templates for com-chain hosted currency
Those are free and open-source Smartcontracts to run an ethereum token based currency and barter system. It was created and by Florian and Dominique on behalf of Monnaie Leman the Leman Lake Local Currency. Then maintained and used as templates for the other currency hosted by Com-Chain (see com-chain.org)
The smartContracts permit to do :
- Payments
- Reverse Payment
- Automatic approval of reverse payment
- Payement on behalf of an other user
Account management includes:
- Account activation/inactivation
- Changing account type
- Setting barter limits
- Sending initial monney
-
If you are planning to use the contract within the Com-Chain framework, you must keep the function signature.
-
Unused function can have their body replaced by a revert() statement.
-
You should choose in the pledge function between two check: one is checking for overflow, the second also check for non-negative pledge.
-
Empower the people: Give people the ability to interact with the Ethereum blockchain easily, without having to run a full node.
-
Make it easy & free: Everyone should be able to create a wallet and send Tokens without additional cost. People are the Priority: People are the most important.
-
If it can be hacked, it will be hacked: Never save, store, or transmit secret info, like passwords or keys. Open source & auditable.
If you can think of any other features or run into bugs, let us know. You can drop a line at it {at} monnaie {-} leman dot org.
You should ensure you have a working pipenv
installed on your
system.
First, clone this source code, and from the root of the project, run:
pipenv install ## only to be run the first time
This will gather python dependency to setup brownie
.
Remember to hop into the python local environment before using brownie
:
pipenv shell ## from root of the project
Run the tests with:
brownie test
You must compile first with:
brownie compile
Then this will provide the list of all signatures
cat build/contracts/cccur.json |
jq '.abi[] | select(.name != null) |
( .name + "(" + ([ .inputs[].type ] | join(",")) + ")" )'
To provide the ethereum selector with the signature, you could:
cat build/contracts/cccur.json |
jq -r '.abi[] | select(.name != null) |
( .name + "(" + ([ .inputs[].type ] | join(",")) + ")" )' |
while read sig; do
echo "$sig:$(selector "$sig")"
done | sort > hashes
This will produce a hashes
file in your current directory that you
can compare for hashes.legacy
, the hashes of the legacy comchain
smartcontract. For instance:
diff -u0 hashes.legacy hashes | grep -v '^@' | tail -n +3