Skip to content

Commit

Permalink
chore(src): forge fmt /3
Browse files Browse the repository at this point in the history
Signed-off-by: jsvisa <delweng@gmail.com>
  • Loading branch information
jsvisa committed Nov 4, 2024
1 parent 782010e commit 97df63d
Show file tree
Hide file tree
Showing 140 changed files with 3,946 additions and 4,254 deletions.
8 changes: 6 additions & 2 deletions src/test/2017-11/Parity_kill_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import "forge-std/Test.sol";
import "./../interface.sol";

interface parity {
function isOwner(address _addr) external view returns (bool);
function isOwner(
address _addr
) external view returns (bool);

function kill(address _to) external;
function kill(
address _to
) external;

function initWallet(address[] memory _owners, uint256 _required, uint256 _daylimit) external;
}
Expand Down
4 changes: 3 additions & 1 deletion src/test/2018-04/BEC_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import "forge-std/Test.sol";
import "./../interface.sol";

interface BECToken {
function balanceOf(address account) external view returns (uint256);
function balanceOf(
address account
) external view returns (uint256);
function batchTransfer(address[] calldata _receivers, uint256 _value) external returns (bool);
}

Expand Down
14 changes: 3 additions & 11 deletions src/test/2018-04/SmartMesh_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import "../basetest.sol";

// @Analysis
// Post-mortem : https://cryptojobslist.com/blog/two-vulnerable-erc20-contracts-deep-dive-beautychain-smartmesh
// Twitter Guy :
// Hacking God :
// Twitter Guy :
// Hacking God :
pragma solidity ^0.8.0;

