Skip to content

Commit

Permalink
Remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bingen committed Jan 23, 2024
1 parent 5f88527 commit ecd35fe
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
18 changes: 8 additions & 10 deletions contracts/src/BoldToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ contract BoldToken is CheckContract, IBoldToken {
address _troveManagerAddress,
address _stabilityPoolAddress,
address _borrowerOperationsAddress
)
public
{
) {
checkContract(_troveManagerAddress);
checkContract(_stabilityPoolAddress);
checkContract(_borrowerOperationsAddress);
Expand Down Expand Up @@ -199,8 +197,8 @@ contract BoldToken is CheckContract, IBoldToken {
}
}

function _buildDomainSeparator(bytes32 typeHash, bytes32 name, bytes32 version) private view returns (bytes32) {
return keccak256(abi.encode(typeHash, name, version, _chainID(), address(this)));
function _buildDomainSeparator(bytes32 _typeHash, bytes32 _name, bytes32 _version) private view returns (bytes32) {
return keccak256(abi.encode(_typeHash, _name, _version, _chainID(), address(this)));
}

// --- Internal operations ---
Expand Down Expand Up @@ -280,23 +278,23 @@ contract BoldToken is CheckContract, IBoldToken {

// --- Optional functions ---

function name() external view override returns (string memory) {
function name() external pure override returns (string memory) {
return _NAME;
}

function symbol() external view override returns (string memory) {
function symbol() external pure override returns (string memory) {
return _SYMBOL;
}

function decimals() external view override returns (uint8) {
function decimals() external pure override returns (uint8) {
return _DECIMALS;
}

function version() external view override returns (string memory) {
function version() external pure override returns (string memory) {
return _VERSION;
}

function permitTypeHash() external view override returns (bytes32) {
function permitTypeHash() external pure override returns (bytes32) {
return _PERMIT_TYPEHASH;
}
}
2 changes: 1 addition & 1 deletion contracts/src/MultiTroveGetter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract MultiTroveGetter {
TroveManager public troveManager; // XXX Troves missing from ITroveManager?
ISortedTroves public sortedTroves;

constructor(TroveManager _troveManager, ISortedTroves _sortedTroves) public {
constructor(TroveManager _troveManager, ISortedTroves _sortedTroves) {
troveManager = _troveManager;
sortedTroves = _sortedTroves;
}
Expand Down
11 changes: 7 additions & 4 deletions contracts/src/OldTestContracts/BoldTokenTester.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ contract BoldTokenTester is BoldToken {
address _troveManagerAddress,
address _stabilityPoolAddress,
address _borrowerOperationsAddress
) public BoldToken(_troveManagerAddress,
_stabilityPoolAddress,
_borrowerOperationsAddress) {}

) BoldToken(
_troveManagerAddress,
_stabilityPoolAddress,
_borrowerOperationsAddress
) {}

function unprotectedMint(address _account, uint256 _amount) external {
// No check on caller here

Expand All @@ -42,6 +44,7 @@ contract BoldTokenTester is BoldToken {

function callInternalApprove(address owner, address spender, uint256 amount) external returns (bool) {
_approve(owner, spender, amount);
return true;
}

function getChainId() external view returns (uint256 chainID) {
Expand Down
11 changes: 7 additions & 4 deletions contracts/src/TestContracts/BoldTokenTester.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ contract BoldTokenTester is BoldToken {
address _troveManagerAddress,
address _stabilityPoolAddress,
address _borrowerOperationsAddress
) public BoldToken(_troveManagerAddress,
_stabilityPoolAddress,
_borrowerOperationsAddress) {}

) BoldToken(
_troveManagerAddress,
_stabilityPoolAddress,
_borrowerOperationsAddress
) {}

function unprotectedMint(address _account, uint256 _amount) external {
// No check on caller here

Expand All @@ -42,6 +44,7 @@ contract BoldTokenTester is BoldToken {

function callInternalApprove(address owner, address spender, uint256 amount) external returns (bool) {
_approve(owner, spender, amount);
return true;
}

function getChainId() external view returns (uint256 chainID) {
Expand Down
4 changes: 2 additions & 2 deletions contracts/src/test/TestContracts/BaseTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ contract BaseTest is Test {
accountsList = tempAccounts;
}

function logContractAddresses() public {
function logContractAddresses() view public {
console.log("ActivePool addr: ", address(activePool));
console.log("BorrowerOps addr: ", address(borrowerOperations));
console.log("CollSurplusPool addr: ", address(collSurplusPool));
Expand All @@ -66,4 +66,4 @@ contract BaseTest is Test {
console.log("TroveManager addr: ", address(troveManager));
console.log("BoldToken addr: ", address(boldToken));
}
}
}

0 comments on commit ecd35fe

Please sign in to comment.