HOTFIX: Adjusted minimum spend limit

This commit is contained in:
Filipe Soccol 2022-12-16 10:04:01 -03:00
parent 0b0f2a667f
commit 122044a1e5
5 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
{ {
"_format": "hh-sol-dbg-1", "_format": "hh-sol-dbg-1",
"buildInfo": "../../build-info/6ebe7657303cd8d4b91c2ac52d990bb5.json" "buildInfo": "../../build-info/afbde6718590f5775bc92171f5c6c7f4.json"
} }

File diff suppressed because one or more lines are too long

View File

@ -199,7 +199,7 @@ contract P2PIX is
// Halt execution and output `lockID`. // Halt execution and output `lockID`.
return lockID; return lockID;
} else { } else {
if (l.amount <= 1e2) { if (l.amount <= 100 ether) {
_addLock(lockID, l, d); _addLock(lockID, l, d);
// Halt execution and output `lockID`. // Halt execution and output `lockID`.
return lockID; return lockID;

File diff suppressed because one or more lines are too long

View File

@ -585,10 +585,10 @@ describe("P2PIX", () => {
); );
}); });
it("should revert if msg.sender does not have enough credit in his spend limit", async () => { it("should revert if msg.sender does not have enough credit in his spend limit", async () => {
await erc20.approve(p2pix.address, price); await erc20.approve(p2pix.address, price.mul(BigNumber.from('3')));
await p2pix.deposit( await p2pix.deposit(
erc20.address, erc20.address,
price, price.mul(BigNumber.from('3')),
"pixTarget", "pixTarget",
merkleRoot, merkleRoot,
); );
@ -599,7 +599,7 @@ describe("P2PIX", () => {
acc02.address, acc02.address,
acc03.address, acc03.address,
0, 0,
price, price.mul(BigNumber.from('2')),
[], [],
[], [],
); );
@ -674,13 +674,13 @@ describe("P2PIX", () => {
acc02.address, acc02.address,
acc03.address, acc03.address,
0, 0,
100, price,
[], [],
[], [],
); );
const lockID = ethers.utils.solidityKeccak256( const lockID = ethers.utils.solidityKeccak256(
["uint256", "uint256", "address"], ["uint256", "uint256", "address"],
[0, 100, acc02.address], [0, price, acc02.address],
); );
const storage: Lock = await p2pix.callStatic.mapLocks( const storage: Lock = await p2pix.callStatic.mapLocks(
lockID, lockID,
@ -695,7 +695,7 @@ describe("P2PIX", () => {
ethers.constants.Zero, ethers.constants.Zero,
); );
expect(storage.amount).to.eq( expect(storage.amount).to.eq(
ethers.BigNumber.from(100), price
); );
expect(storage.expirationBlock).to.eq(expiration); expect(storage.expirationBlock).to.eq(expiration);
expect(storage.buyerAddress).to.eq(acc02.address); expect(storage.buyerAddress).to.eq(acc02.address);