interface ISmartMesh {
Expand Down Expand Up @@ -48,14 +48,6 @@ contract SmartMesh is BaseTestWithBalanceLog {
uint8 _v = uint8(0x000000000000000000000000000000000000000000000000000000000000001b);
bytes32 _r = 0x87790587c256045860b8fe624e5807a658424fad18c2348460e40ecf10fc8799;
bytes32 _s = 0x6c879b1e8a0a62f23b47aa57a3369d416dd783966bd1dda0394c04163a98d8d8;
ISmartMesh(Victim).transferProxy(
_from,
_to,
_value,
_feeSmt,
_v,
_r,
_s
);
ISmartMesh(Victim).transferProxy(_from, _to, _value, _feeSmt, _v, _r, _s);
}
}
20 changes: 15 additions & 5 deletions src/test/2021-01/Sushi_Badger_Digg_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,22 @@ contract Exploit is Test {
interface IERC20 {
function transfer(address to, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function balanceOf(
address account
) external view returns (uint256);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}

interface IWETH {
function deposit() external payable;
function transfer(address to, uint256 value) external returns (bool);
function approve(address guy, uint256 wad) external returns (bool);
function withdraw(uint256 wad) external;
function balanceOf(address) external view returns (uint256);
function withdraw(
uint256 wad
) external;
function balanceOf(
address
) external view returns (uint256);
}

interface IUniswapV2Router02 {
Expand Down Expand Up @@ -152,8 +158,12 @@ interface IUniswapV2Router02 {

interface IUniswapV2Pair {
function approve(address spender, uint256 amount) external returns (bool);
function balanceOf(address) external view returns (uint256);
function skim(address to) external;
function balanceOf(
address
) external view returns (uint256);
function skim(
address to
) external;
function sync() external;
function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes memory data) external;

Expand Down
8 changes: 6 additions & 2 deletions src/test/2021-06/PancakeHunny_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ import "./../interface.sol";

interface CakeFlipVault {
function getReward() external;
function withdraw(uint256 amount) external;
function rewards(address) external view returns (uint256);
function withdraw(
uint256 amount
) external;
function rewards(
address
) external view returns (uint256);
}

contract ContractTest is Test {
Expand Down
8 changes: 6 additions & 2 deletions src/test/2021-06/SafeDollar_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ interface SdoRewardPOOL {
function deposit(uint256 _pid, uint256 _amount) external;
function withdraw(uint256 _pid, uint256 _amount) external;
function harvestAllRewards() external;
function updatePool(uint256 _pid) external;
function updatePool(
uint256 _pid
) external;
function pendingReward(uint256, address) external returns (uint256);
}

Expand Down Expand Up @@ -163,7 +165,9 @@ contract ContractTest is Test {
addressContract = _add;
}

function buyPLX(uint256 amount) public {
function buyPLX(
uint256 amount
) public {
address[] memory path = new address[](2);
path[0] = address(WMATIC);
path[1] = address(PLX);
Expand Down
8 changes: 6 additions & 2 deletions src/test/2021-06/xWin_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ interface IBank {
}

interface IxWinDefi {
function Subscribe(TradeParams memory _tradeParams) external payable;
function Redeem(TradeParams memory _tradeParams) external payable;
function Subscribe(
TradeParams memory _tradeParams
) external payable;
function Redeem(
TradeParams memory _tradeParams
) external payable;
function WithdrawReward() external payable;
}

Expand Down
16 changes: 12 additions & 4 deletions src/test/2021-07/Levyathan_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,19 @@ interface ITimelock {
bytes32 predecessor,
bytes32 salt
) external returns (bytes32 hash);
function isOperationPending(bytes32 id) external returns (bool pending);
function isOperationPending(
bytes32 id
) external returns (bool pending);
function execute(
address target,
uint256 value,
bytes calldata payload,
bytes32 predecessor,
bytes32 salt
) external;
function isOperationDone(bytes32 id) external returns (bool done);
function isOperationDone(
bytes32 id
) external returns (bool done);
}

interface ILEV {
Expand All @@ -144,7 +148,11 @@ interface ILEV {

interface IMasterChef {
function recoverLevOwnership() external;
function leaveStaking(uint256 _amount) external;
function leaveStaking(
uint256 _amount
) external;
function withdraw(uint256 _pid, uint256 _amount) external;
function emergencyWithdraw(uint256 _pid) external;
function emergencyWithdraw(
uint256 _pid
) external;
}
4 changes: 3 additions & 1 deletion src/test/2021-09/DaoMaker_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import "./../interface.sol";

interface DAOMaker {
function init(uint256, uint256[] calldata, uint256[] calldata, address) external;
function emergencyExit(address) external;
function emergencyExit(
address
) external;
}

contract ContractTest is Test {
Expand Down
4 changes: 3 additions & 1 deletion src/test/2021-11/Ploutoz_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ contract Ploutoz is BaseTestWithBalanceLog {
borrowSingleLoan(pBUSD, 90_000 ether, 2000 ether);
}

function swapLoanedTokenToStable(address lToken) internal {
function swapLoanedTokenToStable(
address lToken
) internal {
address assetIn = ILoanToken(lToken).loanTokenAddress();
uint256 amountIn = TokenHelper.getTokenBalance(assetIn, address(this));
swapTokenToToken(assetIn, BUSD, amountIn, PancakeRouter);
Expand Down
16 changes: 12 additions & 4 deletions src/test/2022-07/Audius_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ interface IGovernence {
uint16 _maxInProgressProposals,
address _guardianAddress
) external;
function evaluateProposalOutcome(uint256 _proposalId) external returns (Outcome);
function evaluateProposalOutcome(
uint256 _proposalId
) external returns (Outcome);
function submitProposal(
bytes32 _targetContractRegistryKey,
uint256 _callValue,
Expand All @@ -86,7 +88,9 @@ interface IDelegateManagerV2 {
address _governanceAddress,
uint256 _undelegateLockupDuration
) external;
function setServiceProviderFactoryAddress(address _spFactory) external;
function setServiceProviderFactoryAddress(
address _spFactory
) external;
function delegateStake(address _targetSP, uint256 _amount) external returns (uint256);
}

Expand Down Expand Up @@ -176,7 +180,9 @@ contract AttackContract is Test {
}

/* Tx1 callback functions */
function getContract(bytes32 _targetContractRegistryKey) external returns (address) {
function getContract(
bytes32 _targetContractRegistryKey
) external returns (address) {
return AUDIO;
}

Expand All @@ -196,7 +202,9 @@ contract AttackContract is Test {
return true;
}

function validateAccountStakeBalance(address) external pure {}
function validateAccountStakeBalance(
address
) external pure {}

receive() external payable {}
}
4 changes: 3 additions & 1 deletion src/test/2022-07/SpaceGodzilla_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ address constant pool16 = 0xD534fAE679f7F02364D177E9D44F1D15963c0Dd7; // DODO/

interface ISpaceGodzilla {
function swapAndLiquifyStepv1() external;
function swapTokensForOther(uint256 tokenAmount) external;
function swapTokensForOther(
uint256 tokenAmount
) external;
}

contract AttackContract is Test {
Expand Down
12 changes: 9 additions & 3 deletions src/test/2022-09/DPC_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ import "./../interface.sol";

interface IPair {
function approve(address, uint256) external;
function balanceOf(address) external returns (uint256);
function balanceOf(
address
) external returns (uint256);
}

interface IDPC {
function approve(address, uint256) external;
function balanceOf(address) external returns (uint256);
function balanceOf(
address
) external returns (uint256);
function tokenAirdrop(address, address, uint256) external;
function stakeLp(address, address, uint256) external;
function claimStakeLp(address, uint256) external;
function claimDpcAirdrop(address) external;
function claimDpcAirdrop(
address
) external;
}

contract ContractTest is Test {
Expand Down
4 changes: 3 additions & 1 deletion src/test/2022-09/Shadowfi_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import "./../interface.sol";

interface ISDF {
function burn(address, uint256) external;
function balanceOf(address owner) external view returns (uint256);
function balanceOf(
address owner
) external view returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
}

Expand Down
4 changes: 3 additions & 1 deletion src/test/2022-10/Carrot_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ Explanation by: Kayaba-Attribution
*/

interface ICarrot is IERC20 {
function transReward(bytes memory data) external;
function transReward(
bytes memory data
) external;
}

contract ContractTest is Test {
Expand Down
20 changes: 15 additions & 5 deletions src/test/2022-10/HPAY_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ import "./../interface.sol";
// ACai Article (in Chinese) : https://www.cnblogs.com/ACaiGarden/p/16872933.html

interface IMintableAutoCompundRelockBonus {
function setToken(address) external;
function stake(uint256) external;
function withdraw(uint256) external;
function setToken(
address
) external;
function stake(
uint256
) external;
function withdraw(
uint256
) external;
}

contract ContractTest is Test {
Expand Down Expand Up @@ -125,13 +131,17 @@ contract SHITCOIN {
return true;
}

function mint(uint256 amount) external {
function mint(
uint256 amount
) external {
balanceOf[msg.sender] += amount;
totalSupply += amount;
emit Transfer(address(0), msg.sender, amount);
}

function burn(uint256 amount) external {
function burn(
uint256 amount
) external {
balanceOf[msg.sender] -= amount;
totalSupply -= amount;
emit Transfer(msg.sender, address(0), amount);
Expand Down
4 changes: 3 additions & 1 deletion src/test/2022-10/RES_exp2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ contract ContractTest is Test {
);
}

function buyRES(uint256 amountBuy) internal {
function buyRES(
uint256 amountBuy
) internal {
address[] memory path = new address[](2);
path[0] = address(USDT_TOKEN);
path[1] = address(RES_TOKEN);
Expand Down
4 changes: 3 additions & 1 deletion src/test/2022-10/RabbyWallet_SwapRouter_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ contract ContractTest is Test {
);
}

function balanceOf(address) external pure returns (uint256) {
function balanceOf(
address
) external pure returns (uint256) {
return 100e18;
}

Expand Down
4 changes: 3 additions & 1 deletion src/test/2022-10/Templedao_exp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import "./../interface.sol";

interface IStaxLPStaking {
function migrateStake(address oldStaking, uint256 amount) external;
function withdrawAll(bool claim) external;
function withdrawAll(
bool claim
) external;
}

contract ContractTest is Test {
Expand Down
Loading

0 comments on commit 97df63d

Please sign in to comment.