Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADHC-1001: Extra Contract and Version Bump #80

Open
wants to merge 35 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0454893
add _makePath pure function
vm06007 May 17, 2023
3f182c4
introduce MAX_VALUE
vm06007 May 17, 2023
aacec9b
formatting for internal _callOptionalReturn
vm06007 May 17, 2023
41db8f4
correct event property name typo
vm06007 May 17, 2023
6f38653
expand event LiquidityAdded with addedTo field
vm06007 May 17, 2023
48bfcc0
temporary remove stakeLiquidity function
vm06007 May 17, 2023
e3f5abf
remove unnecessary reads
vm06007 May 17, 2023
87114ea
refactor namings
vm06007 May 17, 2023
0ef4c47
improve tests
vm06007 May 17, 2023
4624c57
description update, function name update
vm06007 May 24, 2023
7219c47
add descriptions to functions
vm06007 May 24, 2023
c78c206
expand LiquidityAdded event
vm06007 May 24, 2023
68b7e7e
move event to _addLiquidity function
vm06007 May 24, 2023
eb97a05
adjust return values
vm06007 May 24, 2023
692f2fe
add function descriptions
vm06007 May 24, 2023
646d9b0
extra asserts in test added
vm06007 May 24, 2023
f0a3834
cleanup unused items in test file
vm06007 May 24, 2023
4e37fde
cleanup config
vm06007 May 25, 2023
f4e04bf
add extra tests
vm06007 May 25, 2023
2f9656e
new commands for coverage
vm06007 May 25, 2023
92b48be
update hardhat config
vm06007 May 25, 2023
4ed92db
add cleanUp function
vm06007 May 25, 2023
51938a6
convert internal to private
vm06007 May 25, 2023
434d86f
remove unnecessary return and payable
vm06007 May 25, 2023
cc66145
add extra description
vm06007 May 25, 2023
bb2d341
testing added
vm06007 May 30, 2023
6a1dd63
add extra properties to events
vm06007 Jun 4, 2023
16181a7
formatting
vm06007 Jun 4, 2023
fd7172c
test asserts for event data
vm06007 Jun 4, 2023
36bb2f2
bump up version
vm06007 Nov 28, 2023
50b1a0a
add VerseBalances
vm06007 Nov 28, 2023
700ad08
add interface
vm06007 Nov 29, 2023
af3557c
add LiquidityManager.sol
vm06007 Mar 16, 2024
71205f3
interface update
vm06007 Mar 16, 2024
0a8349e
improve VerseBalances
vm06007 Mar 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions contracts/IERC20.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BCOM
// SPDX-License-Identifier: -- BCOM --

pragma solidity =0.8.19;
pragma solidity =0.8.23;

interface IERC20 {

Expand All @@ -11,11 +11,25 @@ interface IERC20 {
view
returns (uint256);

function transfer(
address _to,
uint256 _value
)
external
returns (bool);

function transferFrom(
address _from,
address _to,
uint256 _value
)
external
returns (bool);

function approve(
address _spender,
uint256 _value
)
external
returns (bool);
}
4 changes: 2 additions & 2 deletions contracts/ISwapsCallee.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BCOM
// SPDX-License-Identifier: -- BCOM --

pragma solidity =0.8.19;
pragma solidity =0.8.23;

interface ISwapsCallee {

Expand Down
2 changes: 1 addition & 1 deletion contracts/ISwapsERC20.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BCOM

pragma solidity =0.8.19;
pragma solidity =0.8.23;

interface ISwapsERC20 {

Expand Down
4 changes: 2 additions & 2 deletions contracts/ISwapsFactory.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BCOM
// SPDX-License-Identifier: -- BCOM --

pragma solidity =0.8.19;
pragma solidity =0.8.23;

interface ISwapsFactory {

Expand Down
4 changes: 2 additions & 2 deletions contracts/ISwapsPair.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BCOM
// SPDX-License-Identifier: -- BCOM --

pragma solidity =0.8.19;
pragma solidity =0.8.23;

import "./ISwapsERC20.sol";

Expand Down
55 changes: 53 additions & 2 deletions contracts/ISwapsRouter.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BCOM
// SPDX-License-Identifier: -- BCOM --

pragma solidity ^0.8.19;
pragma solidity =0.8.23;

interface ISwapsRouter {

Expand Down Expand Up @@ -36,4 +36,55 @@ interface ISwapsRouter {
returns (
uint[] memory amounts
);

function removeLiquidity(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
)
external
returns (
uint256 amountA,
uint256 amountB
);

function getReserves(
address factory,
address tokenA,
address tokenB
)
external
view
returns (
uint112 reserveA,
uint112 reserveB,
uint32 blockTimestampLast
);

function FACTORY()
external
view
returns (address);

function quote(
uint256 amountA,
uint256 reserveA,
uint256 reserveB
)
external
pure
returns (uint256 amountB);

function pairFor(
address factory,
address tokenA,
address tokenB
)
external
pure
returns (address);
}
27 changes: 27 additions & 0 deletions contracts/IVerseFarm.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: -- BCOM --

pragma solidity =0.8.23;

import "./ISwapsPair.sol";

interface IVerseFarm {

function earned(
address _farmerAdders
)
external
view
returns (uint256);

function balanceOf(
address _farmerAdders
)
external
view
returns (uint256);

function stakeToken()
external
view
returns (ISwapsPair);
}
4 changes: 2 additions & 2 deletions contracts/IWETH.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BCOM
// SPDX-License-Identifier: -- BCOM --

pragma solidity =0.8.19;
pragma solidity =0.8.23;

interface IWETH {

Expand Down
35 changes: 29 additions & 6 deletions contracts/LiquidityHelper.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
// SPDX-License-Identifier: BCOM
// SPDX-License-Identifier: -- BCOM --

pragma solidity ^0.8.19;
pragma solidity =0.8.23;

import "./IERC20.sol";

contract LiquidityHelper {

uint256 constant MAX_VALUE = type(uint256).max;

/**
* @dev Allows to execute transferFrom for a token
* @dev
* Prepares path for the swap
*/
function _makePath(
address _tokenIn,
address _tokenOut
)
internal
pure
returns (address[] memory path)
{
path = new address[](2);

path[0] = _tokenIn;
path[1] = _tokenOut;

return path;
}

/**
* @dev
* Allows to execute transferFrom for a token
*/
function _safeTransferFrom(
address _token,
Expand All @@ -19,7 +42,7 @@ contract LiquidityHelper {
{
IERC20 token = IERC20(_token);

callOptionalReturn(
_callOptionalReturn(
_token,
abi.encodeWithSelector(
token.transferFrom.selector,
Expand All @@ -30,7 +53,7 @@ contract LiquidityHelper {
);
}

function callOptionalReturn(
function _callOptionalReturn(
address _token,
bytes memory _data
)
Expand Down Expand Up @@ -82,7 +105,7 @@ contract LiquidityHelper {

/**
* @dev
*
* Calculates square root of the _y number
*/
function _sqrt(
uint256 _y
Expand Down
Loading