Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Do not prefix getters
  • Loading branch information
Leo Arias committed Sep 5, 2018
commit 9449572c3ec14ec7cbd679b54cf4e1ff3dd2030c
2 changes: 1 addition & 1 deletion contracts/bounties/BreakInvariantBounty.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ contract BreakInvariantBounty is PullPayment, Ownable {
* @dev Transfers the current balance to the owner and terminates the contract.
*/
function destroy() public onlyOwner {
selfdestruct(getOwner());
selfdestruct(owner());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/drafts/TokenVesting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ contract TokenVesting is Ownable {

revoked_[_token] = true;

_token.safeTransfer(getOwner(), refund);
_token.safeTransfer(owner(), refund);

emit Revoked();
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/lifecycle/Pausable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract Pausable is Ownable {
/**
* @return true if the contract is paused, false otherwise.
*/
function isPaused() public view returns(bool) {
function paused() public view returns(bool) {
return paused_;
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/ownership/CanReclaimToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract CanReclaimToken is Ownable {
*/
function reclaimToken(IERC20 _token) external onlyOwner {
uint256 balance = _token.balanceOf(this);
_token.safeTransfer(getOwner(), balance);
_token.safeTransfer(owner(), balance);
}

}
2 changes: 1 addition & 1 deletion contracts/ownership/Claimable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ contract Claimable is Ownable {
/**
* @return the address of the pending owner.
*/
function getPendingOwner() public view returns(address) {
function pendingOwner() public view returns(address) {
return pendingOwner_;
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/ownership/DelayedClaimable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ contract DelayedClaimable is Claimable {
/**
* @return the start of the claimable period.
*/
function getStart() public view returns(uint256) {
function start() public view returns(uint256) {
return start_;
}

/**
* @return the end of the claimable period.
*/
function getEnd() public view returns(uint256) {
function end() public view returns(uint256) {
return end_;
}

Expand Down
10 changes: 5 additions & 5 deletions contracts/ownership/Heritable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ contract Heritable is Ownable {
}

function setHeir(address _newHeir) public onlyOwner {
require(_newHeir != getOwner());
require(_newHeir != owner());
heartbeat();
emit HeirChanged(getOwner(), _newHeir);
emit HeirChanged(owner(), _newHeir);
heir_ = _newHeir;
}

Expand Down Expand Up @@ -87,7 +87,7 @@ contract Heritable is Ownable {
*/
function proclaimDeath() public onlyHeir {
require(_ownerLives());
emit OwnerProclaimedDead(getOwner(), heir_, timeOfDeath_);
emit OwnerProclaimedDead(owner(), heir_, timeOfDeath_);
// solium-disable-next-line security/no-block-members
timeOfDeath_ = block.timestamp;
}
Expand All @@ -96,7 +96,7 @@ contract Heritable is Ownable {
* @dev Owner can send a heartbeat if they were mistakenly pronounced dead.
*/
function heartbeat() public onlyOwner {
emit OwnerHeartbeated(getOwner());
emit OwnerHeartbeated(owner());
timeOfDeath_ = 0;
}

Expand All @@ -107,7 +107,7 @@ contract Heritable is Ownable {
require(!_ownerLives());
// solium-disable-next-line security/no-block-members
require(block.timestamp >= timeOfDeath_ + heartbeatTimeout_);
emit HeirOwnershipClaimed(getOwner(), heir_);
emit HeirOwnershipClaimed(owner(), heir_);
_transferOwnership(heir_);
timeOfDeath_ = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/ownership/Ownable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ contract Ownable {
/**
* @return the address of the owner.
*/
function getOwner() public view returns(address) {
function owner() public view returns(address) {
return owner_;
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/ownership/Superuser.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ contract Superuser is Ownable, RBAC {
}

modifier onlyOwnerOrSuperuser() {
require(msg.sender == getOwner() || isSuperuser(msg.sender));
require(msg.sender == owner() || isSuperuser(msg.sender));
_;
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/payment/RefundEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ contract RefundEscrow is Ownable, ConditionalEscrow {
/**
* @return the current state of the escrow.
*/
function getState() public view returns(State) {
function state() public view returns(State) {
return state_;
}

/**
* @return the beneficiary of the escrow.
*/
function getBeneficiary() public view returns(address) {
function beneficiary() public view returns(address) {
return beneficiary_;
}

Expand Down
10 changes: 5 additions & 5 deletions contracts/payment/SplitPayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,35 @@ contract SplitPayment {
/**
* @return the total shares of the contract.
*/
function getTotalShares() public view returns(uint256) {
function totalShares() public view returns(uint256) {
return totalShares_;
}

/**
* @return the total amount already released.
*/
function getTotalReleased() public view returns(uint256) {
function totalReleased() public view returns(uint256) {
return totalReleased_;
}

/**
* @return the shares of an account.
*/
function getShares(address _account) public view returns(uint256) {
function shares(address _account) public view returns(uint256) {
return shares_[_account];
}

/**
* @return the amount already released to an account.
*/
function getReleased(address _account) public view returns(uint256) {
function released(address _account) public view returns(uint256) {
return released_[_account];
}

/**
* @return the address of a payee.
*/
function getPayee(uint256 index) public view returns(address) {
function payee(uint256 index) public view returns(address) {
return payees_[index];
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/token/ERC20/ERC20Mintable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract ERC20Mintable is ERC20, Ownable {
}

modifier hasMintPermission() {
require(msg.sender == getOwner());
require(msg.sender == owner());
_;
}

Expand Down
2 changes: 1 addition & 1 deletion test/access/SignatureBouncer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract('Bouncer', function ([_, owner, anyone, bouncerAddress, authorizedUser]

context('management', function () {
it('has a default owner of self', async function () {
(await this.bouncer.getOwner()).should.equal(owner);
(await this.bouncer.owner()).should.equal(owner);
});

it('allows the owner to add a bouncer', async function () {
Expand Down
2 changes: 1 addition & 1 deletion test/crowdsale/MintedCrowdsale.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ contract('MintedCrowdsale', function ([_, investor, wallet, purchaser]) {
});

it('should be token owner', async function () {
(await this.token.getOwner()).should.equal(this.crowdsale.address);
(await this.token.owner()).should.equal(this.crowdsale.address);
});

shouldBehaveLikeMintedCrowdsale([_, investor, wallet, purchaser], rate, value);
Expand Down
6 changes: 3 additions & 3 deletions test/ownership/Claimable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ contract('Claimable', function ([_, owner, newOwner, anyone]) {
});

it('should have an owner', async function () {
(await claimable.getOwner()).should.not.equal(0);
(await claimable.owner()).should.not.equal(0);
});

it('changes pendingOwner after transfer', async function () {
await claimable.transferOwnership(newOwner, { from: owner });
(await claimable.getPendingOwner()).should.equal(newOwner);
(await claimable.pendingOwner()).should.equal(newOwner);
});

it('should prevent to claimOwnership from anyone', async function () {
Expand All @@ -40,7 +40,7 @@ contract('Claimable', function ([_, owner, newOwner, anyone]) {
it('changes allow pending owner to claim ownership', async function () {
await claimable.claimOwnership({ from: newOwner });

(await claimable.getOwner()).should.equal(newOwner);
(await claimable.owner()).should.equal(newOwner);
});
});
});
20 changes: 10 additions & 10 deletions test/ownership/DelayedClaimable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@ contract('DelayedClaimable', function ([_, owner, newOwner]) {
await this.delayedClaimable.transferOwnership(newOwner, { from: owner });
await this.delayedClaimable.setLimits(0, 1000, { from: owner });

(await this.delayedClaimable.getEnd()).should.be.bignumber.equal(1000);
(await this.delayedClaimable.end()).should.be.bignumber.equal(1000);

(await this.delayedClaimable.getStart()).should.be.bignumber.equal(0);
(await this.delayedClaimable.start()).should.be.bignumber.equal(0);
});

it('changes pendingOwner after transfer successful', async function () {
await this.delayedClaimable.transferOwnership(newOwner, { from: owner });
await this.delayedClaimable.setLimits(0, 1000, { from: owner });

(await this.delayedClaimable.getEnd()).should.be.bignumber.equal(1000);
(await this.delayedClaimable.end()).should.be.bignumber.equal(1000);

(await this.delayedClaimable.getStart()).should.be.bignumber.equal(0);
(await this.delayedClaimable.start()).should.be.bignumber.equal(0);

(await this.delayedClaimable.getPendingOwner()).should.equal(newOwner);
(await this.delayedClaimable.pendingOwner()).should.equal(newOwner);
await this.delayedClaimable.claimOwnership({ from: newOwner });
(await this.delayedClaimable.getOwner()).should.equal(newOwner);
(await this.delayedClaimable.owner()).should.equal(newOwner);
});

it('changes pendingOwner after transfer fails', async function () {
await this.delayedClaimable.transferOwnership(newOwner, { from: owner });
await this.delayedClaimable.setLimits(100, 110, { from: owner });

(await this.delayedClaimable.getEnd()).should.be.bignumber.equal(110);
(await this.delayedClaimable.end()).should.be.bignumber.equal(110);

(await this.delayedClaimable.getStart()).should.be.bignumber.equal(100);
(await this.delayedClaimable.start()).should.be.bignumber.equal(100);

(await this.delayedClaimable.getPendingOwner()).should.equal(newOwner);
(await this.delayedClaimable.pendingOwner()).should.equal(newOwner);
await assertRevert(this.delayedClaimable.claimOwnership({ from: newOwner }));
(await this.delayedClaimable.getOwner()).should.not.equal(newOwner);
(await this.delayedClaimable.owner()).should.not.equal(newOwner);
});

it('set end and start invalid values fail', async function () {
Expand Down
6 changes: 3 additions & 3 deletions test/ownership/Ownable.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ require('chai')
function shouldBehaveLikeOwnable (owner, [anyone]) {
describe('as an ownable', function () {
it('should have an owner', async function () {
(await this.ownable.getOwner()).should.equal(owner);
(await this.ownable.owner()).should.equal(owner);
});

it('changes owner after transfer', async function () {
await this.ownable.transferOwnership(anyone, { from: owner });
(await this.ownable.getOwner()).should.equal(anyone);
(await this.ownable.owner()).should.equal(anyone);
});

it('should prevent non-owners from transfering', async function () {
Expand All @@ -27,7 +27,7 @@ function shouldBehaveLikeOwnable (owner, [anyone]) {

it('loses owner after renouncement', async function () {
await this.ownable.renounceOwnership({ from: owner });
(await this.ownable.getOwner()).should.equal(ZERO_ADDRESS);
(await this.ownable.owner()).should.equal(ZERO_ADDRESS);
});

it('should prevent non-owners from renouncement', async function () {
Expand Down
4 changes: 2 additions & 2 deletions test/ownership/Superuser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ contract('Superuser', function ([_, firstOwner, newSuperuser, newOwner, anyone])
'OwnershipTransferred'
);

(await this.superuser.getOwner()).should.equal(newOwner);
(await this.superuser.owner()).should.equal(newOwner);
});

it('should change owner after the owner transfers the ownership', async function () {
Expand All @@ -49,7 +49,7 @@ contract('Superuser', function ([_, firstOwner, newSuperuser, newOwner, anyone])
'OwnershipTransferred'
);

(await this.superuser.getOwner()).should.equal(newOwner);
(await this.superuser.owner()).should.equal(newOwner);
});
});

Expand Down
4 changes: 2 additions & 2 deletions test/payment/RefundEscrow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ contract('RefundEscrow', function ([_, owner, beneficiary, refundee1, refundee2]

context('active state', function () {
it('has beneficiary and state', async function () {
(await this.escrow.getBeneficiary()).should.be.equal(beneficiary);
(await this.escrow.getState()).should.be.bignumber.equal(0);
(await this.escrow.beneficiary()).should.be.equal(beneficiary);
(await this.escrow.state()).should.be.bignumber.equal(0);
});

it('accepts deposits', async function () {
Expand Down
10 changes: 5 additions & 5 deletions test/payment/SplitPayment.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ contract('SplitPayment', function ([_, owner, payee1, payee2, payee3, nonpayee1,
});

it('should have total shares', async function () {
(await this.contract.getTotalShares()).should.be.bignumber.equal(20 + 10 + 70);
(await this.contract.totalShares()).should.be.bignumber.equal(20 + 10 + 70);
});

it('should have payees', async function () {
this.payees.forEach(async (payee, index) => {
(await this.getPayee(index)).should.be.equal(payee);
(await this.contract.getReleased(payee)).should.be.bignumber.equal(0);
(await this.payee(index)).should.be.equal(payee);
(await this.contract.released(payee)).should.be.bignumber.equal(0);
});
});

Expand All @@ -64,11 +64,11 @@ contract('SplitPayment', function ([_, owner, payee1, payee2, payee3, nonpayee1,
});

it('should store shares if address is payee', async function () {
(await this.contract.getShares(payee1)).should.be.bignumber.not.equal(0);
(await this.contract.shares(payee1)).should.be.bignumber.not.equal(0);
});

it('should not store shares if address is not payee', async function () {
(await this.contract.getShares(nonpayee1)).should.be.bignumber.equal(0);
(await this.contract.shares(nonpayee1)).should.be.bignumber.equal(0);
});

it('should throw if no funds to claim', async function () {
Expand Down
10 changes: 5 additions & 5 deletions test/token/ERC20/ERC20Pausable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract('ERC20Pausable', function ([_, owner, recipient, anotherAccount]) {
describe('when the token is unpaused', function () {
it('pauses the token', async function () {
await this.token.pause({ from });
(await this.token.isPaused()).should.equal(true);
(await this.token.paused()).should.equal(true);
});

it('emits a Pause event', async function () {
Expand Down Expand Up @@ -55,7 +55,7 @@ contract('ERC20Pausable', function ([_, owner, recipient, anotherAccount]) {

it('unpauses the token', async function () {
await this.token.unpause({ from });
(await this.token.isPaused()).should.equal(false);
(await this.token.paused()).should.equal(false);
});

it('emits an Unpause event', async function () {
Expand Down Expand Up @@ -87,18 +87,18 @@ contract('ERC20Pausable', function ([_, owner, recipient, anotherAccount]) {

describe('paused', function () {
it('is not paused by default', async function () {
(await this.token.isPaused({ from })).should.equal(false);
(await this.token.paused({ from })).should.equal(false);
});

it('is paused after being paused', async function () {
await this.token.pause({ from });
(await this.token.isPaused({ from })).should.equal(true);
(await this.token.paused({ from })).should.equal(true);
});

it('is not paused after being paused and then unpaused', async function () {
await this.token.pause({ from });
await this.token.unpause({ from });
(await this.token.isPaused()).should.equal(false);
(await this.token.paused()).should.equal(false);
});
});

Expand Down