Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
c8c2309
Role tests (#1228)
nventuro Aug 22, 2018
ed04195
Removed RBAC tokens (#1229)
nventuro Aug 22, 2018
5b7ec56
Roles can now be transfered. (#1235)
nventuro Aug 28, 2018
0530e1e
True Ownership (#1247)
nventuro Aug 30, 2018
128c4c0
Improve encapsulation on ERC165
Sep 3, 2018
0d8a5e4
Improve encapsulation on ERC20
Sep 3, 2018
1c365fe
Improve encapsulation on ERC721
Sep 3, 2018
9ebdae6
Add tests, use standard getters
Sep 3, 2018
963a00b
fix tests
Sep 3, 2018
4d8db8d
Fix lint
Sep 3, 2018
dc7b21e
Merge branch 'master' into refactor/1174/private-state-vars-erc
Sep 4, 2018
d8e7c25
MintableToken using Roles (#1236)
nventuro Sep 4, 2018
0b0d6c6
move interface ids to implementation contracts
frangio Sep 4, 2018
68094d1
Do not prefix getters
Sep 5, 2018
2ea79e9
Merge branch 'master' into refactor/1174/private-state-vars-erc
Sep 5, 2018
5fc3742
Improve encapsulation on Pausable
Sep 3, 2018
172b720
add the underscore
Sep 3, 2018
86bbab3
Improve encapsulation on ownership
Sep 3, 2018
faed52d
fix rebase
Sep 3, 2018
21ae177
fix ownership
Sep 3, 2018
917a019
Improve encapsulation on payments
Sep 3, 2018
478d974
Add missing tests
Sep 4, 2018
0fecbac
add missing test
Sep 4, 2018
9449572
Do not prefix getters
Sep 5, 2018
1856f07
Fix tests.
Sep 5, 2018
f61acdc
Improve encapsulation on Crowdsales
Sep 3, 2018
44d113a
add missing tests
Sep 3, 2018
0257670
remove only
Sep 3, 2018
5a476d1
Do not prefix getters
Sep 5, 2018
85a0fc3
Update modifiers to call public view functions.
Sep 5, 2018
c420563
Improve encapsulation on Pausable
Sep 3, 2018
fcd369a
add the underscore
Sep 3, 2018
1eb1340
Improve encapsulation on ownership
Sep 3, 2018
211e2aa
fix rebase
Sep 3, 2018
411058f
fix ownership
Sep 3, 2018
0be5129
Improve encapsulation on payments
Sep 3, 2018
1c1399c
Add missing tests
Sep 4, 2018
cbe4f36
add missing test
Sep 4, 2018
869b364
Do not prefix getters
Sep 5, 2018
526ff31
Fix tests.
Sep 5, 2018
b4d64d4
Improve encapsulation on Crowdsales
Sep 3, 2018
2e2d634
add missing tests
Sep 3, 2018
4be20f7
remove only
Sep 3, 2018
8559477
Do not prefix getters
Sep 5, 2018
edf8ea5
Improve encapsulation on BreakInvariantBounty
Sep 3, 2018
b64cdef
Make researchers private
Sep 3, 2018
148ef64
Do not prefix getters
Sep 5, 2018
4080385
tmp
Sep 5, 2018
24761a5
remove isMinter
Sep 5, 2018
c14d597
fix is owner call
Sep 5, 2018
ba7fa16
fix isOpen
Sep 5, 2018
776d47a
Merge branch 'master' into feature/1179/modifiers-call-functions
Sep 6, 2018
7a37725
Fix merge
Sep 6, 2018
cab8bdb
Merge branch 'master' into refactor/underscores-final-final
Sep 6, 2018
093a9d5
tmp
Sep 6, 2018
52352ce
Improve encapsulation on TimedCrowdsale
Sep 6, 2018
7d10c0e
tmp
Sep 6, 2018
63b93cc
Add missing parentheses
Sep 6, 2018
4403e49
Merge branch 'refactor/1174/private-state-vars-timed-crowdsale' into …
Sep 6, 2018
093bcd3
Use prefix underscore for state variables and no underscore for param…
Sep 6, 2018
a14963b
Improved Roles API. (#1280)
nventuro Sep 6, 2018
4d4a004
Added PauserRole. (#1283)
nventuro Sep 6, 2018
b6bddb2
Merge branch 'master' into refactor/1174/private-state-vars-timed-cro…
frangio Sep 6, 2018
369b8d6
remove duplicate function definition
frangio Sep 6, 2018
b2f350d
Remove Claimable, DelayedClaimable, Heritable (#1274)
frangio Sep 5, 2018
c529524
Merge remote-tracking branch 'upstream/master' into rbac-migration
frangio Sep 6, 2018
145962d
Merge branch 'refactor/1174/private-state-vars-timed-crowdsale' into …
Sep 6, 2018
cb836c3
Merge branch 'master' into refactor/underscores-final-final
Sep 6, 2018
bf4a211
Role behavior tests (#1285)
nventuro Sep 6, 2018
199e156
Migrate Ownable to Roles (#1287)
nventuro Sep 6, 2018
d4dea3c
Remove RBAC, SignatureBouncer refactor (#1289)
nventuro Sep 6, 2018
e9cc437
feat: implement ERC721Mintable and ERC721Burnable (#1276)
shrugs Sep 6, 2018
075334a
Merge branch 'master' into refactor/underscores-final-final
Sep 7, 2018
abd946d
Merge branch 'master' into refactor/underscores-final-final
Sep 7, 2018
436c89f
Merge branch 'master' into rbac-migration
Sep 7, 2018
c81e75d
Fix the merge with the privatization branch
Sep 7, 2018
a49efc0
Merge branch 'master' into refactor/underscores-final-final
Sep 7, 2018
be372f2
Merge branch 'rbac-migration' into refactor/underscores-final-final
Sep 7, 2018
1002c20
fix lint
Sep 7, 2018
58524e3
Remove underscore
Sep 7, 2018
d4a1178
Merge branch 'master' of github.com:OpenZeppelin/openzeppelin-solidit…
frangio Sep 7, 2018
2458d72
Delete CapperRole.test.js
nventuro Sep 7, 2018
58e1050
fix increaseApproval
frangio Sep 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 5 additions & 21 deletions CODE_STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,19 @@ Any exception or additions specific to our project are documented below.

* Try to avoid acronyms and abbreviations.

* Parameters must be prefixed with an underscore.

```
function test(uint256 _testParameter1, uint256 _testParameter2) {
...
}
```

The exception are the parameters of events. There is no chance of ambiguity
with these, so they should not have underscores. Not even if they are
specified on an ERC with underscores; removing them doesn't change the ABI,
so we should be consistent with the rest of the events in this repository
and remove them.

* Internal and private state variables should have an underscore suffix.
* Private state variables should have an underscore prefix.

```
contract TestContract {
uint256 internal internalVar_;
uint256 private privateVar_;
uint256 private _privateVar;
}
```

Variables declared in a function should not follow this rule.
* Parameters must not be prefixed with an underscore.

```
function test() {
uint256 functionVar;
...
function test(uint256 testParameter1, uint256 testParameter2) {
...
}
```

Expand Down
16 changes: 8 additions & 8 deletions contracts/access/roles/CapperRole.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ contract CapperRole {
_;
}

function isCapper(address _account) public view returns (bool) {
return cappers.has(_account);
function isCapper(address account) public view returns (bool) {
return cappers.has(account);
}

function addCapper(address _account) public onlyCapper {
cappers.add(_account);
emit CapperAdded(_account);
function addCapper(address account) public onlyCapper {
cappers.add(account);
emit CapperAdded(account);
}

function renounceCapper() public {
cappers.remove(msg.sender);
}

function _removeCapper(address _account) internal {
cappers.remove(_account);
emit CapperRemoved(_account);
function _removeCapper(address account) internal {
cappers.remove(account);
emit CapperRemoved(account);
}
}
16 changes: 8 additions & 8 deletions contracts/access/roles/MinterRole.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ contract MinterRole {
_;
}

function isMinter(address _account) public view returns (bool) {
return minters.has(_account);
function isMinter(address account) public view returns (bool) {
return minters.has(account);
}

function addMinter(address _account) public onlyMinter {
minters.add(_account);
emit MinterAdded(_account);
function addMinter(address account) public onlyMinter {
minters.add(account);
emit MinterAdded(account);
}

function renounceMinter() public {
minters.remove(msg.sender);
}

function _removeMinter(address _account) internal {
minters.remove(_account);
emit MinterRemoved(_account);
function _removeMinter(address account) internal {
minters.remove(account);
emit MinterRemoved(account);
}
}
16 changes: 8 additions & 8 deletions contracts/access/roles/PauserRole.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ contract PauserRole {
_;
}

function isPauser(address _account) public view returns (bool) {
return pausers.has(_account);
function isPauser(address account) public view returns (bool) {
return pausers.has(account);
}

function addPauser(address _account) public onlyPauser {
pausers.add(_account);
emit PauserAdded(_account);
function addPauser(address account) public onlyPauser {
pausers.add(account);
emit PauserAdded(account);
}

function renouncePauser() public {
pausers.remove(msg.sender);
}

function _removePauser(address _account) internal {
pausers.remove(_account);
emit PauserRemoved(_account);
function _removePauser(address account) internal {
pausers.remove(account);
emit PauserRemoved(account);
}
}
16 changes: 8 additions & 8 deletions contracts/access/roles/SignerRole.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ contract SignerRole {
_;
}

function isSigner(address _account) public view returns (bool) {
return signers.has(_account);
function isSigner(address account) public view returns (bool) {
return signers.has(account);
}

function addSigner(address _account) public onlySigner {
signers.add(_account);
emit SignerAdded(_account);
function addSigner(address account) public onlySigner {
signers.add(account);
emit SignerAdded(account);
}

function renounceSigner() public {
signers.remove(msg.sender);
}

function _removeSigner(address _account) internal {
signers.remove(_account);
emit SignerRemoved(_account);
function _removeSigner(address account) internal {
signers.remove(account);
emit SignerRemoved(account);
}
}
20 changes: 10 additions & 10 deletions contracts/bounties/BreakInvariantBounty.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ import "../ownership/Ownable.sol";
* @dev This bounty will pay out to a researcher if they break invariant logic of the contract.
*/
contract BreakInvariantBounty is PullPayment, Ownable {
bool private claimed_;
mapping(address => address) private researchers;
bool private _claimed;
mapping(address => address) private _researchers;

event TargetCreated(address createdAddress);

/**
* @dev Fallback function allowing the contract to receive funds, if they haven't already been claimed.
*/
function() external payable {
require(!claimed_);
require(!_claimed);
}

/**
* @dev Determine if the bounty was claimed.
* @return true if the bounty was claimed, false otherwise.
*/
function claimed() public view returns(bool) {
return claimed_;
return _claimed;
}

/**
Expand All @@ -37,22 +37,22 @@ contract BreakInvariantBounty is PullPayment, Ownable {
*/
function createTarget() public returns(Target) {
Target target = Target(_deployContract());
researchers[target] = msg.sender;
_researchers[target] = msg.sender;
emit TargetCreated(target);
return target;
}

/**
* @dev Transfers the contract funds to the researcher that proved the contract is broken.
* @param _target contract
* @param target contract
*/
function claim(Target _target) public {
address researcher = researchers[_target];
function claim(Target target) public {
address researcher = _researchers[target];
require(researcher != address(0));
// Check Target contract invariants
require(!_target.checkInvariant());
require(!target.checkInvariant());
_asyncTransfer(researcher, address(this).balance);
claimed_ = true;
_claimed = true;
}

/**
Expand Down
Loading