fix_lint (#11)
Co-authored-by: Arthur Abeilice <afa7789@gmail.com> Reviewed-on: https://git.p2pix.co/doiim/p2pix-smart-contracts/pulls/11 Co-authored-by: arthur <abeilice@kosmos.org> Co-committed-by: arthur <abeilice@kosmos.org>
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
# directories
|
||||
.yarn/
|
||||
**/.coverage_artifacts
|
||||
**/.coverage_cache
|
||||
**/.coverage_contracts
|
||||
**/artifacts
|
||||
**/build
|
||||
**/cache
|
||||
**/coverage
|
||||
**/dist
|
||||
**/node_modules
|
||||
**/types
|
||||
|
||||
# deploy artifacts
|
||||
deploys/old/
|
||||
|
||||
# auto-generated docs
|
||||
docs/
|
||||
|
||||
# files
|
||||
*.env
|
||||
*.log
|
||||
.pnp.*
|
||||
coverage.json
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
@@ -1,21 +0,0 @@
|
||||
extends:
|
||||
- "eslint:recommended"
|
||||
- "plugin:@typescript-eslint/eslint-recommended"
|
||||
- "plugin:@typescript-eslint/recommended"
|
||||
- "prettier"
|
||||
parser: "@typescript-eslint/parser"
|
||||
parserOptions:
|
||||
project: "./tsconfig.json"
|
||||
plugins:
|
||||
- "@typescript-eslint"
|
||||
root: true
|
||||
rules:
|
||||
"@typescript-eslint/no-floating-promises":
|
||||
- error
|
||||
- ignoreIIFE: true
|
||||
ignoreVoid: true
|
||||
"@typescript-eslint/no-inferrable-types": "off"
|
||||
"@typescript-eslint/no-unused-vars":
|
||||
- error
|
||||
- argsIgnorePattern: "_"
|
||||
varsIgnorePattern: "_"
|
||||
@@ -24,6 +24,4 @@ docs/
|
||||
coverage.json
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
contracts/p2pix.sol
|
||||
yarn-error.log*
|
||||
@@ -1,10 +1,8 @@
|
||||
plugins:
|
||||
- prettier-plugin-solidity
|
||||
arrowParens: avoid
|
||||
bracketSpacing: true
|
||||
endOfLine: auto
|
||||
importOrder: ["<THIRD_PARTY_MODULES>", "^[./]"]
|
||||
importOrderParserPlugins: ["typescript"]
|
||||
importOrderSeparation: true
|
||||
importOrderSortSpecifiers: true
|
||||
printWidth: 62
|
||||
singleQuote: false
|
||||
tabWidth: 2
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"plugins": ["prettier"],
|
||||
"rules": {
|
||||
"code-complexity": ["error", 8],
|
||||
"avoid-low-level-calls": "off",
|
||||
"compiler-version": ["error", ">=0.8.4"],
|
||||
"const-name-snakecase": "off",
|
||||
"constructor-syntax": "error",
|
||||
@@ -10,7 +11,14 @@
|
||||
"error",
|
||||
{ "ignoreConstructors": true }
|
||||
],
|
||||
"function-max-lines": "off",
|
||||
"gas-calldata-parameters": "off",
|
||||
"gas-indexed-events": "off",
|
||||
"gas-strict-inequalities": "off",
|
||||
"gas-struct-packing": "off",
|
||||
"interface-starts-with-i": "off",
|
||||
"max-line-length": ["error", 120],
|
||||
"no-inline-assembly": "off",
|
||||
"not-rely-on-time": "off",
|
||||
"prettier/prettier": [
|
||||
"error",
|
||||
@@ -18,6 +26,7 @@
|
||||
"endOfLine": "auto"
|
||||
}
|
||||
],
|
||||
"reason-string": ["warn", { "maxLength": 64 }]
|
||||
"reason-string": ["warn", { "maxLength": 64 }],
|
||||
"use-natspec": "off"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,9 +45,8 @@ abstract contract BaseUtils is
|
||||
!validBacenSigners(
|
||||
_castAddrToKey(
|
||||
ECDSA.recover(
|
||||
MessageHashUtils.toEthSignedMessageHash(
|
||||
_message
|
||||
),
|
||||
MessageHashUtils
|
||||
.toEthSignedMessageHash(_message),
|
||||
_signature
|
||||
)
|
||||
)
|
||||
|
||||
@@ -4,19 +4,23 @@ pragma solidity ^0.8.19;
|
||||
abstract contract Constants {
|
||||
/// ███ Constants ██████████████████████████████████████████████████████████
|
||||
|
||||
uint256 constant _ROOT_UPDATED_EVENT_SIGNATURE =
|
||||
uint256 internal constant _ROOT_UPDATED_EVENT_SIGNATURE =
|
||||
0x0b294da292f26e55fd442b5c0164fbb9013036ff00c5cfdde0efd01c1baaf632;
|
||||
uint256 constant _ALLOWED_ERC20_UPDATED_EVENT_SIGNATURE =
|
||||
uint256
|
||||
internal constant _ALLOWED_ERC20_UPDATED_EVENT_SIGNATURE =
|
||||
0x5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a;
|
||||
uint256 constant _TRUSTED_FORWARDER_UPDATED_EVENT_SIGNATURE =
|
||||
uint256
|
||||
internal constant _TRUSTED_FORWARDER_UPDATED_EVENT_SIGNATURE =
|
||||
0xbee55516e29d3969d3cb8eb01351eb3c52d06f9e2435bd5a8bfe3647e185df92;
|
||||
|
||||
/// @dev Seller casted to key => Seller's allowlist merkleroot.
|
||||
/// mapping(uint256 => bytes32) public sellerAllowList;
|
||||
uint256 constant _SELLER_ALLOWLIST_SLOT_SEED = 0x74dfee70;
|
||||
uint256 internal constant _SELLER_ALLOWLIST_SLOT_SEED =
|
||||
0x74dfee70;
|
||||
/// @dev Tokens allowed to serve as the underlying amount of a deposit.
|
||||
/// mapping(ERC20 => bool) public allowedERC20s;
|
||||
uint256 constant _ALLOWED_ERC20_SLOT_SEED = 0xcbc9d1c4;
|
||||
uint256 internal constant _ALLOWED_ERC20_SLOT_SEED =
|
||||
0xcbc9d1c4;
|
||||
|
||||
/// @dev `balance` max. value = 10**26.
|
||||
/// @dev `pixTarget` keys are restricted to 160 bits.
|
||||
@@ -32,16 +36,21 @@ abstract contract Constants {
|
||||
/// mstore(0x0c, _SELLER_BALANCE_SLOT_SEED)
|
||||
/// mstore(0x00, seller)
|
||||
/// let value := sload(keccak256(0x0c, 0x34)).
|
||||
uint256 constant _SELLER_BALANCE_SLOT_SEED = 0x739094b1;
|
||||
uint256 internal constant _SELLER_BALANCE_SLOT_SEED =
|
||||
0x739094b1;
|
||||
|
||||
/// @dev The bitmask of `sellerBalance` entry.
|
||||
uint256 constant BITMASK_SB_ENTRY = (1 << 94) - 1;
|
||||
uint256 internal constant BITMASK_SB_ENTRY =
|
||||
(1 << 94) - 1;
|
||||
/// @dev The bit position of `valid` in `sellerBalance`.
|
||||
uint256 constant BITPOS_VALID = 95;
|
||||
uint256 internal constant BITPOS_VALID = 95;
|
||||
|
||||
/// @dev The scalar of BRZ token.
|
||||
uint256 constant WAD = 1e18;
|
||||
uint256 constant MAXBALANCE_UPPERBOUND = 1e8 ether;
|
||||
uint256 constant REPUTATION_LOWERBOUND = 1e2 ether;
|
||||
uint256 constant LOCKAMOUNT_UPPERBOUND = 1e6 ether;
|
||||
uint256 internal constant WAD = 1e18;
|
||||
uint256 internal constant MAXBALANCE_UPPERBOUND =
|
||||
1e8 ether;
|
||||
uint256 internal constant REPUTATION_LOWERBOUND =
|
||||
1e2 ether;
|
||||
uint256 internal constant LOCKAMOUNT_UPPERBOUND =
|
||||
1e6 ether;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ pragma solidity ^0.8.19;
|
||||
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
||||
|
||||
library DataTypes {
|
||||
|
||||
struct Lock {
|
||||
uint256 counter;
|
||||
uint256 expirationBlock;
|
||||
|
||||
@@ -6,9 +6,10 @@ import { ERC2771Context } from "@openzeppelin/contracts/metatx/ERC2771Context.so
|
||||
|
||||
abstract contract ERC2771 is ERC2771Context(address(0)) {
|
||||
mapping(address => bool) public trustedForwarders;
|
||||
|
||||
function isTrustedForwarder(address forwarder) public view override returns (bool) {
|
||||
return trustedForwarders[forwarder];
|
||||
}
|
||||
|
||||
function isTrustedForwarder(
|
||||
address forwarder
|
||||
) public view override returns (bool) {
|
||||
return trustedForwarders[forwarder];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ contract Multicall {
|
||||
}
|
||||
|
||||
//prettier-ignore
|
||||
//solhint-disable-next-line no-empty-blocks
|
||||
constructor(/* */) payable {/* */}
|
||||
|
||||
function mtc1(Call[] calldata calls)
|
||||
external
|
||||
returns (uint256, bytes[] memory)
|
||||
{
|
||||
function mtc1(
|
||||
Call[] calldata calls
|
||||
) external returns (uint256, bytes[] memory) {
|
||||
uint256 bn = block.number;
|
||||
uint256 len = calls.length;
|
||||
bytes[] memory res = new bytes[](len);
|
||||
@@ -49,21 +49,14 @@ contract Multicall {
|
||||
return (bn, res);
|
||||
}
|
||||
|
||||
function mtc2(Call[] calldata calls)
|
||||
external
|
||||
returns (
|
||||
uint256,
|
||||
bytes32,
|
||||
Result[] memory
|
||||
)
|
||||
{
|
||||
function mtc2(
|
||||
Call[] calldata calls
|
||||
) external returns (uint256, bytes32, Result[] memory) {
|
||||
uint256 bn = block.number;
|
||||
// µ 0 s [0] ≡ P(IHp , µs [0], 0) ∴ P is the hash of a block of a particular number, up to a maximum age.
|
||||
// 0 is left on the stack if the looked for `block.number` is >= to the current `block.number` or more than 256
|
||||
// blocks behind the current block (Yellow Paper, p. 33, https://ethereum.github.io/yellowpaper/paper.pdf).
|
||||
bytes32 bh = blockhash(
|
||||
bn /* - 1 */
|
||||
);
|
||||
bytes32 bh = blockhash(bn /* - 1 */);
|
||||
uint256 len = calls.length;
|
||||
Result[] memory res = new Result[](len);
|
||||
uint256 i;
|
||||
|
||||
@@ -12,7 +12,6 @@ import { OwnerSettings, ERC20, SafeTransferLib } from "contracts/core/OwnerSetti
|
||||
import { BaseUtils } from "contracts/core/BaseUtils.sol";
|
||||
import { DataTypes as DT } from "contracts/core/DataTypes.sol";
|
||||
|
||||
|
||||
contract P2PIX is BaseUtils {
|
||||
// solhint-disable use-forbidden-name
|
||||
// solhint-disable no-inline-assembly
|
||||
@@ -34,15 +33,18 @@ contract P2PIX is BaseUtils {
|
||||
address _reputation,
|
||||
ERC20[] memory tokens,
|
||||
bool[] memory tokenStates
|
||||
)
|
||||
)
|
||||
payable
|
||||
OwnerSettings(
|
||||
defaultBlocks,
|
||||
validSigners,
|
||||
_reputation,
|
||||
tokens,
|
||||
defaultBlocks,
|
||||
validSigners,
|
||||
_reputation,
|
||||
tokens,
|
||||
tokenStates
|
||||
)
|
||||
payable {/* */}
|
||||
)
|
||||
{
|
||||
/* */
|
||||
}
|
||||
|
||||
/// @notice Creates a deposit order based on a seller's
|
||||
/// offer of an amount of ERC20 tokens.
|
||||
@@ -58,13 +60,16 @@ contract P2PIX is BaseUtils {
|
||||
uint96 amount,
|
||||
bool valid
|
||||
) public nonReentrant {
|
||||
|
||||
if (bytes(pixTarget).length == 0) revert EmptyPixTarget();
|
||||
if (bytes(pixTarget).length == 0)
|
||||
revert EmptyPixTarget();
|
||||
if (!allowedERC20s(token)) revert TokenDenied();
|
||||
uint256 _sellerBalance = __sellerBalance(msg.sender, token);
|
||||
uint256 _sellerBalance = __sellerBalance(
|
||||
msg.sender,
|
||||
token
|
||||
);
|
||||
|
||||
uint256 currBal = _sellerBalance & BITMASK_SB_ENTRY;
|
||||
uint256 _newBal = uint256(currBal + amount);
|
||||
uint256 _newBal = uint256(currBal + amount);
|
||||
if (_newBal > MAXBALANCE_UPPERBOUND)
|
||||
revert MaxBalExceeded();
|
||||
|
||||
@@ -76,8 +81,8 @@ contract P2PIX is BaseUtils {
|
||||
uint256 validCasted = _castBool(valid);
|
||||
|
||||
_setSellerBalance(
|
||||
msg.sender,
|
||||
token,
|
||||
msg.sender,
|
||||
token,
|
||||
(_newBal | (validCasted << BITPOS_VALID)),
|
||||
pixTargetCasted
|
||||
);
|
||||
@@ -97,7 +102,10 @@ contract P2PIX is BaseUtils {
|
||||
/// @notice This function does not affect any ongoing active locks.
|
||||
/// @dev Function sighash: 0x6d82d9e0
|
||||
function setValidState(ERC20 token, bool state) public {
|
||||
uint256 _sellerBalance = __sellerBalance(msg.sender, token);
|
||||
uint256 _sellerBalance = __sellerBalance(
|
||||
msg.sender,
|
||||
token
|
||||
);
|
||||
|
||||
if (_sellerBalance != 0) {
|
||||
uint256 _valid = _castBool(state);
|
||||
@@ -115,7 +123,7 @@ contract P2PIX is BaseUtils {
|
||||
/// @notice Public method designed to lock an remaining amount of
|
||||
/// the deposit order of a seller.
|
||||
/// @notice Transaction forwarding must leave `merkleProof` empty;
|
||||
/// otherwise, the trustedForwarder must be previously added
|
||||
/// otherwise, the trustedForwarder must be previously added
|
||||
/// to a seller whitelist.
|
||||
/// @notice This method can be performed either by:
|
||||
/// - An user allowed via the seller's allowlist;
|
||||
@@ -144,30 +152,36 @@ contract P2PIX is BaseUtils {
|
||||
uint256 bal = getBalance(seller, token);
|
||||
if (bal < amount) revert NotEnoughTokens();
|
||||
|
||||
unchecked {
|
||||
unchecked {
|
||||
lockID = ++lockCounter;
|
||||
}
|
||||
|
||||
if (
|
||||
mapLocks[lockID].expirationBlock >= block.number
|
||||
) revert NotExpired();
|
||||
if (mapLocks[lockID].expirationBlock >= block.number)
|
||||
revert NotExpired();
|
||||
|
||||
bytes32 _pixTarget = getPixTarget(seller, token);
|
||||
|
||||
// transaction forwarding must leave `merkleProof` empty;
|
||||
// otherwise, the trustedForwarder must be previously added
|
||||
// otherwise, the trustedForwarder must be previously added
|
||||
// to a seller whitelist.
|
||||
if (merkleProof.length != 0) {
|
||||
_merkleVerify( merkleProof, sellerAllowList(seller), _msgSender());
|
||||
|
||||
} else if ( amount > REPUTATION_LOWERBOUND && msg.sender == _msgSender() ) {
|
||||
|
||||
uint256 spendLimit; uint256 userCredit =
|
||||
userRecord[_castAddrToKey(_msgSender())];
|
||||
_merkleVerify(
|
||||
merkleProof,
|
||||
sellerAllowList(seller),
|
||||
_msgSender()
|
||||
);
|
||||
} else if (
|
||||
amount > REPUTATION_LOWERBOUND &&
|
||||
msg.sender == _msgSender()
|
||||
) {
|
||||
uint256 spendLimit;
|
||||
uint256 userCredit = userRecord[
|
||||
_castAddrToKey(_msgSender())
|
||||
];
|
||||
(spendLimit) = _limiter(userCredit / WAD);
|
||||
if (
|
||||
amount > (spendLimit * WAD) ||
|
||||
amount > LOCKAMOUNT_UPPERBOUND
|
||||
if (
|
||||
amount > (spendLimit * WAD) ||
|
||||
amount > LOCKAMOUNT_UPPERBOUND
|
||||
) revert AmountNotAllowed();
|
||||
}
|
||||
|
||||
@@ -225,14 +239,21 @@ contract P2PIX is BaseUtils {
|
||||
l.amount = 0;
|
||||
l.expirationBlock = 0;
|
||||
_setUsedTransactions(message);
|
||||
|
||||
if (_msgSender() == msg.sender) {
|
||||
if (msg.sender != l.buyerAddress) {
|
||||
userRecord[_castAddrToKey(msg.sender)] += (lockAmount >> 1);
|
||||
userRecord[_castAddrToKey(l.buyerAddress)] += (lockAmount >> 1);
|
||||
} else {
|
||||
userRecord[_castAddrToKey(msg.sender)] += lockAmount;
|
||||
}}
|
||||
|
||||
if (_msgSender() == msg.sender) {
|
||||
if (msg.sender != l.buyerAddress) {
|
||||
userRecord[
|
||||
_castAddrToKey(msg.sender)
|
||||
] += (lockAmount >> 1);
|
||||
userRecord[
|
||||
_castAddrToKey(l.buyerAddress)
|
||||
] += (lockAmount >> 1);
|
||||
} else {
|
||||
userRecord[
|
||||
_castAddrToKey(msg.sender)
|
||||
] += lockAmount;
|
||||
}
|
||||
}
|
||||
|
||||
SafeTransferLib.safeTransfer(
|
||||
t,
|
||||
@@ -249,9 +270,9 @@ contract P2PIX is BaseUtils {
|
||||
/// @notice For each successfull unexpired lock recovered,
|
||||
/// `userRecord[_castAddrToKey(l.relayerAddress)]` is decreased by half of its value.
|
||||
/// @dev Function sighash: 0xb0983d39
|
||||
function unlockExpired(uint256[] calldata lockIDs)
|
||||
public
|
||||
{
|
||||
function unlockExpired(
|
||||
uint256[] calldata lockIDs
|
||||
) public {
|
||||
uint256 i;
|
||||
uint256 locksSize = lockIDs.length;
|
||||
|
||||
@@ -260,19 +281,21 @@ contract P2PIX is BaseUtils {
|
||||
|
||||
_notExpired(l);
|
||||
|
||||
uint256 _sellerBalance =
|
||||
__sellerBalance(l.seller, l.token) & BITMASK_SB_ENTRY;
|
||||
uint256 _sellerBalance = __sellerBalance(
|
||||
l.seller,
|
||||
l.token
|
||||
) & BITMASK_SB_ENTRY;
|
||||
|
||||
if ((_sellerBalance + l.amount) > MAXBALANCE_UPPERBOUND)
|
||||
revert MaxBalExceeded();
|
||||
if (
|
||||
(_sellerBalance + l.amount) >
|
||||
MAXBALANCE_UPPERBOUND
|
||||
) revert MaxBalExceeded();
|
||||
|
||||
_addSellerBalance(l.seller, l.token, l.amount);
|
||||
|
||||
l.amount = 0;
|
||||
|
||||
uint256 userKey = _castAddrToKey(
|
||||
l.buyerAddress
|
||||
);
|
||||
uint256 userKey = _castAddrToKey(l.buyerAddress);
|
||||
uint256 _newUserRecord = (userRecord[userKey] >>
|
||||
1);
|
||||
|
||||
@@ -312,7 +335,8 @@ contract P2PIX is BaseUtils {
|
||||
setValidState(token, false);
|
||||
|
||||
_decBal(
|
||||
(__sellerBalance(msg.sender, token) & BITMASK_SB_ENTRY),
|
||||
(__sellerBalance(msg.sender, token) &
|
||||
BITMASK_SB_ENTRY),
|
||||
amount,
|
||||
token,
|
||||
msg.sender
|
||||
@@ -325,18 +349,15 @@ contract P2PIX is BaseUtils {
|
||||
amount
|
||||
);
|
||||
|
||||
emit DepositWithdrawn(
|
||||
msg.sender,
|
||||
token,
|
||||
amount
|
||||
);
|
||||
emit DepositWithdrawn(msg.sender, token, amount);
|
||||
}
|
||||
|
||||
function setRoot(address addr, bytes32 merkleroot)
|
||||
public
|
||||
{
|
||||
function setRoot(
|
||||
address addr,
|
||||
bytes32 merkleroot
|
||||
) public {
|
||||
assembly ("memory-safe") {
|
||||
// if (addr != msg.sender)
|
||||
// if (addr != msg.sender)
|
||||
if iszero(eq(addr, caller())) {
|
||||
// revert OnlySeller()
|
||||
mstore(0x00, 0x85d1f726)
|
||||
@@ -349,8 +370,8 @@ contract P2PIX is BaseUtils {
|
||||
|
||||
// emit RootUpdated(addr, merkleroot);
|
||||
log3(
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
_ROOT_UPDATED_EVENT_SIGNATURE,
|
||||
addr,
|
||||
merkleroot
|
||||
@@ -408,14 +429,13 @@ contract P2PIX is BaseUtils {
|
||||
}
|
||||
|
||||
// we can directly dec from packed uint entry value
|
||||
_decSellerBalance(_k,_t, _amount);
|
||||
_decSellerBalance(_k, _t, _amount);
|
||||
}
|
||||
|
||||
function getBalance(address seller, ERC20 token)
|
||||
public
|
||||
view
|
||||
returns (uint256 bal)
|
||||
{
|
||||
function getBalance(
|
||||
address seller,
|
||||
ERC20 token
|
||||
) public view returns (uint256 bal) {
|
||||
assembly ("memory-safe") {
|
||||
for {
|
||||
/* */
|
||||
@@ -434,11 +454,10 @@ contract P2PIX is BaseUtils {
|
||||
}
|
||||
}
|
||||
|
||||
function getValid(address seller, ERC20 token)
|
||||
public
|
||||
view
|
||||
returns (bool valid)
|
||||
{
|
||||
function getValid(
|
||||
address seller,
|
||||
ERC20 token
|
||||
) public view returns (bool valid) {
|
||||
assembly ("memory-safe") {
|
||||
for {
|
||||
/* */
|
||||
@@ -452,7 +471,9 @@ contract P2PIX is BaseUtils {
|
||||
BITMASK_SB_ENTRY,
|
||||
shr(
|
||||
BITPOS_VALID,
|
||||
sload(add(keccak256(0x0c, 0x34), 0x01))
|
||||
sload(
|
||||
add(keccak256(0x0c, 0x34), 0x01)
|
||||
)
|
||||
)
|
||||
)
|
||||
break
|
||||
@@ -460,11 +481,10 @@ contract P2PIX is BaseUtils {
|
||||
}
|
||||
}
|
||||
|
||||
function getPixTarget(address seller, ERC20 token)
|
||||
public
|
||||
view
|
||||
returns (bytes32 pixTarget)
|
||||
{
|
||||
function getPixTarget(
|
||||
address seller,
|
||||
ERC20 token
|
||||
) public view returns (bytes32 pixTarget) {
|
||||
assembly ("memory-safe") {
|
||||
for {
|
||||
/* */
|
||||
@@ -480,9 +500,12 @@ contract P2PIX is BaseUtils {
|
||||
}
|
||||
}
|
||||
|
||||
function getPixTargetString(address seller, ERC20 token) public view returns (string memory pixTarget) {
|
||||
function getPixTargetString(
|
||||
address seller,
|
||||
ERC20 token
|
||||
) public view returns (string memory pixTarget) {
|
||||
bytes32 _pixEnc = getPixTarget(seller, token);
|
||||
pixTarget = string(abi.encodePacked(_pixEnc));
|
||||
pixTarget = string(abi.encodePacked(_pixEnc));
|
||||
}
|
||||
|
||||
function getBalances(
|
||||
@@ -506,7 +529,9 @@ contract P2PIX is BaseUtils {
|
||||
/// @notice External getter that returns the status of a lockIDs array.
|
||||
/// @notice Call will not revert if provided with an empty array as parameter.
|
||||
/// @dev Function sighash: 0x49ef8448
|
||||
function getLocksStatus(uint256[] memory ids)
|
||||
function getLocksStatus(
|
||||
uint256[] memory ids
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (uint256[] memory, DT.LockStatus[] memory)
|
||||
|
||||
55
eslint.config.js
Normal file
55
eslint.config.js
Normal file
@@ -0,0 +1,55 @@
|
||||
const tseslint = require("typescript-eslint");
|
||||
const js = require("@eslint/js");
|
||||
const eslintConfigPrettier = require("eslint-config-prettier");
|
||||
|
||||
module.exports = tseslint.config(
|
||||
{
|
||||
ignores: [
|
||||
".yarn/",
|
||||
"**/.coverage_artifacts",
|
||||
"**/.coverage_cache",
|
||||
"**/.coverage_contracts",
|
||||
"**/artifacts",
|
||||
"**/build",
|
||||
"**/cache",
|
||||
"**/coverage",
|
||||
"**/dist",
|
||||
"**/node_modules",
|
||||
"**/types",
|
||||
"deploys/old/",
|
||||
"docs/",
|
||||
"*.env",
|
||||
"*.log",
|
||||
".pnp.*",
|
||||
"coverage.json",
|
||||
"npm-debug.log*",
|
||||
"yarn-debug.log*",
|
||||
"yarn-error.log*",
|
||||
".solcover.js",
|
||||
"eslint.config.js",
|
||||
],
|
||||
},
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
eslintConfigPrettier,
|
||||
{
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
"@typescript-eslint/no-floating-promises": [
|
||||
"error",
|
||||
{ ignoreIIFE: true, ignoreVoid: true },
|
||||
],
|
||||
"@typescript-eslint/no-inferrable-types": "off",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{ argsIgnorePattern: "_", varsIgnorePattern: "_" },
|
||||
],
|
||||
"@typescript-eslint/no-unused-expressions": "off",
|
||||
},
|
||||
},
|
||||
);
|
||||
@@ -15,8 +15,10 @@ dotenvConfig({ path: resolve(__dirname, "./.env") });
|
||||
const DEFAULT_MNEMONIC =
|
||||
"test test test test test test test test test test test junk";
|
||||
|
||||
const mnemonic: string = process.env.MNEMONIC ?? DEFAULT_MNEMONIC;
|
||||
const alchemyApiKey: string | undefined = process.env.ALCHEMY_API_KEY;
|
||||
const mnemonic: string =
|
||||
process.env.MNEMONIC ?? DEFAULT_MNEMONIC;
|
||||
const alchemyApiKey: string | undefined =
|
||||
process.env.ALCHEMY_API_KEY;
|
||||
|
||||
const chainIds = {
|
||||
// "{INSERT_NAME}": {INSERT_ID},
|
||||
@@ -33,7 +35,12 @@ const chainIds = {
|
||||
function getChainConfig(
|
||||
chain: keyof typeof chainIds,
|
||||
): NetworkUserConfig {
|
||||
let jsonRpcUrl =
|
||||
if (!alchemyApiKey) {
|
||||
throw new Error(
|
||||
`Please set ALCHEMY_API_KEY in a .env file before targeting ${chain}`,
|
||||
);
|
||||
}
|
||||
const jsonRpcUrl =
|
||||
"https://" + chain + ".g.alchemy.com/v2/" + alchemyApiKey;
|
||||
return {
|
||||
accounts: {
|
||||
@@ -136,7 +143,7 @@ const config: HardhatUserConfig = {
|
||||
},
|
||||
docgen: {
|
||||
pages: "files",
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"coverage": "hardhat coverage --solcoverjs ./.solcover.js --temp artifacts --testfiles \"test/**/*.ts\" && yarn typechain",
|
||||
"lint": "yarn lint:sol && yarn lint:ts && yarn prettier:check",
|
||||
"lint:sol": "solhint --config ./.solhint.json --max-warnings 0 \"contracts/**/*.sol\"",
|
||||
"lint:ts": "eslint --config ./.eslintrc.yaml --ignore-path ./.eslintignore --ext .js,.ts .",
|
||||
"lint:ts": "eslint .",
|
||||
"prettier": "prettier --config ./.prettierrc.yaml --write \"**/*.{js,json,md,sol,ts,yaml,yml}\"",
|
||||
"prettier:check": "prettier --check --config ./.prettierrc.yaml \"**/*.{js,json,md,sol,ts,yaml,yml}\""
|
||||
},
|
||||
@@ -54,13 +54,14 @@
|
||||
"mocha": "^10.8.2",
|
||||
"prettier": "^3.0.0",
|
||||
"prettier-plugin-solidity": "^1.0.0",
|
||||
"solhint": "^5.0.0",
|
||||
"solhint": "^6.2.1",
|
||||
"solhint-plugin-prettier": "^0.1.0",
|
||||
"solidity-coverage": "^0.8.16",
|
||||
"solidity-docgen": "^0.6.0-beta.36",
|
||||
"ts-node": "^10.9.2",
|
||||
"typechain": "^8.3.2",
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-eslint": "^8.60.0",
|
||||
"viem": "^2.33.1"
|
||||
},
|
||||
"files": [
|
||||
|
||||
@@ -20,12 +20,22 @@ const main = async () => {
|
||||
}
|
||||
|
||||
const [deployer] = await ethers.getSigners();
|
||||
console.log(`Signing transactions with ${deployer.address}`);
|
||||
console.log(
|
||||
`Signing transactions with ${deployer.address}`,
|
||||
);
|
||||
|
||||
const iface = new ethers.utils.Interface(P2PIX__factory.abi);
|
||||
const calldata = iface.encodeFunctionData("setDefaultLockBlocks", ["10000"]);
|
||||
|
||||
const tx = await deployer.sendTransaction({to:deploysJson.p2pix, data: calldata});
|
||||
const iface = new ethers.utils.Interface(
|
||||
P2PIX__factory.abi,
|
||||
);
|
||||
const calldata = iface.encodeFunctionData(
|
||||
"setDefaultLockBlocks",
|
||||
["10000"],
|
||||
);
|
||||
|
||||
const tx = await deployer.sendTransaction({
|
||||
to: deploysJson.p2pix,
|
||||
data: calldata,
|
||||
});
|
||||
const done = await tx.wait();
|
||||
console.log(done.transactionHash);
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import "@nomicfoundation/hardhat-chai-matchers";
|
||||
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
||||
import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
|
||||
import { expect } from "chai";
|
||||
import { ethers, network } from "hardhat";
|
||||
|
||||
@@ -8,14 +7,11 @@ import { Reputation } from "../src/types";
|
||||
import { curve, repFixture } from "./utils/fixtures";
|
||||
|
||||
describe("Reputation", () => {
|
||||
// contract deployer/admin
|
||||
let owner: SignerWithAddress;
|
||||
// Reputation Interface instance;
|
||||
let reputation: Reputation;
|
||||
|
||||
before("Set signers and reset network", async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[owner] = await ethers.getSigners();
|
||||
await ethers.getSigners();
|
||||
|
||||
await network.provider.send("hardhat_reset");
|
||||
});
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable no-useless-escape */
|
||||
|
||||
describe("_", () => {
|
||||
console.log(
|
||||
"/// ______ __\r\n/// .-----.|__ |.-----.|__|.--.--.\r\n/// | _ || __|| _ || ||_ _|\r\n/// | __||______|| __||__||__.__|\r\n/// |__| |__|\r\n///",
|
||||
|
||||
1085
test/p2pix.test.ts
1085
test/p2pix.test.ts
File diff suppressed because it is too large
Load Diff
@@ -4,15 +4,13 @@ import { ethers } from "hardhat";
|
||||
import keccak256 from "keccak256";
|
||||
import { MerkleTree } from "merkletreejs";
|
||||
|
||||
import {
|
||||
MockToken,
|
||||
Multicall,
|
||||
P2PIX,
|
||||
P2PIX__factory,
|
||||
Reputation,
|
||||
} from "../../src/types";
|
||||
import { MockToken, P2PIX__factory } from "../../src/types";
|
||||
|
||||
import { Call, RepFixture, P2PixAndReputation, DepositArgs, LockArgs, ReleaseArgs } from "./interfaces";
|
||||
import {
|
||||
Call,
|
||||
RepFixture,
|
||||
P2PixAndReputation,
|
||||
} from "./interfaces";
|
||||
|
||||
// exported constants
|
||||
export const getSignerAddrs = (
|
||||
@@ -22,18 +20,16 @@ export const getSignerAddrs = (
|
||||
return addrs.slice(0, amount).map(({ address }) => address);
|
||||
};
|
||||
|
||||
export const getBnFrom = (nums: number[]): BigInt[] => {
|
||||
export const getBnFrom = (nums: number[]): bigint[] => {
|
||||
const bns = nums.map(num => BigInt(num));
|
||||
return bns;
|
||||
};
|
||||
|
||||
export const getLockData = (
|
||||
addr: string,
|
||||
locks: BigInt[][],
|
||||
locks: bigint[][],
|
||||
): Call[] => {
|
||||
const iface = new ethers.Interface(
|
||||
P2PIX__factory.abi,
|
||||
);
|
||||
const iface = new ethers.Interface(P2PIX__factory.abi);
|
||||
return locks.map(lock => ({
|
||||
target: addr,
|
||||
callData: iface.encodeFunctionData("getLocksStatus", [
|
||||
@@ -71,8 +67,9 @@ export const curve = (x: number): number => {
|
||||
|
||||
// exported async functions
|
||||
export async function repFixture(): Promise<RepFixture> {
|
||||
const reputation = await ethers.deployContract("Reputation");
|
||||
return { reputation: await reputation.waitForDeployment() };
|
||||
const reputation =
|
||||
await ethers.deployContract("Reputation");
|
||||
return { reputation: await reputation.waitForDeployment() };
|
||||
}
|
||||
|
||||
export async function p2pixFixture(): Promise<P2PixAndReputation> {
|
||||
@@ -81,11 +78,12 @@ export async function p2pixFixture(): Promise<P2PixAndReputation> {
|
||||
await ethers.getSigners(),
|
||||
);
|
||||
|
||||
const reputation = await ethers.deployContract("Reputation");
|
||||
const reputation =
|
||||
await ethers.deployContract("Reputation");
|
||||
|
||||
const erc20 = await ethers.deployContract("MockToken", [
|
||||
ethers.parseEther("20000000") // 20M
|
||||
]) as MockToken;
|
||||
const erc20 = (await ethers.deployContract("MockToken", [
|
||||
ethers.parseEther("20000000"), // 20M
|
||||
])) as MockToken;
|
||||
|
||||
const p2pix = await ethers.deployContract("P2PIX", [
|
||||
10,
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
Reputation,
|
||||
} from "../../src/types";
|
||||
|
||||
|
||||
// exported interfaces
|
||||
export interface Deploys {
|
||||
signers: string[];
|
||||
@@ -17,29 +16,29 @@ export interface DepositArgs {
|
||||
pixTarget: string;
|
||||
allowlistRoot: string;
|
||||
token: string;
|
||||
amount: BigInt;
|
||||
amount: bigint;
|
||||
valid: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export interface LockArgs {
|
||||
seller: string;
|
||||
token: string;
|
||||
amount: BigInt;
|
||||
amount: bigint;
|
||||
merkleProof: string[];
|
||||
expiredLocks: BigInt[];
|
||||
expiredLocks: bigint[];
|
||||
}
|
||||
|
||||
export interface ReleaseArgs {
|
||||
lockID: BigInt;
|
||||
lockID: bigint;
|
||||
pixTimestamp: string;
|
||||
signature: string;
|
||||
}
|
||||
|
||||
export interface Lock {
|
||||
counter: BigInt;
|
||||
expirationBlock: BigInt;
|
||||
counter: bigint;
|
||||
expirationBlock: bigint;
|
||||
pixTarget: string;
|
||||
amount: BigInt;
|
||||
amount: bigint;
|
||||
token: string;
|
||||
buyerAddress: string;
|
||||
seller: string;
|
||||
@@ -72,4 +71,4 @@ export interface MtcFixture {
|
||||
|
||||
export type P2PixAndReputation = P2pixFixture &
|
||||
RepFixture &
|
||||
MtcFixture;
|
||||
MtcFixture;
|
||||
|
||||
376
yarn.lock
376
yarn.lock
@@ -64,6 +64,17 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@eslint-community/eslint-utils@npm:^4.9.1":
|
||||
version: 4.9.1
|
||||
resolution: "@eslint-community/eslint-utils@npm:4.9.1"
|
||||
dependencies:
|
||||
eslint-visitor-keys: "npm:^3.4.3"
|
||||
peerDependencies:
|
||||
eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
|
||||
checksum: 10/863b5467868551c9ae34d03eefe634633d08f623fc7b19d860f8f26eb6f303c1a5934253124163bee96181e45ed22bf27473dccc295937c3078493a4a8c9eddd
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@eslint-community/regexpp@npm:^4.12.1":
|
||||
version: 4.12.1
|
||||
resolution: "@eslint-community/regexpp@npm:4.12.1"
|
||||
@@ -71,6 +82,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@eslint-community/regexpp@npm:^4.12.2":
|
||||
version: 4.12.2
|
||||
resolution: "@eslint-community/regexpp@npm:4.12.2"
|
||||
checksum: 10/049b280fddf71dd325514e0a520024969431dc3a8b02fa77476e6820e9122f28ab4c9168c11821f91a27982d2453bcd7a66193356ea84e84fb7c8d793be1ba0c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@eslint/config-array@npm:^0.21.0":
|
||||
version: 0.21.0
|
||||
resolution: "@eslint/config-array@npm:0.21.0"
|
||||
@@ -1229,7 +1247,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@solidity-parser/parser@npm:^0.20.0, @solidity-parser/parser@npm:^0.20.1":
|
||||
"@solidity-parser/parser@npm:^0.20.1, @solidity-parser/parser@npm:^0.20.2":
|
||||
version: 0.20.2
|
||||
resolution: "@solidity-parser/parser@npm:0.20.2"
|
||||
checksum: 10/405009cd712cc410df60e45510ddd2ca615d208b152903be71cef4b9440720287ffd3792f88a92eb0de375c2ea66b442e84c843cb810612d6b6e45fd51a2b49b
|
||||
@@ -1439,6 +1457,141 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/eslint-plugin@npm:8.60.0":
|
||||
version: 8.60.0
|
||||
resolution: "@typescript-eslint/eslint-plugin@npm:8.60.0"
|
||||
dependencies:
|
||||
"@eslint-community/regexpp": "npm:^4.12.2"
|
||||
"@typescript-eslint/scope-manager": "npm:8.60.0"
|
||||
"@typescript-eslint/type-utils": "npm:8.60.0"
|
||||
"@typescript-eslint/utils": "npm:8.60.0"
|
||||
"@typescript-eslint/visitor-keys": "npm:8.60.0"
|
||||
ignore: "npm:^7.0.5"
|
||||
natural-compare: "npm:^1.4.0"
|
||||
ts-api-utils: "npm:^2.5.0"
|
||||
peerDependencies:
|
||||
"@typescript-eslint/parser": ^8.60.0
|
||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||
typescript: ">=4.8.4 <6.1.0"
|
||||
checksum: 10/aec6f08be04ad0014c80e5cf3bd8ec83d59c44244c9ca357c4cf182b6f0debdd690e64daa88215e937183e97c4bdee6749dbf4162191c5851ae9c648439c8a96
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/parser@npm:8.60.0":
|
||||
version: 8.60.0
|
||||
resolution: "@typescript-eslint/parser@npm:8.60.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager": "npm:8.60.0"
|
||||
"@typescript-eslint/types": "npm:8.60.0"
|
||||
"@typescript-eslint/typescript-estree": "npm:8.60.0"
|
||||
"@typescript-eslint/visitor-keys": "npm:8.60.0"
|
||||
debug: "npm:^4.4.3"
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||
typescript: ">=4.8.4 <6.1.0"
|
||||
checksum: 10/f55fa3547e3d0a0ec88bcb886b9bf6cef9b425c016dfa47e2ad7fbcbaa854640ba3f501cc0115824b58f33be4bf8bdf544505847988688906d11c154b600c54d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/project-service@npm:8.60.0":
|
||||
version: 8.60.0
|
||||
resolution: "@typescript-eslint/project-service@npm:8.60.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/tsconfig-utils": "npm:^8.60.0"
|
||||
"@typescript-eslint/types": "npm:^8.60.0"
|
||||
debug: "npm:^4.4.3"
|
||||
peerDependencies:
|
||||
typescript: ">=4.8.4 <6.1.0"
|
||||
checksum: 10/21e233d1292775753861aad32b30448f9fb5508f53d5a12c8ce7e75613df236757377fa877c738cc858ac863f2f8259a1f63bfb15a32ee9c5476fe9b2d12fbb0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/scope-manager@npm:8.60.0":
|
||||
version: 8.60.0
|
||||
resolution: "@typescript-eslint/scope-manager@npm:8.60.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/types": "npm:8.60.0"
|
||||
"@typescript-eslint/visitor-keys": "npm:8.60.0"
|
||||
checksum: 10/c08274fdb38be51d2d655ee32bed271cfedf5f5775709da98b3d6cf5f7eb419e98228fb087b48f4a591f4dd71ebcb27a8bd716fa831442c7cad708288625e454
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/tsconfig-utils@npm:8.60.0, @typescript-eslint/tsconfig-utils@npm:^8.60.0":
|
||||
version: 8.60.0
|
||||
resolution: "@typescript-eslint/tsconfig-utils@npm:8.60.0"
|
||||
peerDependencies:
|
||||
typescript: ">=4.8.4 <6.1.0"
|
||||
checksum: 10/d82cac7dec0366c0e680d002b4d20bc2564a198a2d9a80099f4fa7ee2b2f394dd2d47df03f1c4b276c4de6c7b8684a50e7bad0ddd5b33907188e90cc203a9593
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/type-utils@npm:8.60.0":
|
||||
version: 8.60.0
|
||||
resolution: "@typescript-eslint/type-utils@npm:8.60.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/types": "npm:8.60.0"
|
||||
"@typescript-eslint/typescript-estree": "npm:8.60.0"
|
||||
"@typescript-eslint/utils": "npm:8.60.0"
|
||||
debug: "npm:^4.4.3"
|
||||
ts-api-utils: "npm:^2.5.0"
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||
typescript: ">=4.8.4 <6.1.0"
|
||||
checksum: 10/4b29dcc1ee7a006b2df8a50700b43701bedd4f8380e94311a8988102d98fdd89244c233a8063a800cbdee86278bdc98874bfa6a8a3c71f1b278be1be6698961b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/types@npm:8.60.0, @typescript-eslint/types@npm:^8.60.0":
|
||||
version: 8.60.0
|
||||
resolution: "@typescript-eslint/types@npm:8.60.0"
|
||||
checksum: 10/8c6967503b3a370af10fea7bfec9adc7a4152e0e8aaa72ee790f105f08721683f6e8829acf610de82bfcdeb56bdf07f6795ccec394edbdac222fd3a1d76fe9cd
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/typescript-estree@npm:8.60.0":
|
||||
version: 8.60.0
|
||||
resolution: "@typescript-eslint/typescript-estree@npm:8.60.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/project-service": "npm:8.60.0"
|
||||
"@typescript-eslint/tsconfig-utils": "npm:8.60.0"
|
||||
"@typescript-eslint/types": "npm:8.60.0"
|
||||
"@typescript-eslint/visitor-keys": "npm:8.60.0"
|
||||
debug: "npm:^4.4.3"
|
||||
minimatch: "npm:^10.2.2"
|
||||
semver: "npm:^7.7.3"
|
||||
tinyglobby: "npm:^0.2.15"
|
||||
ts-api-utils: "npm:^2.5.0"
|
||||
peerDependencies:
|
||||
typescript: ">=4.8.4 <6.1.0"
|
||||
checksum: 10/ad02384fd48152a7d9bb5db1aa5d6cbda1cfa9e549a2d529d801ec1401d1d7d011c5e071f5b4d99c5ed656c95e5e97c46a783b45dcc7c016df7fee37ab5bdc0a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/utils@npm:8.60.0":
|
||||
version: 8.60.0
|
||||
resolution: "@typescript-eslint/utils@npm:8.60.0"
|
||||
dependencies:
|
||||
"@eslint-community/eslint-utils": "npm:^4.9.1"
|
||||
"@typescript-eslint/scope-manager": "npm:8.60.0"
|
||||
"@typescript-eslint/types": "npm:8.60.0"
|
||||
"@typescript-eslint/typescript-estree": "npm:8.60.0"
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||
typescript: ">=4.8.4 <6.1.0"
|
||||
checksum: 10/9fc8bc7a62deacd3823d957de8e8ca2012ffa90715734cd89d0e3a62c2c9e2775d3ba9da80e419339893a44af8674d690488cb195c981e8de9fd9dfa4948956d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/visitor-keys@npm:8.60.0":
|
||||
version: 8.60.0
|
||||
resolution: "@typescript-eslint/visitor-keys@npm:8.60.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/types": "npm:8.60.0"
|
||||
eslint-visitor-keys: "npm:^5.0.0"
|
||||
checksum: 10/4854d08416e2c97837cc1ecf8dacb50b3337ebb34bd6d703ad40b6585fdf78243074e56994ddc90650586146cebd6ad7390b6fa3ddda4e3532be4b872dd8f541
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"abbrev@npm:1, abbrev@npm:1.0.x":
|
||||
version: 1.0.9
|
||||
resolution: "abbrev@npm:1.0.9"
|
||||
@@ -1550,12 +1703,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ajv-errors@npm:^1.0.1":
|
||||
version: 1.0.1
|
||||
resolution: "ajv-errors@npm:1.0.1"
|
||||
"ajv-errors@npm:^3.0.0":
|
||||
version: 3.0.0
|
||||
resolution: "ajv-errors@npm:3.0.0"
|
||||
peerDependencies:
|
||||
ajv: ">=5.0.0"
|
||||
checksum: 10/7d8907f7ff3df7cb5b224ddd95c43ebd3d8bac3fd74fe942d644adc68ed3f67d5bb971b897ab8d21607a1ecf6071a987024b96439e040c9fd45625a9b87da1bb
|
||||
ajv: ^8.0.1
|
||||
checksum: 10/bd3403f8547dc12f7417c40b6a003f6d891c0123e365b4b3cd9fffb0edd29100ae682b92ef47dcb3a3b4642a702a246873d3758c3fb92e24dfa3443f97476421
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1571,18 +1724,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ajv@npm:^6.12.6":
|
||||
version: 6.15.0
|
||||
resolution: "ajv@npm:6.15.0"
|
||||
dependencies:
|
||||
fast-deep-equal: "npm:^3.1.1"
|
||||
fast-json-stable-stringify: "npm:^2.0.0"
|
||||
json-schema-traverse: "npm:^0.4.1"
|
||||
uri-js: "npm:^4.2.2"
|
||||
checksum: 10/0916dda09c152fb5857bc1cc7ce61718e9cec5b7faeff44a74f5e324eed8a556e1a84856724ea322a067b436ecad9f74ac8295fd395449788cca52f0c25bd5fb
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ajv@npm:^8.0.1":
|
||||
version: 8.17.1
|
||||
resolution: "ajv@npm:8.17.1"
|
||||
@@ -1595,6 +1736,18 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ajv@npm:^8.18.0":
|
||||
version: 8.20.0
|
||||
resolution: "ajv@npm:8.20.0"
|
||||
dependencies:
|
||||
fast-deep-equal: "npm:^3.1.3"
|
||||
fast-uri: "npm:^3.0.1"
|
||||
json-schema-traverse: "npm:^1.0.0"
|
||||
require-from-string: "npm:^2.0.2"
|
||||
checksum: 10/5ce59c0537f4c2aca9a758b412659ec70acb4d5dde971c10ecf21d2e3d799f99acdb4a08e1f5fb2e067c8542930398aae793bb996bb07d3feb81dae22fe2ada9
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"amdefine@npm:>=0.0.4":
|
||||
version: 1.0.1
|
||||
resolution: "amdefine@npm:1.0.1"
|
||||
@@ -1666,13 +1819,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"antlr4@npm:^4.13.1-patch-1":
|
||||
version: 4.13.2
|
||||
resolution: "antlr4@npm:4.13.2"
|
||||
checksum: 10/23ab4742ec937adaaf20d13228c8cca58638e1aafeb28919bdeb4860776a403d0c7eb85a3f07fadc27fc03f773eed6bcc82bd8369b9d0e258e6502ba514cf87e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"anymatch@npm:~3.1.2":
|
||||
version: 3.1.3
|
||||
resolution: "anymatch@npm:3.1.3"
|
||||
@@ -1787,6 +1933,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"balanced-match@npm:^4.0.2":
|
||||
version: 4.0.4
|
||||
resolution: "balanced-match@npm:4.0.4"
|
||||
checksum: 10/fb07bb66a0959c2843fc055838047e2a95ccebb837c519614afb067ebfdf2fa967ca8d712c35ced07f2cd26fc6f07964230b094891315ad74f11eba3d53178a0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"base-x@npm:^3.0.2":
|
||||
version: 3.0.11
|
||||
resolution: "base-x@npm:3.0.11"
|
||||
@@ -1895,6 +2048,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"brace-expansion@npm:^5.0.5":
|
||||
version: 5.0.6
|
||||
resolution: "brace-expansion@npm:5.0.6"
|
||||
dependencies:
|
||||
balanced-match: "npm:^4.0.2"
|
||||
checksum: 10/a7acf120fefa79e9d7c9c92898114f57c07596a3920197f3c5917e6a628b04220a5f7f9618c30bdd973a6576a32113b99f9c3f1c8245ccc399dd2a9a718d81d8
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"braces@npm:^3.0.3, braces@npm:~3.0.2":
|
||||
version: 3.0.3
|
||||
resolution: "braces@npm:3.0.3"
|
||||
@@ -2439,6 +2601,18 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"debug@npm:^4.4.3":
|
||||
version: 4.4.3
|
||||
resolution: "debug@npm:4.4.3"
|
||||
dependencies:
|
||||
ms: "npm:^2.1.3"
|
||||
peerDependenciesMeta:
|
||||
supports-color:
|
||||
optional: true
|
||||
checksum: 10/9ada3434ea2993800bd9a1e320bd4aa7af69659fb51cca685d390949434bc0a8873c21ed7c9b852af6f2455a55c6d050aa3937d52b3c69f796dab666f762acad
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"decamelize@npm:^4.0.0":
|
||||
version: 4.0.0
|
||||
resolution: "decamelize@npm:4.0.0"
|
||||
@@ -2737,6 +2911,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"eslint-visitor-keys@npm:^5.0.0":
|
||||
version: 5.0.1
|
||||
resolution: "eslint-visitor-keys@npm:5.0.1"
|
||||
checksum: 10/f9cc1a57b75e0ef949545cac33d01e8367e302de4c1483266ed4d8646ee5c306376660196bbb38b004e767b7043d1e661cb4336b49eff634a1bbe75c1db709ec
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"eslint@npm:^9.32.0":
|
||||
version: 9.32.0
|
||||
resolution: "eslint@npm:9.32.0"
|
||||
@@ -3045,6 +3226,18 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fdir@npm:^6.5.0":
|
||||
version: 6.5.0
|
||||
resolution: "fdir@npm:6.5.0"
|
||||
peerDependencies:
|
||||
picomatch: ^3 || ^4
|
||||
peerDependenciesMeta:
|
||||
picomatch:
|
||||
optional: true
|
||||
checksum: 10/14ca1c9f0a0e8f4f2e9bf4e8551065a164a09545dae548c12a18d238b72e51e5a7b39bd8e5494b56463a0877672d0a6c1ef62c6fa0677db1b0c847773be939b1
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"file-entry-cache@npm:^8.0.0":
|
||||
version: 8.0.0
|
||||
resolution: "file-entry-cache@npm:8.0.0"
|
||||
@@ -3166,17 +3359,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fs-extra@npm:^11.1.0":
|
||||
version: 11.3.5
|
||||
resolution: "fs-extra@npm:11.3.5"
|
||||
dependencies:
|
||||
graceful-fs: "npm:^4.2.0"
|
||||
jsonfile: "npm:^6.0.1"
|
||||
universalify: "npm:^2.0.0"
|
||||
checksum: 10/dc8408818eec8b03efad8742d079ecab749a2f7bc9f208e429b447fcac7632fae52e09312d6d42218efe7e2efa97f03ff232d639ade4aa7fcd8c00ebe9ad0c0c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fs-extra@npm:^7.0.0, fs-extra@npm:^7.0.1":
|
||||
version: 7.0.1
|
||||
resolution: "fs-extra@npm:7.0.1"
|
||||
@@ -3362,6 +3544,17 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"glob@npm:^13.0.6":
|
||||
version: 13.0.6
|
||||
resolution: "glob@npm:13.0.6"
|
||||
dependencies:
|
||||
minimatch: "npm:^10.2.2"
|
||||
minipass: "npm:^7.1.3"
|
||||
path-scurry: "npm:^2.0.2"
|
||||
checksum: 10/201ad69e5f0aa74e1d8c00a481581f8b8c804b6a4fbfabeeb8541f5d756932800331daeba99b58fb9e4cd67e12ba5a7eba5b82fb476691588418060b84353214
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"glob@npm:^5.0.15":
|
||||
version: 5.0.15
|
||||
resolution: "glob@npm:5.0.15"
|
||||
@@ -3389,7 +3582,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"glob@npm:^8.0.3, glob@npm:^8.1.0":
|
||||
"glob@npm:^8.1.0":
|
||||
version: 8.1.0
|
||||
resolution: "glob@npm:8.1.0"
|
||||
dependencies:
|
||||
@@ -3784,6 +3977,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ignore@npm:^7.0.5":
|
||||
version: 7.0.5
|
||||
resolution: "ignore@npm:7.0.5"
|
||||
checksum: 10/f134b96a4de0af419196f52c529d5c6120c4456ff8a6b5a14ceaaa399f883e15d58d2ce651c9b69b9388491d4669dda47285d307e827de9304a53a1824801bc6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"immer@npm:10.0.2":
|
||||
version: 10.0.2
|
||||
resolution: "immer@npm:10.0.2"
|
||||
@@ -4296,6 +4496,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"lru-cache@npm:^11.0.0":
|
||||
version: 11.5.1
|
||||
resolution: "lru-cache@npm:11.5.1"
|
||||
checksum: 10/02c4f73967d91fb101f4accf8ebac9e0541e08e16d987bdb9e9737f13e5f2c4bc33c593b98ec30e4486bf899bc97edb36fbd133684b36087336559e41edafdea
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"lru-cache@npm:^6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "lru-cache@npm:6.0.0"
|
||||
@@ -4480,6 +4687,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"minimatch@npm:^10.2.2":
|
||||
version: 10.2.5
|
||||
resolution: "minimatch@npm:10.2.5"
|
||||
dependencies:
|
||||
brace-expansion: "npm:^5.0.5"
|
||||
checksum: 10/19e87a931aff60ee7b9d80f39f817b8bfc54f61f8356ee3549fbf636dbccacacfec8d803eac73293955c4527cd085247dfc064bce4a5e349f8f3b85e2bf5da0f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"minimatch@npm:^5.0.1, minimatch@npm:^5.1.6":
|
||||
version: 5.1.6
|
||||
resolution: "minimatch@npm:5.1.6"
|
||||
@@ -4572,6 +4788,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"minipass@npm:^7.1.3":
|
||||
version: 7.1.3
|
||||
resolution: "minipass@npm:7.1.3"
|
||||
checksum: 10/175e4d5e20980c3cd316ae82d2c031c42f6c746467d8b1905b51060a0ba4461441a0c25bb67c025fd9617f9a3873e152c7b543c6b5ac83a1846be8ade80dffd6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"minizlib@npm:^3.0.1":
|
||||
version: 3.0.2
|
||||
resolution: "minizlib@npm:3.0.2"
|
||||
@@ -4959,13 +5182,14 @@ __metadata:
|
||||
mocha: "npm:^10.8.2"
|
||||
prettier: "npm:^3.0.0"
|
||||
prettier-plugin-solidity: "npm:^1.0.0"
|
||||
solhint: "npm:^5.0.0"
|
||||
solhint: "npm:^6.2.1"
|
||||
solhint-plugin-prettier: "npm:^0.1.0"
|
||||
solidity-coverage: "npm:^0.8.16"
|
||||
solidity-docgen: "npm:^0.6.0-beta.36"
|
||||
ts-node: "npm:^10.9.2"
|
||||
typechain: "npm:^8.3.2"
|
||||
typescript: "npm:^5.8.3"
|
||||
typescript-eslint: "npm:^8.60.0"
|
||||
viem: "npm:^2.33.1"
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
@@ -5048,6 +5272,16 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"path-scurry@npm:^2.0.2":
|
||||
version: 2.0.2
|
||||
resolution: "path-scurry@npm:2.0.2"
|
||||
dependencies:
|
||||
lru-cache: "npm:^11.0.0"
|
||||
minipass: "npm:^7.1.2"
|
||||
checksum: 10/2b4257422bcb870a4c2d205b3acdbb213a72f5e2250f61c80f79c9d014d010f82bdf8584441612c8e1fa4eb098678f5704a66fa8377d72646bad4be38e57a2c3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"path-type@npm:^4.0.0":
|
||||
version: 4.0.0
|
||||
resolution: "path-type@npm:4.0.0"
|
||||
@@ -5096,6 +5330,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"picomatch@npm:^4.0.4":
|
||||
version: 4.0.4
|
||||
resolution: "picomatch@npm:4.0.4"
|
||||
checksum: 10/f6ef80a3590827ce20378ae110ac78209cc4f74d39236370f1780f957b7ee41c12acde0e4651b90f39983506fd2f5e449994716f516db2e9752924aff8de93ce
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"pify@npm:^4.0.1":
|
||||
version: 4.0.1
|
||||
resolution: "pify@npm:4.0.1"
|
||||
@@ -5145,7 +5386,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"prettier@npm:^2.3.1, prettier@npm:^2.8.3":
|
||||
"prettier@npm:^2.3.1":
|
||||
version: 2.8.8
|
||||
resolution: "prettier@npm:2.8.8"
|
||||
bin:
|
||||
@@ -5545,7 +5786,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"semver@npm:^7.3.7, semver@npm:^7.5.2, semver@npm:^7.7.1":
|
||||
"semver@npm:^7.3.7, semver@npm:^7.5.2, semver@npm:^7.7.1, semver@npm:^7.7.3":
|
||||
version: 7.8.1
|
||||
resolution: "semver@npm:7.8.1"
|
||||
bin:
|
||||
@@ -5718,30 +5959,27 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"solhint@npm:^5.0.0":
|
||||
version: 5.2.0
|
||||
resolution: "solhint@npm:5.2.0"
|
||||
"solhint@npm:^6.2.1":
|
||||
version: 6.2.1
|
||||
resolution: "solhint@npm:6.2.1"
|
||||
dependencies:
|
||||
"@solidity-parser/parser": "npm:^0.20.0"
|
||||
ajv: "npm:^6.12.6"
|
||||
ajv-errors: "npm:^1.0.1"
|
||||
antlr4: "npm:^4.13.1-patch-1"
|
||||
"@solidity-parser/parser": "npm:^0.20.2"
|
||||
ajv: "npm:^8.18.0"
|
||||
ajv-errors: "npm:^3.0.0"
|
||||
ast-parents: "npm:^0.0.1"
|
||||
better-ajv-errors: "npm:^2.0.2"
|
||||
chalk: "npm:^4.1.2"
|
||||
commander: "npm:^10.0.0"
|
||||
cosmiconfig: "npm:^8.0.0"
|
||||
fast-diff: "npm:^1.2.0"
|
||||
fs-extra: "npm:^11.1.0"
|
||||
glob: "npm:^8.0.3"
|
||||
glob: "npm:^13.0.6"
|
||||
ignore: "npm:^5.2.4"
|
||||
js-yaml: "npm:^4.1.0"
|
||||
latest-version: "npm:^7.0.0"
|
||||
lodash: "npm:^4.17.21"
|
||||
pluralize: "npm:^8.0.0"
|
||||
prettier: "npm:^2.8.3"
|
||||
prettier: "npm:^3.0.0"
|
||||
semver: "npm:^7.5.2"
|
||||
strip-ansi: "npm:^6.0.1"
|
||||
table: "npm:^6.8.1"
|
||||
text-table: "npm:^0.2.0"
|
||||
dependenciesMeta:
|
||||
@@ -5749,7 +5987,7 @@ __metadata:
|
||||
optional: true
|
||||
bin:
|
||||
solhint: solhint.js
|
||||
checksum: 10/ccccfe72390989fe4e4827e9635ef41605f966a1efb835bb9c231b5e4b9edcd0ccd60602668aba3365c385e89f8ca383e32570cf1148f7a81e8bb44d69b5ddf7
|
||||
checksum: 10/b8edac2ee072034cbb2200a4146ce50bdb20839ed4772a72718f341766006753780c48a5292b6911b4f8398e046a905ae4ab0dd21101041449b8ada1f7c93b2f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -6057,6 +6295,16 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tinyglobby@npm:^0.2.15":
|
||||
version: 0.2.16
|
||||
resolution: "tinyglobby@npm:0.2.16"
|
||||
dependencies:
|
||||
fdir: "npm:^6.5.0"
|
||||
picomatch: "npm:^4.0.4"
|
||||
checksum: 10/5c2c41b572ada38449e7c86a5fe034f204a1dbba577225a761a14f29f48dc3f2fc0d81a6c56fcc67c5a742cc3aa9fb5e2ca18dbf22b610b0bc0e549b34d5a0f8
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tmp@npm:0.0.33":
|
||||
version: 0.0.33
|
||||
resolution: "tmp@npm:0.0.33"
|
||||
@@ -6089,6 +6337,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ts-api-utils@npm:^2.5.0":
|
||||
version: 2.5.0
|
||||
resolution: "ts-api-utils@npm:2.5.0"
|
||||
peerDependencies:
|
||||
typescript: ">=4.8.4"
|
||||
checksum: 10/d5f1936f5618c6ab6942a97b78802217540ced00e7501862ae1f578d9a3aa189fc06050e64cb8951d21f7088e5fd35f53d2bf0d0370a883861c7b05e993ebc44
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ts-command-line-args@npm:^2.2.0":
|
||||
version: 2.5.1
|
||||
resolution: "ts-command-line-args@npm:2.5.1"
|
||||
@@ -6239,6 +6496,21 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typescript-eslint@npm:^8.60.0":
|
||||
version: 8.60.0
|
||||
resolution: "typescript-eslint@npm:8.60.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/eslint-plugin": "npm:8.60.0"
|
||||
"@typescript-eslint/parser": "npm:8.60.0"
|
||||
"@typescript-eslint/typescript-estree": "npm:8.60.0"
|
||||
"@typescript-eslint/utils": "npm:8.60.0"
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0
|
||||
typescript: ">=4.8.4 <6.1.0"
|
||||
checksum: 10/625e49e6d06e32adcfe903087d1fb2adc3be925adafe1f4e57f690bb196b35e2aac01760a3d5e17a53ea2feb6fef3a13da4b8faa214f628ec56e64f99f20e4ad
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typescript@npm:^5.8.3":
|
||||
version: 5.8.3
|
||||
resolution: "typescript@npm:5.8.3"
|
||||
|
||||
Reference in New Issue
Block a user