Removed relayer logic
This commit is contained in:
parent
ce5f3e4265
commit
c927f741e6
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"_format": "hh-sol-dbg-1",
|
"_format": "hh-sol-dbg-1",
|
||||||
"buildInfo": "../../../build-info/e227c161b97af39988677e65180082ec.json"
|
"buildInfo": "../../../build-info/c96aab92784d63ce08c6b112913f46c8.json"
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
"contractName": "DataTypes",
|
"contractName": "DataTypes",
|
||||||
"sourceName": "contracts/core/DataTypes.sol",
|
"sourceName": "contracts/core/DataTypes.sol",
|
||||||
"abi": [],
|
"abi": [],
|
||||||
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea264697066735822122078bdfdfbb98192401098df5a6389aadd2cb5cf76b3e1f5af04f14038376f40f464736f6c63430008130033",
|
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea2646970667358221220ed19291aba408239fe7ce17eba420cb350ea83c88994bb2b37733371feac745f64736f6c63430008130033",
|
||||||
"deployedBytecode": "0x600080fdfea264697066735822122078bdfdfbb98192401098df5a6389aadd2cb5cf76b3e1f5af04f14038376f40f464736f6c63430008130033",
|
"deployedBytecode": "0x600080fdfea2646970667358221220ed19291aba408239fe7ce17eba420cb350ea83c88994bb2b37733371feac745f64736f6c63430008130033",
|
||||||
"linkReferences": {},
|
"linkReferences": {},
|
||||||
"deployedLinkReferences": {}
|
"deployedLinkReferences": {}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"_format": "hh-sol-dbg-1",
|
"_format": "hh-sol-dbg-1",
|
||||||
"buildInfo": "../../build-info/e227c161b97af39988677e65180082ec.json"
|
"buildInfo": "../../build-info/c96aab92784d63ce08c6b112913f46c8.json"
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@ -3,22 +3,15 @@ pragma solidity 0.8.19;
|
|||||||
|
|
||||||
library DataTypes {
|
library DataTypes {
|
||||||
struct Lock {
|
struct Lock {
|
||||||
|
uint80 amount;
|
||||||
|
uint160 pixTarget;
|
||||||
|
address token;
|
||||||
|
/// @dev Amount to be tranfered via PIX.
|
||||||
|
address buyerAddress;
|
||||||
uint256 sellerKey;
|
uint256 sellerKey;
|
||||||
uint256 counter;
|
uint256 counter;
|
||||||
/// @dev If not paid at this block will be expired.
|
/// @dev If not paid at this block will be expired.
|
||||||
uint256 expirationBlock;
|
uint256 expirationBlock;
|
||||||
uint160 pixTarget;
|
|
||||||
/// @dev Amount to be paid for relayer.
|
|
||||||
uint80 relayerPremium;
|
|
||||||
/// @dev Where the tokens are sent the when order gets validated.
|
|
||||||
/// @dev Amount to be tranfered via PIX.
|
|
||||||
uint80 amount;
|
|
||||||
address buyerAddress;
|
|
||||||
/// @dev Relayer address (msg.sender) that facilitated this transaction.
|
|
||||||
/// @dev Relayer's target address that receives `relayerPremium` funds.
|
|
||||||
/// @dev Reputation points accruer.
|
|
||||||
address relayerAddress;
|
|
||||||
address token;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -144,8 +144,6 @@ contract P2PIX is BaseUtils, ReentrancyGuard {
|
|||||||
/// @dev There can only exist a lock per each `_amount` partitioned
|
/// @dev There can only exist a lock per each `_amount` partitioned
|
||||||
/// from the total `remaining` value.
|
/// from the total `remaining` value.
|
||||||
/// @dev Locks can only be performed in valid orders.
|
/// @dev Locks can only be performed in valid orders.
|
||||||
/// @param _buyerAddress The address of the buyer of a `_depositID`.
|
|
||||||
/// @param _relayerPremium The refund/premium owed to a relayer.
|
|
||||||
/// @param _amount The deposit's remaining amount wished to be locked.
|
/// @param _amount The deposit's remaining amount wished to be locked.
|
||||||
/// @param merkleProof This value should be:
|
/// @param merkleProof This value should be:
|
||||||
/// - Provided as a pass if the `msg.sender` is in the seller's allowlist;
|
/// - Provided as a pass if the `msg.sender` is in the seller's allowlist;
|
||||||
@ -157,8 +155,6 @@ contract P2PIX is BaseUtils, ReentrancyGuard {
|
|||||||
function lock(
|
function lock(
|
||||||
address _seller,
|
address _seller,
|
||||||
address _token,
|
address _token,
|
||||||
address _buyerAddress,
|
|
||||||
uint80 _relayerPremium,
|
|
||||||
uint80 _amount,
|
uint80 _amount,
|
||||||
bytes32[] calldata merkleProof,
|
bytes32[] calldata merkleProof,
|
||||||
uint256[] calldata expiredLocks
|
uint256[] calldata expiredLocks
|
||||||
@ -180,15 +176,13 @@ contract P2PIX is BaseUtils, ReentrancyGuard {
|
|||||||
) revert NotExpired();
|
) revert NotExpired();
|
||||||
|
|
||||||
DT.Lock memory l = DT.Lock(
|
DT.Lock memory l = DT.Lock(
|
||||||
|
_amount,
|
||||||
|
uint160(sellerBalance(k, t) >> BITPOS_PIXTARGET),
|
||||||
|
address(t),
|
||||||
|
msg.sender,
|
||||||
k,
|
k,
|
||||||
cCounter,
|
cCounter,
|
||||||
(block.number + defaultLockBlocks),
|
(block.number + defaultLockBlocks)
|
||||||
uint160(sellerBalance(k, t) >> BITPOS_PIXTARGET),
|
|
||||||
_relayerPremium,
|
|
||||||
_amount,
|
|
||||||
_buyerAddress,
|
|
||||||
msg.sender,
|
|
||||||
address(t)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (merkleProof.length != 0) {
|
if (merkleProof.length != 0) {
|
||||||
@ -247,53 +241,28 @@ contract P2PIX is BaseUtils, ReentrancyGuard {
|
|||||||
|
|
||||||
ERC20 t = ERC20(l.token);
|
ERC20 t = ERC20(l.token);
|
||||||
|
|
||||||
|
/// @todo shouldi cache it tho: would it be cheaper to just keep reading from storage?
|
||||||
// We cache values before zeroing them out.
|
// We cache values before zeroing them out.
|
||||||
uint256 lockAmount = l.amount;
|
uint256 lockAmount = l.amount;
|
||||||
uint256 totalAmount = (lockAmount - l.relayerPremium);
|
// uint256 totalAmount = (lockAmount - l.relayerPremium);
|
||||||
|
|
||||||
l.amount = 0;
|
l.amount = 0;
|
||||||
l.expirationBlock = 0;
|
l.expirationBlock = 0;
|
||||||
_setUsedTransactions(message);
|
_setUsedTransactions(message);
|
||||||
|
|
||||||
if (msg.sender != l.relayerAddress) {
|
if (msg.sender != l.buyerAddress) {
|
||||||
userRecord[_castAddrToKey(msg.sender)] += l
|
userRecord[_castAddrToKey(msg.sender)] += (lockAmount >> 1);
|
||||||
.relayerPremium;
|
userRecord[_castAddrToKey(l.buyerAddress)] += (lockAmount >> 1);
|
||||||
userRecord[
|
|
||||||
_castAddrToKey(l.relayerAddress)
|
|
||||||
] += lockAmount;
|
|
||||||
} else {
|
} else {
|
||||||
userRecord[_castAddrToKey(msg.sender)] += (l
|
userRecord[_castAddrToKey(msg.sender)] += lockAmount;
|
||||||
.relayerPremium + lockAmount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeTransferLib.safeTransfer(
|
SafeTransferLib.safeTransfer(
|
||||||
t,
|
t,
|
||||||
l.buyerAddress,
|
l.buyerAddress,
|
||||||
totalAmount
|
lockAmount
|
||||||
);
|
);
|
||||||
|
|
||||||
// Method doesn't check for zero address.
|
|
||||||
if (l.relayerPremium != 0) {
|
|
||||||
if (msg.sender != l.relayerAddress) {
|
|
||||||
SafeTransferLib.safeTransfer(
|
|
||||||
t,
|
|
||||||
l.relayerAddress,
|
|
||||||
(l.relayerPremium >> 1)
|
|
||||||
);
|
|
||||||
SafeTransferLib.safeTransfer(
|
|
||||||
t,
|
|
||||||
msg.sender,
|
|
||||||
(l.relayerPremium >> 1)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
SafeTransferLib.safeTransfer(
|
|
||||||
t,
|
|
||||||
msg.sender,
|
|
||||||
l.relayerPremium
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
emit LockReleased(l.buyerAddress, lockID, lockAmount);
|
emit LockReleased(l.buyerAddress, lockID, lockAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,7 +283,8 @@ contract P2PIX is BaseUtils, ReentrancyGuard {
|
|||||||
|
|
||||||
_notExpired(l);
|
_notExpired(l);
|
||||||
|
|
||||||
uint256 _sellerBalance = sellerBalance(l.sellerKey, ERC20(l.token)) & BITMASK_SB_ENTRY;
|
uint256 _sellerBalance =
|
||||||
|
sellerBalance(l.sellerKey, ERC20(l.token)) & BITMASK_SB_ENTRY;
|
||||||
|
|
||||||
if ((_sellerBalance + l.amount) > MAXBALANCE_UPPERBOUND)
|
if ((_sellerBalance + l.amount) > MAXBALANCE_UPPERBOUND)
|
||||||
revert MaxBalExceeded();
|
revert MaxBalExceeded();
|
||||||
@ -324,7 +294,7 @@ contract P2PIX is BaseUtils, ReentrancyGuard {
|
|||||||
l.amount = 0;
|
l.amount = 0;
|
||||||
|
|
||||||
uint256 userKey = _castAddrToKey(
|
uint256 userKey = _castAddrToKey(
|
||||||
l.relayerAddress
|
l.buyerAddress
|
||||||
);
|
);
|
||||||
uint256 _newUserRecord = (userRecord[userKey] >>
|
uint256 _newUserRecord = (userRecord[userKey] >>
|
||||||
1);
|
1);
|
||||||
@ -429,6 +399,8 @@ contract P2PIX is BaseUtils, ReentrancyGuard {
|
|||||||
|
|
||||||
function _addLock(
|
function _addLock(
|
||||||
uint256 _bal,
|
uint256 _bal,
|
||||||
|
/// @todo cant i simply get the amount via the lock in storage? would it be cheaper than using
|
||||||
|
/// a function parameter?
|
||||||
uint256 _amount,
|
uint256 _amount,
|
||||||
uint256 _lockID,
|
uint256 _lockID,
|
||||||
DT.Lock memory _l,
|
DT.Lock memory _l,
|
||||||
|
File diff suppressed because one or more lines are too long
@ -39,7 +39,7 @@ export interface P2PIXInterface extends utils.Interface {
|
|||||||
"getLocksStatus(uint256[])": FunctionFragment;
|
"getLocksStatus(uint256[])": FunctionFragment;
|
||||||
"getPixTarget(address,address)": FunctionFragment;
|
"getPixTarget(address,address)": FunctionFragment;
|
||||||
"getValid(address,address)": FunctionFragment;
|
"getValid(address,address)": FunctionFragment;
|
||||||
"lock(address,address,address,uint80,uint80,bytes32[],uint256[])": FunctionFragment;
|
"lock(address,address,uint80,bytes32[],uint256[])": FunctionFragment;
|
||||||
"lockCounter()": FunctionFragment;
|
"lockCounter()": FunctionFragment;
|
||||||
"mapLocks(uint256)": FunctionFragment;
|
"mapLocks(uint256)": FunctionFragment;
|
||||||
"owner()": FunctionFragment;
|
"owner()": FunctionFragment;
|
||||||
@ -148,8 +148,6 @@ export interface P2PIXInterface extends utils.Interface {
|
|||||||
values: [
|
values: [
|
||||||
PromiseOrValue<string>,
|
PromiseOrValue<string>,
|
||||||
PromiseOrValue<string>,
|
PromiseOrValue<string>,
|
||||||
PromiseOrValue<string>,
|
|
||||||
PromiseOrValue<BigNumberish>,
|
|
||||||
PromiseOrValue<BigNumberish>,
|
PromiseOrValue<BigNumberish>,
|
||||||
PromiseOrValue<BytesLike>[],
|
PromiseOrValue<BytesLike>[],
|
||||||
PromiseOrValue<BigNumberish>[]
|
PromiseOrValue<BigNumberish>[]
|
||||||
@ -599,8 +597,6 @@ export interface P2PIX extends BaseContract {
|
|||||||
lock(
|
lock(
|
||||||
_seller: PromiseOrValue<string>,
|
_seller: PromiseOrValue<string>,
|
||||||
_token: PromiseOrValue<string>,
|
_token: PromiseOrValue<string>,
|
||||||
_buyerAddress: PromiseOrValue<string>,
|
|
||||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
|
||||||
_amount: PromiseOrValue<BigNumberish>,
|
_amount: PromiseOrValue<BigNumberish>,
|
||||||
merkleProof: PromiseOrValue<BytesLike>[],
|
merkleProof: PromiseOrValue<BytesLike>[],
|
||||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||||
@ -614,25 +610,21 @@ export interface P2PIX extends BaseContract {
|
|||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<
|
): Promise<
|
||||||
[
|
[
|
||||||
BigNumber,
|
|
||||||
BigNumber,
|
|
||||||
BigNumber,
|
|
||||||
BigNumber,
|
|
||||||
BigNumber,
|
BigNumber,
|
||||||
BigNumber,
|
BigNumber,
|
||||||
string,
|
string,
|
||||||
string,
|
string,
|
||||||
string
|
BigNumber,
|
||||||
|
BigNumber,
|
||||||
|
BigNumber
|
||||||
] & {
|
] & {
|
||||||
|
amount: BigNumber;
|
||||||
|
pixTarget: BigNumber;
|
||||||
|
token: string;
|
||||||
|
buyerAddress: string;
|
||||||
sellerKey: BigNumber;
|
sellerKey: BigNumber;
|
||||||
counter: BigNumber;
|
counter: BigNumber;
|
||||||
expirationBlock: BigNumber;
|
expirationBlock: BigNumber;
|
||||||
pixTarget: BigNumber;
|
|
||||||
relayerPremium: BigNumber;
|
|
||||||
amount: BigNumber;
|
|
||||||
buyerAddress: string;
|
|
||||||
relayerAddress: string;
|
|
||||||
token: string;
|
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
|
|
||||||
@ -788,8 +780,6 @@ export interface P2PIX extends BaseContract {
|
|||||||
lock(
|
lock(
|
||||||
_seller: PromiseOrValue<string>,
|
_seller: PromiseOrValue<string>,
|
||||||
_token: PromiseOrValue<string>,
|
_token: PromiseOrValue<string>,
|
||||||
_buyerAddress: PromiseOrValue<string>,
|
|
||||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
|
||||||
_amount: PromiseOrValue<BigNumberish>,
|
_amount: PromiseOrValue<BigNumberish>,
|
||||||
merkleProof: PromiseOrValue<BytesLike>[],
|
merkleProof: PromiseOrValue<BytesLike>[],
|
||||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||||
@ -802,26 +792,14 @@ export interface P2PIX extends BaseContract {
|
|||||||
arg0: PromiseOrValue<BigNumberish>,
|
arg0: PromiseOrValue<BigNumberish>,
|
||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<
|
): Promise<
|
||||||
[
|
[BigNumber, BigNumber, string, string, BigNumber, BigNumber, BigNumber] & {
|
||||||
BigNumber,
|
amount: BigNumber;
|
||||||
BigNumber,
|
pixTarget: BigNumber;
|
||||||
BigNumber,
|
token: string;
|
||||||
BigNumber,
|
buyerAddress: string;
|
||||||
BigNumber,
|
|
||||||
BigNumber,
|
|
||||||
string,
|
|
||||||
string,
|
|
||||||
string
|
|
||||||
] & {
|
|
||||||
sellerKey: BigNumber;
|
sellerKey: BigNumber;
|
||||||
counter: BigNumber;
|
counter: BigNumber;
|
||||||
expirationBlock: BigNumber;
|
expirationBlock: BigNumber;
|
||||||
pixTarget: BigNumber;
|
|
||||||
relayerPremium: BigNumber;
|
|
||||||
amount: BigNumber;
|
|
||||||
buyerAddress: string;
|
|
||||||
relayerAddress: string;
|
|
||||||
token: string;
|
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
|
|
||||||
@ -977,8 +955,6 @@ export interface P2PIX extends BaseContract {
|
|||||||
lock(
|
lock(
|
||||||
_seller: PromiseOrValue<string>,
|
_seller: PromiseOrValue<string>,
|
||||||
_token: PromiseOrValue<string>,
|
_token: PromiseOrValue<string>,
|
||||||
_buyerAddress: PromiseOrValue<string>,
|
|
||||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
|
||||||
_amount: PromiseOrValue<BigNumberish>,
|
_amount: PromiseOrValue<BigNumberish>,
|
||||||
merkleProof: PromiseOrValue<BytesLike>[],
|
merkleProof: PromiseOrValue<BytesLike>[],
|
||||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||||
@ -992,25 +968,21 @@ export interface P2PIX extends BaseContract {
|
|||||||
overrides?: CallOverrides
|
overrides?: CallOverrides
|
||||||
): Promise<
|
): Promise<
|
||||||
[
|
[
|
||||||
BigNumber,
|
|
||||||
BigNumber,
|
|
||||||
BigNumber,
|
|
||||||
BigNumber,
|
|
||||||
BigNumber,
|
BigNumber,
|
||||||
BigNumber,
|
BigNumber,
|
||||||
string,
|
string,
|
||||||
string,
|
string,
|
||||||
string
|
BigNumber,
|
||||||
|
BigNumber,
|
||||||
|
BigNumber
|
||||||
] & {
|
] & {
|
||||||
|
amount: BigNumber;
|
||||||
|
pixTarget: BigNumber;
|
||||||
|
token: string;
|
||||||
|
buyerAddress: string;
|
||||||
sellerKey: BigNumber;
|
sellerKey: BigNumber;
|
||||||
counter: BigNumber;
|
counter: BigNumber;
|
||||||
expirationBlock: BigNumber;
|
expirationBlock: BigNumber;
|
||||||
pixTarget: BigNumber;
|
|
||||||
relayerPremium: BigNumber;
|
|
||||||
amount: BigNumber;
|
|
||||||
buyerAddress: string;
|
|
||||||
relayerAddress: string;
|
|
||||||
token: string;
|
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
|
|
||||||
@ -1279,8 +1251,6 @@ export interface P2PIX extends BaseContract {
|
|||||||
lock(
|
lock(
|
||||||
_seller: PromiseOrValue<string>,
|
_seller: PromiseOrValue<string>,
|
||||||
_token: PromiseOrValue<string>,
|
_token: PromiseOrValue<string>,
|
||||||
_buyerAddress: PromiseOrValue<string>,
|
|
||||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
|
||||||
_amount: PromiseOrValue<BigNumberish>,
|
_amount: PromiseOrValue<BigNumberish>,
|
||||||
merkleProof: PromiseOrValue<BytesLike>[],
|
merkleProof: PromiseOrValue<BytesLike>[],
|
||||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||||
@ -1447,8 +1417,6 @@ export interface P2PIX extends BaseContract {
|
|||||||
lock(
|
lock(
|
||||||
_seller: PromiseOrValue<string>,
|
_seller: PromiseOrValue<string>,
|
||||||
_token: PromiseOrValue<string>,
|
_token: PromiseOrValue<string>,
|
||||||
_buyerAddress: PromiseOrValue<string>,
|
|
||||||
_relayerPremium: PromiseOrValue<BigNumberish>,
|
|
||||||
_amount: PromiseOrValue<BigNumberish>,
|
_amount: PromiseOrValue<BigNumberish>,
|
||||||
merkleProof: PromiseOrValue<BytesLike>[],
|
merkleProof: PromiseOrValue<BytesLike>[],
|
||||||
expiredLocks: PromiseOrValue<BigNumberish>[],
|
expiredLocks: PromiseOrValue<BigNumberish>[],
|
||||||
|
@ -625,17 +625,17 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
|
||||||
0,
|
|
||||||
price,
|
price,
|
||||||
|
// acc02.address,
|
||||||
|
// 0,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const fail2 = p2pix.lock(
|
const fail2 = p2pix.lock(
|
||||||
zero,
|
zero,
|
||||||
zero,
|
zero,
|
||||||
zero,
|
// zero,
|
||||||
0,
|
// 0,
|
||||||
price,
|
price,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -665,8 +665,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
price.mul(ethers.BigNumber.from(2)),
|
price.mul(ethers.BigNumber.from(2)),
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -692,8 +692,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
1000,
|
1000,
|
||||||
[
|
[
|
||||||
ethers.utils.keccak256(
|
ethers.utils.keccak256(
|
||||||
@ -725,8 +725,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
price.mul(BigNumber.from("2")),
|
price.mul(BigNumber.from("2")),
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -752,8 +752,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
price,
|
price,
|
||||||
proof,
|
proof,
|
||||||
[],
|
[],
|
||||||
@ -771,7 +771,7 @@ describe("P2PIX", () => {
|
|||||||
await expect(tx)
|
await expect(tx)
|
||||||
.to.emit(p2pix, "LockAdded")
|
.to.emit(p2pix, "LockAdded")
|
||||||
.withArgs(
|
.withArgs(
|
||||||
acc02.address,
|
acc01.address,
|
||||||
ethers.constants.One,
|
ethers.constants.One,
|
||||||
key,
|
key,
|
||||||
price,
|
price,
|
||||||
@ -779,14 +779,14 @@ describe("P2PIX", () => {
|
|||||||
expect(tx).to.be.ok;
|
expect(tx).to.be.ok;
|
||||||
expect(storage.sellerKey).to.eq(key);
|
expect(storage.sellerKey).to.eq(key);
|
||||||
expect(storage.counter).to.eq(1);
|
expect(storage.counter).to.eq(1);
|
||||||
expect(storage.relayerPremium).to.eq(
|
// expect(storage.relayerPremium).to.eq(
|
||||||
ethers.constants.Zero,
|
// ethers.constants.Zero,
|
||||||
);
|
// );
|
||||||
expect(storage.amount).to.eq(price);
|
expect(storage.amount).to.eq(price);
|
||||||
expect(storage.expirationBlock).to.eq(expiration);
|
expect(storage.expirationBlock).to.eq(expiration);
|
||||||
expect(storage.pixTarget).to.eq(target);
|
expect(storage.pixTarget).to.eq(target);
|
||||||
expect(storage.buyerAddress).to.eq(acc02.address);
|
expect(storage.buyerAddress).to.eq(acc01.address);
|
||||||
expect(storage.relayerAddress).to.eq(acc01.address);
|
// expect(storage.relayerAddress).to.eq(acc01.address);
|
||||||
expect(storage.token).to.eq(erc20.address);
|
expect(storage.token).to.eq(erc20.address);
|
||||||
});
|
});
|
||||||
it("should create a lock, update storage and emit events via the reputation path 1", async () => {
|
it("should create a lock, update storage and emit events via the reputation path 1", async () => {
|
||||||
@ -805,8 +805,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
price,
|
price,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -828,19 +828,19 @@ describe("P2PIX", () => {
|
|||||||
expect(castBack).to.eq(owner.address);
|
expect(castBack).to.eq(owner.address);
|
||||||
expect(storage.sellerKey).to.eq(key);
|
expect(storage.sellerKey).to.eq(key);
|
||||||
expect(storage.counter).to.eq(1);
|
expect(storage.counter).to.eq(1);
|
||||||
expect(storage.relayerPremium).to.eq(
|
// expect(storage.relayerPremium).to.eq(
|
||||||
ethers.constants.Zero,
|
// ethers.constants.Zero,
|
||||||
);
|
// );
|
||||||
expect(storage.amount).to.eq(price);
|
expect(storage.amount).to.eq(price);
|
||||||
expect(storage.expirationBlock).to.eq(expiration);
|
expect(storage.expirationBlock).to.eq(expiration);
|
||||||
expect(storage.pixTarget).to.eq(target);
|
expect(storage.pixTarget).to.eq(target);
|
||||||
expect(storage.buyerAddress).to.eq(acc02.address);
|
expect(storage.buyerAddress).to.eq(acc01.address);
|
||||||
expect(storage.relayerAddress).to.eq(acc01.address);
|
// expect(storage.relayerAddress).to.eq(acc01.address);
|
||||||
expect(storage.token).to.eq(erc20.address);
|
expect(storage.token).to.eq(erc20.address);
|
||||||
|
|
||||||
await expect(tx)
|
await expect(tx)
|
||||||
.to.emit(p2pix, "LockAdded")
|
.to.emit(p2pix, "LockAdded")
|
||||||
.withArgs(acc02.address, 1, key, storage.amount);
|
.withArgs(acc01.address, 1, key, storage.amount);
|
||||||
});
|
});
|
||||||
it("should create a lock, update storage and emit events via the reputation path 2", async () => {
|
it("should create a lock, update storage and emit events via the reputation path 2", async () => {
|
||||||
const root = ethers.constants.HashZero;
|
const root = ethers.constants.HashZero;
|
||||||
@ -872,8 +872,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
price,
|
// price,
|
||||||
price,
|
price,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -892,8 +892,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
price.add(ethers.constants.One),
|
price.add(ethers.constants.One),
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -915,21 +915,21 @@ describe("P2PIX", () => {
|
|||||||
expect(castBack).to.eq(owner.address);
|
expect(castBack).to.eq(owner.address);
|
||||||
expect(storage.sellerKey).to.eq(key);
|
expect(storage.sellerKey).to.eq(key);
|
||||||
expect(storage.counter).to.eq(2);
|
expect(storage.counter).to.eq(2);
|
||||||
expect(storage.relayerPremium).to.eq(
|
// expect(storage.relayerPremium).to.eq(
|
||||||
ethers.constants.Zero,
|
// ethers.constants.Zero,
|
||||||
);
|
// );
|
||||||
expect(storage.amount).to.eq(
|
expect(storage.amount).to.eq(
|
||||||
price.add(ethers.constants.One),
|
price.add(ethers.constants.One),
|
||||||
);
|
);
|
||||||
expect(storage.expirationBlock).to.eq(expiration);
|
expect(storage.expirationBlock).to.eq(expiration);
|
||||||
expect(storage.pixTarget).to.eq(target);
|
expect(storage.pixTarget).to.eq(target);
|
||||||
expect(storage.buyerAddress).to.eq(acc02.address);
|
expect(storage.buyerAddress).to.eq(acc01.address);
|
||||||
expect(storage.relayerAddress).to.eq(acc01.address);
|
// expect(storage.relayerAddress).to.eq(acc01.address);
|
||||||
expect(storage.token).to.eq(erc20.address);
|
expect(storage.token).to.eq(erc20.address);
|
||||||
|
|
||||||
await expect(tx)
|
await expect(tx)
|
||||||
.to.emit(p2pix, "LockAdded")
|
.to.emit(p2pix, "LockAdded")
|
||||||
.withArgs(acc02.address, 2, key, storage.amount);
|
.withArgs(acc01.address, 2, key, storage.amount);
|
||||||
});
|
});
|
||||||
// edge case test
|
// edge case test
|
||||||
it("should create multiple locks", async () => {
|
it("should create multiple locks", async () => {
|
||||||
@ -948,8 +948,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
newPrice,
|
newPrice,
|
||||||
proof,
|
proof,
|
||||||
[],
|
[],
|
||||||
@ -966,8 +966,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
100,
|
100,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -984,8 +984,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc03.address,
|
// acc03.address,
|
||||||
0,
|
// 0,
|
||||||
100,
|
100,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -1074,10 +1074,10 @@ describe("P2PIX", () => {
|
|||||||
expect(storage2.counter).to.eq(2);
|
expect(storage2.counter).to.eq(2);
|
||||||
expect(storage3.counter).to.eq(3);
|
expect(storage3.counter).to.eq(3);
|
||||||
|
|
||||||
expect(ethers.constants.Zero)
|
// expect(ethers.constants.Zero)
|
||||||
.to.eq(storage1.relayerPremium)
|
// .to.eq(storage1.relayerPremium)
|
||||||
.and.to.eq(storage2.relayerPremium)
|
// .and.to.eq(storage2.relayerPremium)
|
||||||
.and.to.eq(storage3.relayerPremium);
|
// .and.to.eq(storage3.relayerPremium);
|
||||||
|
|
||||||
expect(storage1.amount).to.eq(newPrice);
|
expect(storage1.amount).to.eq(newPrice);
|
||||||
expect(ethers.BigNumber.from(100))
|
expect(ethers.BigNumber.from(100))
|
||||||
@ -1093,7 +1093,7 @@ describe("P2PIX", () => {
|
|||||||
.and.to.eq(storage2.pixTarget)
|
.and.to.eq(storage2.pixTarget)
|
||||||
.and.to.eq(storage3.pixTarget);
|
.and.to.eq(storage3.pixTarget);
|
||||||
|
|
||||||
expect(acc02.address)
|
expect(acc01.address)
|
||||||
.to.eq(storage1.buyerAddress)
|
.to.eq(storage1.buyerAddress)
|
||||||
.and.to.eq(storage2.buyerAddress);
|
.and.to.eq(storage2.buyerAddress);
|
||||||
expect(storage3.buyerAddress).to.eq(acc03.address);
|
expect(storage3.buyerAddress).to.eq(acc03.address);
|
||||||
@ -1103,10 +1103,10 @@ describe("P2PIX", () => {
|
|||||||
// .and.to.eq(storage2.relayerTarget)
|
// .and.to.eq(storage2.relayerTarget)
|
||||||
// .and.to.eq(storage3.relayerTarget);
|
// .and.to.eq(storage3.relayerTarget);
|
||||||
|
|
||||||
expect(acc01.address)
|
// expect(acc01.address)
|
||||||
.to.eq(storage1.relayerAddress)
|
// .to.eq(storage1.relayerAddress)
|
||||||
.and.to.eq(storage2.relayerAddress);
|
// .and.to.eq(storage2.relayerAddress);
|
||||||
expect(storage3.relayerAddress).to.eq(acc03.address);
|
// expect(storage3.relayerAddress).to.eq(acc03.address);
|
||||||
|
|
||||||
expect(erc20.address)
|
expect(erc20.address)
|
||||||
.to.eq(storage1.token)
|
.to.eq(storage1.token)
|
||||||
@ -1115,10 +1115,10 @@ describe("P2PIX", () => {
|
|||||||
|
|
||||||
await expect(tx1)
|
await expect(tx1)
|
||||||
.to.emit(p2pix, "LockAdded")
|
.to.emit(p2pix, "LockAdded")
|
||||||
.withArgs(acc02.address, 1, key, storage1.amount);
|
.withArgs(acc01.address, 1, key, storage1.amount);
|
||||||
await expect(tx2)
|
await expect(tx2)
|
||||||
.to.emit(p2pix, "LockAdded")
|
.to.emit(p2pix, "LockAdded")
|
||||||
.withArgs(acc02.address, 2, key, storage2.amount);
|
.withArgs(acc01.address, 2, key, storage2.amount);
|
||||||
await expect(tx3)
|
await expect(tx3)
|
||||||
.to.emit(p2pix, "LockAdded")
|
.to.emit(p2pix, "LockAdded")
|
||||||
.withArgs(acc03.address, 3, key, storage3.amount);
|
.withArgs(acc03.address, 3, key, storage3.amount);
|
||||||
@ -1277,8 +1277,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
6,
|
// 6,
|
||||||
100,
|
100,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -1322,8 +1322,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
6,
|
// 6,
|
||||||
100,
|
100,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -1372,8 +1372,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
6,
|
// 6,
|
||||||
100,
|
100,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -1393,8 +1393,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
6,
|
// 6,
|
||||||
100,
|
100,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -1438,8 +1438,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
6,
|
// 6,
|
||||||
100,
|
100,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -1498,8 +1498,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
6,
|
// 6,
|
||||||
100,
|
100,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -1576,7 +1576,7 @@ describe("P2PIX", () => {
|
|||||||
await expect(tx)
|
await expect(tx)
|
||||||
.to.emit(p2pix, "LockReleased")
|
.to.emit(p2pix, "LockReleased")
|
||||||
.withArgs(
|
.withArgs(
|
||||||
acc02.address,
|
acc03.address,
|
||||||
ethers.constants.One,
|
ethers.constants.One,
|
||||||
storage1.amount,
|
storage1.amount,
|
||||||
);
|
);
|
||||||
@ -1604,14 +1604,12 @@ describe("P2PIX", () => {
|
|||||||
expect(used).to.eq(true);
|
expect(used).to.eq(true);
|
||||||
expect(userRecordA).to.eq(zero);
|
expect(userRecordA).to.eq(zero);
|
||||||
expect(userRecord1).to.eq(zero);
|
expect(userRecord1).to.eq(zero);
|
||||||
expect(userRecordB).to.eq(ethers.BigNumber.from(6));
|
expect(userRecordB).to.eq(ethers.BigNumber.from(50));
|
||||||
expect(userRecord2).to.eq(ethers.BigNumber.from(100));
|
expect(userRecord2).to.eq(ethers.BigNumber.from(50));
|
||||||
await expect(tx).to.changeTokenBalances(
|
await expect(tx).to.changeTokenBalances(
|
||||||
erc20,
|
erc20,
|
||||||
[acc03.address, acc01.address, acc02.address ],
|
[acc03.address, acc01.address, acc02.address ],
|
||||||
[3, 3, 94],
|
[100, 0, 0],
|
||||||
// acc02 is acting both as buyer and relayerTarget
|
|
||||||
// (i.e., 94 + 3 = 97)
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
// edge case test
|
// edge case test
|
||||||
@ -1668,8 +1666,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
100,
|
100,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -1679,8 +1677,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
6,
|
// 6,
|
||||||
50,
|
50,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -1690,8 +1688,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
10,
|
// 10,
|
||||||
25,
|
25,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -1795,19 +1793,19 @@ describe("P2PIX", () => {
|
|||||||
expect(tx2).to.be.ok;
|
expect(tx2).to.be.ok;
|
||||||
await expect(tx)
|
await expect(tx)
|
||||||
.to.emit(p2pix, "LockReleased")
|
.to.emit(p2pix, "LockReleased")
|
||||||
.withArgs(acc02.address, lockID, storage1.amount);
|
.withArgs(acc03.address, lockID, storage1.amount);
|
||||||
await expect(tx1)
|
await expect(tx1)
|
||||||
.to.emit(p2pix, "LockReleased")
|
.to.emit(p2pix, "LockReleased")
|
||||||
.withArgs(acc02.address, lockID2, storage2.amount);
|
.withArgs(acc03.address, lockID2, storage2.amount);
|
||||||
await expect(tx2)
|
await expect(tx2)
|
||||||
.to.emit(p2pix, "LockReleased")
|
.to.emit(p2pix, "LockReleased")
|
||||||
.withArgs(acc02.address, lockID3, storage3.amount);
|
.withArgs(acc03.address, lockID3, storage3.amount);
|
||||||
expect(used1).to.eq(true);
|
expect(used1).to.eq(true);
|
||||||
expect(used2).to.eq(true);
|
expect(used2).to.eq(true);
|
||||||
expect(used3).to.eq(true);
|
expect(used3).to.eq(true);
|
||||||
expect(0).to.eq(acc01Record1).and.to.eq(acc03Record1);
|
expect(0).to.eq(acc01Record1).and.to.eq(acc03Record1);
|
||||||
expect(acc01Record2).to.eq(6); // 0 + 6
|
expect(acc01Record2).to.eq(75); // 50 + 25 + 0
|
||||||
expect(acc03Record2).to.eq(185); // 100 + 50 + 25 + 10
|
expect(acc03Record2).to.eq(100); // 50 + 25 + 25
|
||||||
|
|
||||||
const addresses = [
|
const addresses = [
|
||||||
acc01.address,
|
acc01.address,
|
||||||
@ -1817,9 +1815,9 @@ describe("P2PIX", () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const balances = [
|
const balances = [
|
||||||
[0, 100, 0, "-100"],
|
[0, 0, 100, "-100"],
|
||||||
[3, 44, 3, "-50"],
|
[0, 0, 50, "-50"],
|
||||||
[0, 15, 10, "-25"],
|
[0, 0, 25, "-25"],
|
||||||
];
|
];
|
||||||
|
|
||||||
for (let i = 0; i < 3; i++) {
|
for (let i = 0; i < 3; i++) {
|
||||||
@ -1867,8 +1865,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
1,
|
1,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -1907,8 +1905,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
1,
|
1,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -1944,8 +1942,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
1,
|
1,
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
@ -2009,8 +2007,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
price,
|
price,
|
||||||
proof,
|
proof,
|
||||||
[],
|
[],
|
||||||
@ -2050,8 +2048,8 @@ describe("P2PIX", () => {
|
|||||||
const tx1 = await p2pix.lock(
|
const tx1 = await p2pix.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
100,
|
100,
|
||||||
[],
|
[],
|
||||||
[lockID],
|
[lockID],
|
||||||
@ -2064,7 +2062,7 @@ describe("P2PIX", () => {
|
|||||||
expect(tx1).to.be.ok;
|
expect(tx1).to.be.ok;
|
||||||
await expect(tx1)
|
await expect(tx1)
|
||||||
.to.emit(p2pix, "LockReturned")
|
.to.emit(p2pix, "LockReturned")
|
||||||
.withArgs(acc02.address, lockID);
|
.withArgs(acc01.address, lockID);
|
||||||
expect(remaining).to.eq(
|
expect(remaining).to.eq(
|
||||||
price.sub(ethers.BigNumber.from(100)),
|
price.sub(ethers.BigNumber.from(100)),
|
||||||
);
|
);
|
||||||
@ -2085,8 +2083,8 @@ describe("P2PIX", () => {
|
|||||||
.lock(
|
.lock(
|
||||||
owner.address,
|
owner.address,
|
||||||
erc20.address,
|
erc20.address,
|
||||||
acc02.address,
|
// acc02.address,
|
||||||
0,
|
// 0,
|
||||||
price,
|
price,
|
||||||
proof,
|
proof,
|
||||||
[],
|
[],
|
||||||
@ -2105,7 +2103,7 @@ describe("P2PIX", () => {
|
|||||||
expect(tx).to.be.ok;
|
expect(tx).to.be.ok;
|
||||||
await expect(tx)
|
await expect(tx)
|
||||||
.to.emit(p2pix, "LockReturned")
|
.to.emit(p2pix, "LockReturned")
|
||||||
.withArgs(acc02.address, lockID);
|
.withArgs(acc01.address, lockID);
|
||||||
expect(remaining).to.eq(0);
|
expect(remaining).to.eq(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -22,13 +22,11 @@ export interface Deploys {
|
|||||||
export interface Lock {
|
export interface Lock {
|
||||||
sellerKey: BigNumber;
|
sellerKey: BigNumber;
|
||||||
counter: BigNumber;
|
counter: BigNumber;
|
||||||
relayerPremium: BigNumber;
|
|
||||||
amount: BigNumber;
|
|
||||||
expirationBlock: BigNumber;
|
expirationBlock: BigNumber;
|
||||||
pixTarget: BigNumber;
|
pixTarget: BigNumber;
|
||||||
buyerAddress: string;
|
|
||||||
relayerAddress: string;
|
|
||||||
token: string;
|
token: string;
|
||||||
|
buyerAddress: string;
|
||||||
|
amount: BigNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Call {
|
export interface Call {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user