Repo for all smart contracts associated with SV Light
Run yarn compile-sv-light
to build all .bin
and .abi
files in _solDist
for all contracts in ./svLight/contracts/
Error handling in solidity is annoying. For this reason most contracts going forward should only use revert
, require
, and assert
for really super important stuff (or where state changes may have already been made and need to be reversed).
Luckily with 0.4.22 we can return strings in revert
s now. (Though tooling needs to be updated as of 2018/4/19). All errors should revert
and not allow the tx to go through.
Most of the time you should check a condition and emit an Error
event with a status code - see ./svLight/contracts/SVCommon.sol
- particularly descriptiveErrors
.
Public methods (excluding the ballot box) use the following conventions:
- getters are prefixed with
get
, and optionally have some extra info afterwards, e.g.getD...
methods are getters for various democracy data, andgetG...
is a getter for some global info. There are some exceptions likeaccountInGoodStanding
. - setters are like getters but prefixed with
set
- there are also "action" methods that do something, they're prefixed with
do
or a letter indicating their scope, e.g.dInit
inits a democracy, anddAddBallot
adds a ballot to a democracy. There are some exceptions where it makes sense, e.g.payForDemocracy
.
See package.json
, but you probably want to be using yarn test
or yarn test-watch
- deploy SVIndexBackend and note the address
- deploy SVIndexPaymentSettings and note address
- (Note: you should have already deployed the admin proxy factory, the ballot box factory, and the ens everything px)
- deploy SVLightIndex with parameters (and note the new Ix's address)
- IxBackend address
- PaymentSettings address
- AdminPxFactory address
- BallotBoxFactory address
- ENSEverythingPx address
- Set new Ix as editor on Backend and PaymentSettings (by calling
setPermissions()
then calldoLockdown()
) - Set new Ix as admin on EnsEverythingPx
- Update an ENS domains you need to.
- Done!
Unless you're also upgrading any component:
- Deploy SvLightIndex with relevant parameters (probs the same as the last Ix)
- Run
doUpgrade()
on the previous Ix from the owner address (it'll do everything else) - Confirm by checking
upgradePtr()
on the old Ix
You'll need to interact with the paymentSettings SC used by the democIndex (this is so settings persist with SVIndexUpgrades).
Problems installing dependencies (2018-06-04)
had some problems installing dependencies of sha3
and scrypt
libs after upgrading yarn
via brew
(because it installed node). resetting nvm
via nvm install 8 && nvm alias default 8
fixed.
- scripts/manage-nodes.sh and associated package.json scripts, modified geth startup wait time