-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
90 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.18; | ||
|
||
import "../BoldToken.sol"; | ||
|
||
contract BoldTokenTester is BoldToken { | ||
|
||
bytes32 private immutable _PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; | ||
|
||
constructor( | ||
address _troveManagerAddress, | ||
address _stabilityPoolAddress, | ||
address _borrowerOperationsAddress | ||
) BoldToken( | ||
_troveManagerAddress, | ||
_stabilityPoolAddress, | ||
_borrowerOperationsAddress | ||
) {} | ||
|
||
function unprotectedMint(address _account, uint256 _amount) external { | ||
// No check on caller here | ||
|
||
_mint(_account, _amount); | ||
} | ||
|
||
function unprotectedBurn(address _account, uint _amount) external { | ||
// No check on caller here | ||
|
||
_burn(_account, _amount); | ||
} | ||
|
||
function unprotectedSendToPool(address _sender, address _poolAddress, uint256 _amount) external { | ||
// No check on caller here | ||
|
||
_transfer(_sender, _poolAddress, _amount); | ||
} | ||
|
||
function unprotectedReturnFromPool(address _poolAddress, address _receiver, uint256 _amount ) external { | ||
// No check on caller here | ||
|
||
_transfer(_poolAddress, _receiver, _amount); | ||
} | ||
|
||
function callInternalApprove(address owner, address spender, uint256 amount) external returns (bool) { | ||
_approve(owner, spender, amount); | ||
return true; | ||
} | ||
|
||
function getChainId() external view returns (uint256 chainID) { | ||
//return _chainID(); // it’s private | ||
assembly { | ||
chainID := chainid() | ||
} | ||
} | ||
|
||
function getDigest(address owner, address spender, uint amount, uint nonce, uint deadline) external view returns (bytes32) { | ||
return keccak256(abi.encodePacked( | ||
uint16(0x1901), | ||
domainSeparator(), | ||
keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, amount, nonce, deadline)) | ||
) | ||
); | ||
} | ||
|
||
function recoverAddress(bytes32 digest, uint8 v, bytes32 r, bytes32 s) external pure returns (address) { | ||
return ecrecover(digest, v, r, s); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters