Skip to content

Commit bd3b691

Browse files
satyamakgecadamdossa
authored andcommitted
cleaning up as per the audit recommendation (#722)
1 parent 66fadc1 commit bd3b691

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

contracts/modules/Checkpoint/Voting/PLCR/PLCRVotingCheckpoint.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ contract PLCRVotingCheckpoint is PLCRVotingCheckpointStorage, VotingCheckpoint {
5353
withPerm(ADMIN)
5454
{
5555
uint256 startTime = now;
56-
uint256 checkpointId = ISecurityToken(securityToken).createCheckpoint();
56+
uint256 checkpointId = securityToken.createCheckpoint();
5757
_createBallotWithCheckpoint(_commitDuration, _revealDuration, _noOfProposals, _quorumPercentage, checkpointId, startTime);
5858
}
5959

@@ -78,7 +78,7 @@ contract PLCRVotingCheckpoint is PLCRVotingCheckpointStorage, VotingCheckpoint {
7878
withPerm(ADMIN)
7979
{
8080
// validate the checkpointId, It should be less than or equal to the current checkpointId of the securityToken
81-
require(_checkpointId <= ISecurityToken(securityToken).currentCheckpointId(), "Invalid checkpoint Id");
81+
require(_checkpointId <= securityToken.currentCheckpointId(), "Invalid checkpoint Id");
8282
_createBallotWithCheckpoint(_commitDuration, _revealDuration, _noOfProposals, _quorumPercentage, _checkpointId, _startTime);
8383
}
8484

@@ -140,7 +140,7 @@ contract PLCRVotingCheckpoint is PLCRVotingCheckpointStorage, VotingCheckpoint {
140140
require(ballot.investorToProposal[msg.sender].secretVote == bytes32(0), "Already voted");
141141
require(ballot.isActive, "Inactive ballot");
142142
// Get the balance of the voter (i.e `msg.sender`) at the checkpoint on which ballot was created.
143-
uint256 weight = ISecurityToken(securityToken).balanceOfAt(msg.sender, ballot.checkpointId);
143+
uint256 weight = securityToken.balanceOfAt(msg.sender, ballot.checkpointId);
144144
require(weight > 0, "Zero weight is not allowed");
145145
// Update the storage value. Assigned `0` as vote option it will be updated when voter reveals its vote.
146146
ballot.investorToProposal[msg.sender] = Vote(0, _secretVote);
@@ -170,7 +170,7 @@ contract PLCRVotingCheckpoint is PLCRVotingCheckpointStorage, VotingCheckpoint {
170170
"Invalid vote"
171171
);
172172
// Get the balance of the voter (i.e `msg.sender`) at the checkpoint on which ballot was created.
173-
uint256 weight = ISecurityToken(securityToken).balanceOfAt(msg.sender, ballot.checkpointId);
173+
uint256 weight = securityToken.balanceOfAt(msg.sender, ballot.checkpointId);
174174
bytes32 secretVote = ballot.investorToProposal[msg.sender].secretVote;
175175
// update the storage values
176176
ballot.proposalToVotes[_choiceOfProposal] = ballot.proposalToVotes[_choiceOfProposal].add(weight);
@@ -283,7 +283,7 @@ contract PLCRVotingCheckpoint is PLCRVotingCheckpointStorage, VotingCheckpoint {
283283
uint256 i = 0;
284284
uint256 counter = 0;
285285
uint256 maxWeight = 0;
286-
uint256 supplyAtCheckpoint = ISecurityToken(securityToken).totalSupplyAt(ballot.checkpointId);
286+
uint256 supplyAtCheckpoint = securityToken.totalSupplyAt(ballot.checkpointId);
287287
uint256 quorumWeight = (supplyAtCheckpoint.mul(ballot.quorum)).div(10 ** 18);
288288
voteWeighting = new uint256[](ballot.totalProposals);
289289
for (i = 0; i < ballot.totalProposals; i++) {
@@ -342,7 +342,7 @@ contract PLCRVotingCheckpoint is PLCRVotingCheckpointStorage, VotingCheckpoint {
342342
Ballot memory ballot = ballots[_ballotId];
343343
return (
344344
ballot.quorum,
345-
ISecurityToken(securityToken).totalSupplyAt(ballot.checkpointId),
345+
securityToken.totalSupplyAt(ballot.checkpointId),
346346
ballot.checkpointId,
347347
ballot.startTime,
348348
(uint256(ballot.startTime).add(uint256(ballot.commitDuration))).add(uint256(ballot.revealDuration)),

contracts/modules/TransferManager/TransferManager.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ contract TransferManager is ITransferManager, Module {
2626
*/
2727
function getTokensByPartition(bytes32 _partition, address _tokenHolder, uint256 /*_additionalBalance*/) external view returns(uint256) {
2828
if (_partition == UNLOCKED)
29-
return ISecurityToken(securityToken).balanceOf(_tokenHolder);
29+
return securityToken.balanceOf(_tokenHolder);
3030
return uint256(0);
3131
}
3232

0 commit comments

Comments
 (0)