Compare commits

..

4 Commits

Author SHA1 Message Date
hueso
655cec97e0 add artifacts to .gitignore 2023-05-24 17:43:33 -03:00
hueso
80b197ab87 mark assembly blocks as memory-safe 2023-05-24 14:43:33 -03:00
hueso
691c84bbbc use ERC20 datatype 2023-05-22 08:53:22 -03:00
hueso
6f873785aa revamped lock() conditionals 2023-05-22 08:44:33 -03:00
3 changed files with 6 additions and 1144 deletions

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -150,12 +150,10 @@ contract P2PIX is BaseUtils {
uint256 bal = getBalance(args.seller, args.token);
if (bal < args.amount) revert NotEnoughTokens();
unchecked {
lockID = ++lockCounter;
}
uint256 c = lockCounter + 1;
if (
mapLocks[lockID].expirationBlock >= block.number
mapLocks[c].expirationBlock >= block.number
) revert NotExpired();
address sender; uint256 forwarder;
@@ -180,7 +178,7 @@ contract P2PIX is BaseUtils {
}
DT.Lock memory l = DT.Lock(
lockID,
c,
(block.number + defaultLockBlocks),
_pixTarget,
args.amount,
@@ -385,10 +383,12 @@ contract P2PIX is BaseUtils {
function _addLock(
uint256 _bal,
DT.Lock memory _l
) internal {
) internal returns(uint256 counter){
mapLocks[_l.counter] = _l;
_decBal(_bal, _l.amount, ERC20(_l.token), _l.seller);
++lockCounter;
counter = _l.counter;
emit LockAdded(
_l.buyerAddress,