Skip to content

Commit 16d568f

Browse files
committed
permission fixes
1 parent 0138971 commit 16d568f

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

contracts/modules/STO/Capped/CappedSTO.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ contract CappedSTO is CappedSTOStorage, STO, ReentrancyGuard {
133133
* @notice Return the permissions flag that are associated with STO
134134
*/
135135
function getPermissions() public view returns(bytes32[] memory) {
136-
bytes32[] memory allPermissions = new bytes32[](0);
136+
bytes32[] memory allPermissions = new bytes32[](1);
137+
allPermissions[0] = OPERATOR;
137138
return allPermissions;
138139
}
139140

contracts/modules/STO/Capped/CappedSTOStorage.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ pragma solidity ^0.5.0;
55
*/
66
contract CappedSTOStorage {
77

8-
bytes32 constant OPERATOR = "OPERATOR";
98
// Determine whether users can invest on behalf of a beneficiary
109
bool public allowBeneficialInvestments = false;
1110
// How many token units a buyer gets (multiplied by 10^18) per wei / base unit of POLY

contracts/modules/STO/USDTiered/USDTieredSTO.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,9 @@ contract USDTieredSTO is USDTieredSTOStorage, STO {
703703
* @notice Return the permissions flag that are associated with STO
704704
*/
705705
function getPermissions() public view returns(bytes32[] memory allPermissions) {
706+
bytes32[] memory allPermissions = new bytes32[](2);
707+
allPermissions[0] = OPERATOR;
708+
allPermissions[1] = ADMIN;
706709
return allPermissions;
707710
}
708711

contracts/modules/STO/USDTiered/USDTieredSTOStorage.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ pragma solidity ^0.5.0;
66
contract USDTieredSTOStorage {
77

88
bytes32 internal constant INVESTORSKEY = 0xdf3a8dd24acdd05addfc6aeffef7574d2de3f844535ec91e8e0f3e45dba96731; //keccak256(abi.encodePacked("INVESTORS"))
9-
bytes32 constant ADMIN = "ADMIN";
10-
bytes32 constant OPERATOR = "OPERATOR";
119

1210
/////////////
1311
// Storage //

test/b_capped_sto.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ contract("CappedSTO", async (accounts) => {
997997

998998
it("Should get the listed permissions", async () => {
999999
let tx = await I_CappedSTO_Array_POLY[0].getPermissions.call();
1000-
assert.equal(tx.length, 0);
1000+
assert.equal(tx.length, 1);
10011001
});
10021002

10031003
it("Should get the metrics of the STO", async () => {

test/p_usd_tiered_sto.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ contract("USDTieredSTO", async (accounts) => {
390390
_tokensPerTierTotal[stoId].length,
391391
"Incorrect number of tiers"
392392
);
393-
assert.equal((await I_USDTieredSTO_Array[stoId].getPermissions()).length, new BN(0), "Incorrect number of permissions");
393+
assert.equal((await I_USDTieredSTO_Array[stoId].getPermissions()).length, new BN(2), "Incorrect number of permissions");
394394
});
395395

396396
it("Should attach the paid STO factory -- failed because of no tokens", async () => {
@@ -579,7 +579,7 @@ contract("USDTieredSTO", async (accounts) => {
579579
_tokensPerTierTotal[stoId].length,
580580
"Incorrect number of tiers"
581581
);
582-
assert.equal((await I_USDTieredSTO_Array[stoId].getPermissions()).length, new BN(0), "Incorrect number of permissions");
582+
assert.equal((await I_USDTieredSTO_Array[stoId].getPermissions()).length, new BN(2), "Incorrect number of permissions");
583583
});
584584

585585
it("Should successfully attach the third STO module to the security token", async () => {

test/q_usd_tiered_sto_sim.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ contract("USDTieredSTO Sim", async (accounts) => {
362362
_tokensPerTierTotal[stoId].length,
363363
"Incorrect number of tiers"
364364
);
365-
assert.equal((await I_USDTieredSTO_Array[stoId].getPermissions()).length, new BN(0), "Incorrect number of permissions");
365+
assert.equal((await I_USDTieredSTO_Array[stoId].getPermissions()).length, new BN(2), "Incorrect number of permissions");
366366
});
367367

368368
it("Should successfully prepare the STO", async () => {

0 commit comments

Comments
 (0)