Skip to content

Commit

Permalink
Fix code style issues with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
lint-action committed Mar 9, 2022
1 parent c308ba7 commit dba90f9
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 63 deletions.
1 change: 0 additions & 1 deletion certora/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ which can then be checked into git.

Note: there have been reports of unexpected behavior on mac, see
[issue CUST-62](https://certora.atlassian.net/browse/CUST-62?atlOrigin=eyJpIjoiZWI1MGFjNGZkZGE0NGFlNjkwYjUwYjY2NmE4ZmQ1OTIiLCJwIjoiaiJ9).

4 changes: 2 additions & 2 deletions certora/harness/DummyPenaltyCollector.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pragma solidity ^0.8.0;

contract DummyPenaltyCollector {

fallback() external payable {}

receive() external payable {}
}
}
40 changes: 20 additions & 20 deletions certora/harness/LaunchEventHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ pragma solidity ^0.8.0;
import "../munged/LaunchEvent.sol";

contract LaunchEventHarness is LaunchEvent {

constructor(address _issuer,
constructor(
address _issuer,
uint256 _auctionStart,
address _token,
uint256 _tokenIncentivesPercent,
Expand Down Expand Up @@ -49,19 +49,19 @@ contract LaunchEventHarness is LaunchEvent {
return getUserInfo[user].hasWithdrawnIncentives;
}

function getNewWAVAX() public returns (address){
function getNewWAVAX() public returns (address) {
return address(IWAVAX(rocketJoeFactory.wavax()));
}

function getWAVAXbalanceOfThis() public returns (uint256){
function getWAVAXbalanceOfThis() public returns (uint256) {
return WAVAX.balanceOf(address(this));
}

function getWAVAXbalanceOfPair() public returns (uint256){
function getWAVAXbalanceOfPair() public returns (uint256) {
return WAVAX.balanceOf(address(pair));
}

function getPenaltyCollector() public returns (address){
function getPenaltyCollector() public returns (address) {
return rocketJoeFactory.penaltyCollector();
}

Expand All @@ -87,43 +87,43 @@ contract LaunchEventHarness is LaunchEvent {

function getOwner() public returns (address) {
return Ownable(address(rocketJoeFactory)).owner();
}
}

mapping(address => uint256) public getUserPairBalance;

function pairBalance(address _user) public override returns (uint256) {
function pairBalance(address _user) public override returns (uint256) {
getUserPairBalance[_user] = super.pairBalance(_user);
return getUserPairBalance[_user];
}

}

// below are two equal methods but respresented differently
function getPairTotalSupplyOfThis() public returns (uint256) {
function getPairTotalSupplyOfThis() public returns (uint256) {
return pair.totalSupply();
}

function getPairTotalSupply() public returns (uint256) {
address iJoePairTmp = address(IJoePair(IJoeFactory(factory).getPair(address(WAVAX), address(token))));
address iJoePairTmp = address(
IJoePair(
IJoeFactory(factory).getPair(address(WAVAX), address(token))
)
);
require(iJoePairTmp == address(pair));
return pair.totalSupply();
}
}

function _safeTransferAVAX(address _to, uint256 _value) override internal {
function _safeTransferAVAX(address _to, uint256 _value) internal override {
IReceiver(_to).receiveETH{value: _value}();
}
}

function factoryGetPairWT() public returns (address){
function factoryGetPairWT() public returns (address) {
return factory.getPair(address(WAVAX), address(token));
}

function factoryGetPairTW() public returns (address){
function factoryGetPairTW() public returns (address) {
return factory.getPair(address(token), address(WAVAX));
}


}

interface IReceiver {
function receiveETH() external payable;
}

8 changes: 4 additions & 4 deletions certora/harness/OwnerA.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ pragma solidity ^0.8.0;

import "./LaunchEventHarness.sol";

contract OwnerA is IReceiver{

contract OwnerA is IReceiver {
fallback() external payable {}
function receiveETH() external override payable {}
}

function receiveETH() external payable override {}
}
8 changes: 4 additions & 4 deletions certora/harness/OwnerB.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ pragma solidity ^0.8.0;

import "./LaunchEventHarness.sol";

contract OwnerB is IReceiver{

contract OwnerB is IReceiver {
fallback() external payable {}
function receiveETH() external override payable {}
}

function receiveETH() external payable override {}
}
9 changes: 6 additions & 3 deletions certora/harness/RocketJoeStakingHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import "../munged/RocketJoeStaking.sol";

// TODO: change the name and supercontract and add any necessary harnessing
contract RocketJoeStakingHarness is RocketJoeStaking {

function userJoeStaked(address user) public view returns (uint256) {
return userInfo[user].amount;
}
Expand All @@ -21,8 +20,12 @@ contract RocketJoeStakingHarness is RocketJoeStaking {
return owner();
}

constructor(IERC20Upgradeable _joe, RocketJoeToken _rJoe, uint256 _rJoePerSec, uint256 _startTime) {
constructor(
IERC20Upgradeable _joe,
RocketJoeToken _rJoe,
uint256 _rJoePerSec,
uint256 _startTime
) {
initialize(_joe, _rJoe, _rJoePerSec, _startTime);
}
}

2 changes: 1 addition & 1 deletion certora/helpers/DummyERC20A.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
pragma solidity ^0.8.0;
import "./DummyERC20Impl.sol";

contract DummyERC20A is DummyERC20Impl {}
contract DummyERC20A is DummyERC20Impl {}
2 changes: 1 addition & 1 deletion certora/helpers/DummyERC20B.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
pragma solidity ^0.8.0;
import "./DummyERC20Impl.sol";

contract DummyERC20B is DummyERC20Impl {}
contract DummyERC20B is DummyERC20Impl {}
36 changes: 24 additions & 12 deletions certora/helpers/DummyERC20Impl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,53 @@ pragma solidity ^0.8.0;
// with mint
contract DummyERC20Impl {
uint256 t;
mapping (address => uint256) b;
mapping (address => mapping (address => uint256)) a;
mapping(address => uint256) b;
mapping(address => mapping(address => uint256)) a;

string public name;
string public symbol;
uint public decimals;
uint256 public decimals;

function myAddress() public returns (address) {
return address(this);
}

function add(uint a, uint b) internal pure returns (uint256) {
uint c = a +b;
require (c >= a);
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function sub(uint a, uint b) internal pure returns (uint256) {
require (a>=b);
return a-b;

function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(a >= b);
return a - b;
}

function totalSupply() external view returns (uint256) {
return t;
}

function balanceOf(address account) external view returns (uint256) {
return b[account];
}
function transfer(address recipient, uint256 amount) external returns (bool) {

function transfer(address recipient, uint256 amount)
external
returns (bool)
{
b[msg.sender] = sub(b[msg.sender], amount);
b[recipient] = add(b[recipient], amount);
return true;
}
function allowance(address owner, address spender) external view returns (uint256) {

function allowance(address owner, address spender)
external
view
returns (uint256)
{
return a[owner][spender];
}

function approve(address spender, uint256 amount) external returns (bool) {
a[msg.sender][spender] = amount;
return true;
Expand All @@ -54,4 +66,4 @@ contract DummyERC20Impl {
a[sender][msg.sender] = sub(a[sender][msg.sender], amount);
return true;
}
}
}
30 changes: 19 additions & 11 deletions certora/helpers/DummyWeth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,26 @@ pragma solidity ^0.8.0;
*/
contract DummyWeth {
uint256 t;

mapping(address => uint256) b;
mapping(address => mapping(address => uint256)) a;

string public name;
string public symbol;
uint public decimals;
uint256 public decimals;

function myAddress() public returns (address) {
return address(this);
}

function add(uint a, uint b) internal pure returns (uint256) {
uint c = a + b;
require (c >= a);
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function sub(uint a, uint b) internal pure returns (uint256) {
require (a >= b);

function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(a >= b);
return a - b;
}

Expand All @@ -36,13 +37,20 @@ contract DummyWeth {
return b[account];
}

function transfer(address recipient, uint256 amount) external returns (bool) {
function transfer(address recipient, uint256 amount)
external
returns (bool)
{
b[msg.sender] = sub(b[msg.sender], amount);
b[recipient] = add(b[recipient], amount);
return true;
}

function allowance(address owner, address spender) external view returns (uint256) {
function allowance(address owner, address spender)
external
view
returns (uint256)
{
return a[owner][spender];
}

Expand All @@ -61,7 +69,7 @@ contract DummyWeth {
a[sender][msg.sender] = sub(a[sender][msg.sender], amount);
return true;
}

// WETH
function deposit() external payable {
b[msg.sender] += msg.value;
Expand All @@ -72,4 +80,4 @@ contract DummyWeth {
b[msg.sender] -= amount;
t -= amount;
}
}
}
10 changes: 6 additions & 4 deletions certora/helpers/Receiver.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
pragma solidity 0.6.12;

contract Receiver {
fallback() external payable { }
fallback() external payable {}

function sendTo() external payable returns (bool) { return true; }
function sendTo() external payable returns (bool) {
return true;
}

receive() external payable { }
}
receive() external payable {}
}

0 comments on commit dba90f9

Please sign in to comment.