Skip to content

Commit

Permalink
upgarde openZeppelin to 4.2.0 (#234)
Browse files Browse the repository at this point in the history
fixes #200

Co-authored-by: Skanda Bhat <[email protected]>
  • Loading branch information
hrishikeshio and SkandaBhat authored Jul 26, 2021
1 parent d867988 commit ee42d4d
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 21 deletions.
7 changes: 1 addition & 6 deletions contracts/Core/ACL.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,4 @@ contract ACL is AccessControl {
constructor() {
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
}

modifier onlyRole(bytes32 _hash) {
require(hasRole(_hash, msg.sender), "ACL: sender not authorized");
_;
}
}
}
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"homepage": "https://github.com/razor-network/contracts#readme",
"dependencies": {
"@openzeppelin/contracts": "^4.0.0",
"@openzeppelin/contracts": "^4.2.0",
"@razor-network/merkle": "^0.6.0",
"hardhat-abi-exporter": "^2.2.1",
"jsonfile": "^6.1.0"
Expand Down
3 changes: 1 addition & 2 deletions test/ACL.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Access Control Test', async () => {
let stakeManager;
let rewardManager;
let initializeContracts;
const expectedRevertMessage = 'ACL: sender not authorized';
const expectedRevertMessage = 'AccessControl';

before(async () => {
({
Expand Down Expand Up @@ -485,7 +485,6 @@ describe('Access Control Test', async () => {
});

it('Default Admin should able to change, New admin should able to grant/revoke', async () => {
const expectedRevertMessage = 'AccessControl: sender must be an admin to grant';
// Old admin should be able to grant admin role to another account
await stakeManager.grantRole(DEFAULT_ADMIN_ROLE_HASH, signers[1].address);

Expand Down
2 changes: 1 addition & 1 deletion test/BlockManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('BlockManager', function () {
voteManager.address,
assetManager.address
);
await assertRevert(tx, 'ACL: sender not authorized');
await assertRevert(tx, 'AccessControl');
});

it('should be able to initialize', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/Parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Parameters contract Tests', async () => {
let signers;
let snapShotId;
let parameters;
const expectedRevertMessage = 'ACL: sender not authorized';
const expectedRevertMessage = 'AccessControl';

// parameters as initiliazed in Parameters contract
const commit = toBigNumber('0');
Expand Down
4 changes: 2 additions & 2 deletions test/StakeManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('StakeManager', function () {
voteManager.address,
parameters.address
);
await assertRevert(tx, 'ACL: sender not authorized');
await assertRevert(tx, 'AccessControl');
});

it('should be able to initialize', async function () {
Expand Down Expand Up @@ -731,7 +731,7 @@ describe('StakeManager', function () {
const balanceContractBefore = await razor.balanceOf(stakeManager.address);
const balanceAdminBefore = await razor.balanceOf(signers[1].address);
const tx = stakeManager.connect(signers[1]).escape(signers[1].address);
await assertRevert(tx, 'VM Exception while processing transaction: reverted with reason string \'ACL: sender not authorized\'');
await assertRevert(tx, 'AccessControl');

const balanceContractAfter = await razor.balanceOf(stakeManager.address);
const balanceAdminAfter = await razor.balanceOf(signers[1].address);
Expand Down
2 changes: 1 addition & 1 deletion test/VoteManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('VoteManager', function () {

it('should not be able to initiliaze VoteManager contract without admin role', async () => {
const tx = voteManager.connect(signers[1]).initialize(stakeManager.address, rewardManager.address, blockManager.address, parameters.address);
await assertRevert(tx, 'ACL: sender not authorized');
await assertRevert(tx, 'AccessControl');
});

it('should be able to initialize', async function () {
Expand Down

0 comments on commit ee42d4d

Please sign in to comment.