-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Blacklistable methods * Update FiatTokenV1 implementations * Rename and refactor methods * Update storageSlots test * Update misc test * Update unit tests * Add FiatTokenV2_2 tests * Fix test * Fix ci * Allow unlimited contract size on Ganache * Update contract size check * Change blacklist file and add comment about test file * Fix copyright headers in PR * Update NatSpec docs * Also remove proxy from deprecatedBlacklisted * Update _setBalance
- Loading branch information
1 parent
1ed8f78
commit dd03da9
Showing
35 changed files
with
1,701 additions
and
167 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
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,37 @@ | ||
/** | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* Copyright (c) 2018-2023 CENTRE SECZ | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* | ||
*/ | ||
|
||
/** | ||
* These are addresses used purely for tests. Deployers should | ||
* create a `blacklist.remote.js` file and fill those in with | ||
* correct addresses to blacklist before proceeding with the deploy. | ||
*/ | ||
module.exports = [ | ||
"0x04dba1194ee10112fe6c3207c0687def0e78bacf", | ||
"0x08a8a2436fc920e6c73c3a9e9a00b8d937812ee0", | ||
"0xb6f5ec1a0a9cd1526536d3f0426c429529471f40", | ||
"0xbf4f36efa3ac655a1d86f6c32b648a90271443f4", | ||
"0xf8a9ab377ce63592583767b34602e130e38ebdca", | ||
"0xfc672c73ca5c7234edc82552e4a0c8fc247d32ac", | ||
]; |
94 changes: 94 additions & 0 deletions
94
contracts/test/MockFiatTokenWithEditableBalanceAndBlacklistStates.sol
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,94 @@ | ||
/** | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* Copyright (c) 2018-2023 CENTRE SECZ | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* | ||
*/ | ||
|
||
pragma solidity 0.6.12; | ||
|
||
import { FiatTokenV2_2 } from "../v2/FiatTokenV2_2.sol"; | ||
|
||
// solhint-disable func-name-mixedcase | ||
|
||
/** | ||
* @title MockFiatTokenWithEditableBalanceAndBlacklistStates | ||
* @dev A mock class that allows the internal balanceAndBlacklistStates to be manipulated in tests. | ||
*/ | ||
contract MockFiatTokenWithEditableBalanceAndBlacklistStates is FiatTokenV2_2 { | ||
/** | ||
* @dev Allows the balanceAndBlacklistStates to be manipulated. This | ||
* enables us to properly test the ERC20 functionalities. | ||
*/ | ||
function setBalanceAndBlacklistStates(address _account, uint256 _state) | ||
external | ||
{ | ||
balanceAndBlacklistStates[_account] = _state; | ||
} | ||
|
||
/** | ||
* @dev Allows the balanceAndBlacklistStates to be read as plain values. | ||
*/ | ||
function getBalanceAndBlacklistStates(address _account) | ||
external | ||
view | ||
returns (uint256) | ||
{ | ||
return balanceAndBlacklistStates[_account]; | ||
} | ||
|
||
/** | ||
* @dev Exposes the internal function for unit testing. | ||
*/ | ||
function internal_setBlacklistState(address _account, bool _shouldBlacklist) | ||
external | ||
{ | ||
_setBlacklistState(_account, _shouldBlacklist); | ||
} | ||
|
||
/** | ||
* @dev Exposes the internal function for unit testing. | ||
*/ | ||
function internal_setBalance(address _account, uint256 _balance) external { | ||
_setBalance(_account, _balance); | ||
} | ||
|
||
/** | ||
* @dev Exposes the internal function for unit testing. | ||
*/ | ||
function internal_isBlacklisted(address _account) | ||
external | ||
view | ||
returns (bool) | ||
{ | ||
return _isBlacklisted(_account); | ||
} | ||
|
||
/** | ||
* @dev Exposes the internal function for unit testing. | ||
*/ | ||
function internal_balanceOf(address _account) | ||
external | ||
view | ||
returns (uint256) | ||
{ | ||
return _balanceOf(_account); | ||
} | ||
} |
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,35 @@ | ||
/** | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* Copyright (c) 2018-2023 CENTRE SECZ | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* | ||
*/ | ||
|
||
pragma solidity 0.6.12; | ||
|
||
import { FiatTokenV2_2 } from "../v2/FiatTokenV2_2.sol"; | ||
|
||
/** | ||
* @title UpgradedFiatTokenV2_2 | ||
* @dev ERC20 Token backed by fiat reserves | ||
*/ | ||
contract UpgradedFiatTokenV2_2 is FiatTokenV2_2 { | ||
|
||
} |
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,76 @@ | ||
/** | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* Copyright (c) 2018-2023 CENTRE SECZ | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* | ||
*/ | ||
|
||
pragma solidity 0.6.12; | ||
|
||
import { FiatTokenV2_2 } from "../v2/FiatTokenV2_2.sol"; | ||
|
||
/** | ||
* @title UpgradedFiatTokenV2_2NewFieldsTest | ||
* @dev ERC20 Token backed by fiat reserves | ||
*/ | ||
contract UpgradedFiatTokenV2_2NewFieldsTest is FiatTokenV2_2 { | ||
bool public newBool; | ||
address public newAddress; | ||
uint256 public newUint; | ||
bool internal initializedV2; | ||
|
||
function initialize( | ||
string calldata tokenName, | ||
string calldata tokenSymbol, | ||
string calldata tokenCurrency, | ||
uint8 tokenDecimals, | ||
address newMasterMinter, | ||
address newPauser, | ||
address newBlacklister, | ||
address newOwner, | ||
bool _newBool, | ||
address _newAddress, | ||
uint256 _newUint | ||
) external { | ||
super.initialize( | ||
tokenName, | ||
tokenSymbol, | ||
tokenCurrency, | ||
tokenDecimals, | ||
newMasterMinter, | ||
newPauser, | ||
newBlacklister, | ||
newOwner | ||
); | ||
initV2(_newBool, _newAddress, _newUint); | ||
} | ||
|
||
function initV2( | ||
bool _newBool, | ||
address _newAddress, | ||
uint256 _newUint | ||
) public { | ||
require(!initializedV2, "contract is already initialized"); | ||
newBool = _newBool; | ||
newAddress = _newAddress; | ||
newUint = _newUint; | ||
initializedV2 = true; | ||
} | ||
} |
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
Oops, something went wrong.