Skip to content

Commit

Permalink
Merge pull request #30 from The-Poolz/prettier
Browse files Browse the repository at this point in the history
Prettier
  • Loading branch information
YouStillAlive authored Nov 8, 2022
2 parents c1959bf + e4dc526 commit 24dd7e5
Show file tree
Hide file tree
Showing 67 changed files with 2,365 additions and 2,203 deletions.
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build
coverage
README.md
coverage.json
package-lock.json
.vscode-test/
out/
dist/
test-fixtures/
node_modules/
28 changes: 28 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false,
"explicitTypes": "always"
}
},
{
"files": "*.js",
"options": {
"printWidth": 120,
"useTabs": false,
"tabWidth": 4,
"semi": false,
"singleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"bracketSameLine": true
}
}
]
}
4 changes: 2 additions & 2 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
client: require("ganache-cli") // Will load the outermost ganache-cli in node_modules
};
client: require("ganache-cli") // Will load the outermost ganache-cli in node_modules
}
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ os: linux
dist: focal
language: node_js
node_js: "16.16.0"
install: npm i && npm i -g truffle
install: npm i && npm i -g truffle@5.5.22
script:
- bash ./bin/build.sh
- truffle run coverage --network development
after_script: bash <(curl -s https://codecov.io/bash)
after_script: bash <(curl -s https://codecov.io/bash)
4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ignore:
- "contracts/Uniswap-V2-Core"
- "contracts/Benefit"
- "contracts/Uniswap-V2-Core"
- "contracts/Benefit"
30 changes: 15 additions & 15 deletions contracts/Benefit/Benefit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ contract Benefit is IPOZBenefit, Ownable {
MinHold = _MinHold;
}

function AddNewLpCheck(address _Token, address _LpContract)
public
onlyOwner
{
function AddNewLpCheck(
address _Token,
address _LpContract
) public onlyOwner {
CheckList[ChecksCount] = BalanceCheckData(false, _Token, _LpContract);
ChecksCount++;
}
Expand Down Expand Up @@ -63,23 +63,23 @@ contract Benefit is IPOZBenefit, Ownable {
ChecksCount = 0;
}

function CheckBalance(address _Token, address _Subject)
internal
view
returns (uint256)
{
function CheckBalance(
address _Token,
address _Subject
) internal view returns (uint256) {
return ERC20(_Token).balanceOf(_Subject);
}

function CheckStaking(address _Contract, address _Subject)
internal
view
returns (uint256)
{
function CheckStaking(
address _Contract,
address _Subject
) internal view returns (uint256) {
return IStaking(_Contract).stakeOf(_Subject);
}

function IsPOZHolder(address _Subject) override external view returns (bool) {
function IsPOZHolder(
address _Subject
) external view override returns (bool) {
return CalcTotal(_Subject) >= MinHold;
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/Benefit/IPozBenefit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.6.0;

//True POZ Token will have this,
//True POZ Token will have this,
interface IPOZBenefit {
function IsPOZHolder(address _Subject) external view returns(bool);
function IsPOZHolder(address _Subject) external view returns (bool);
}
2 changes: 1 addition & 1 deletion contracts/Benefit/IStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
pragma solidity ^0.6.0;

interface IStaking {
function stakeOf(address account) external view returns (uint256) ;
function stakeOf(address account) external view returns (uint256);
}
2 changes: 1 addition & 1 deletion contracts/Benefit/Token.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

import "poolz-helper/contracts/Token.sol";
import "poolz-helper/contracts/Token.sol";
4 changes: 3 additions & 1 deletion contracts/DelayVault/DelayVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ contract DelayVault is VaultData, ERC20Helper {
emit NewVaultCreated(_token, _amount, _lockTime, msg.sender);
}

function Withdraw(address _token)
function Withdraw(
address _token
)
public
whenNotPaused
notZeroAddress(LockedDealAddress)
Expand Down
28 changes: 12 additions & 16 deletions contracts/DelayVault/VaultManageable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,35 +42,31 @@ contract VaultManageable is Pausable, GovManager {
_;
}

function setLockedDealAddress(address _lockedDealAddress)
function setLockedDealAddress(
address _lockedDealAddress
)
public
onlyOwnerOrGov
uniqueAddress(_lockedDealAddress, LockedDealAddress)
{
LockedDealAddress = _lockedDealAddress;
}

function setWhiteListAddress(address _whiteListAddr)
public
onlyOwnerOrGov
uniqueAddress(_whiteListAddr, WhiteListAddress)
{
function setWhiteListAddress(
address _whiteListAddr
) public onlyOwnerOrGov uniqueAddress(_whiteListAddr, WhiteListAddress) {
WhiteListAddress = _whiteListAddr;
}

function setWhiteListId(uint256 _id)
public
onlyOwnerOrGov
uniqueValue(_id, WhiteListId)
{
function setWhiteListId(
uint256 _id
) public onlyOwnerOrGov uniqueValue(_id, WhiteListId) {
WhiteListId = _id;
}

function isTokenWhiteListed(address _tokenAddress)
public
view
returns (bool)
{
function isTokenWhiteListed(
address _tokenAddress
) public view returns (bool) {
return
WhiteListAddress == address(0) ||
WhiteListId == 0 ||
Expand Down
44 changes: 31 additions & 13 deletions contracts/EnvelopToken/Manageable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "poolz-helper/contracts/GovManager.sol";
import "poolz-helper/contracts/IWhiteList.sol";

contract Manageable is ERC20Helper, GovManager{

event LockingDetails(address TokenAddress, uint256 Amount, uint8 TotalUnlocks, uint256 FinishTime);
contract Manageable is ERC20Helper, GovManager {
event LockingDetails(
address TokenAddress,
uint256 Amount,
uint8 TotalUnlocks,
uint256 FinishTime
);

address public OriginalTokenAddress;
address public LockedDealAddress;
Expand All @@ -21,16 +25,19 @@ contract Manageable is ERC20Helper, GovManager{

struct lockDetails {
uint64 unlockTime;
uint ratio;
uint256 ratio;
}

mapping(uint8 => lockDetails) public LockDetails;

uint8 public totalUnlocks;
uint public totalOfRatios;
uint256 public totalOfRatios;

modifier tokenReady(bool status) {
require(status ? totalUnlocks != 0 : totalUnlocks == 0, "Unlock Data status error");
require(
status ? totalUnlocks != 0 : totalUnlocks == 0,
"Unlock Data status error"
);
_;
}

Expand All @@ -41,11 +48,17 @@ contract Manageable is ERC20Helper, GovManager{
uint8[] memory _ratios,
uint256 _finishTime
) internal tokenReady(false) {
require(_unlockTimes.length == _ratios.length, "Both arrays should have same length.");
require(_unlockTimes.length > 0, "Array length should be greater than 0");
require(
_unlockTimes.length == _ratios.length,
"Both arrays should have same length."
);
require(
_unlockTimes.length > 0,
"Array length should be greater than 0"
);
OriginalTokenAddress = _tokenAddress;
TransferInToken(_tokenAddress, msg.sender, _amount);
for(uint8 i=0; i<_unlockTimes.length ; i++){
for (uint8 i = 0; i < _unlockTimes.length; i++) {
LockDetails[i] = lockDetails(_unlockTimes[i], _ratios[i]);
totalOfRatios = SafeMath.add(totalOfRatios, _ratios[i]);
}
Expand All @@ -58,15 +71,20 @@ contract Manageable is ERC20Helper, GovManager{
LockedDealAddress = lockedDeal;
}

function _SetupWhitelist(address _whitelistAddress, uint256 _whitelistId) internal onlyOwnerOrGov {
function _SetupWhitelist(
address _whitelistAddress,
uint256 _whitelistId
) internal onlyOwnerOrGov {
WhitelistAddress = _whitelistAddress;
WhitelistId = _whitelistId;
}

function registerWhitelist(address _address, uint256 _amount) internal returns(bool) {
function registerWhitelist(
address _address,
uint256 _amount
) internal returns (bool) {
if (WhitelistId == 0) return true; //turn-off
IWhiteList(WhitelistAddress).Register(_address, WhitelistId, _amount);
return true;
}

}
}
27 changes: 14 additions & 13 deletions contracts/EnvelopToken/OriginalToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@ import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";

/**
* @title TestToken is a basic ERC20 Token
*/
contract OriginalToken is ERC20, Ownable{

* @title TestToken is a basic ERC20 Token
*/
contract OriginalToken is ERC20, Ownable {
/**
* @dev assign totalSupply to account creating this contract
*/

constructor(string memory _TokenName, string memory _TokenSymbol) ERC20(_TokenName, _TokenSymbol) public {
_setupDecimals(18);
_mint(msg.sender, 10000 * 10**18);
* @dev assign totalSupply to account creating this contract
*/

constructor(
string memory _TokenName,
string memory _TokenSymbol
) public ERC20(_TokenName, _TokenSymbol) {
_setupDecimals(18);
_mint(msg.sender, 10000 * 10 ** 18);
}
function FreeTest () public {
_mint(msg.sender, 10000 * 10**18);

function FreeTest() public {
_mint(msg.sender, 10000 * 10 ** 18);
}
}
Loading

0 comments on commit 24dd7e5

Please sign in to comment.