Compare commits

..

5 Commits

Author SHA1 Message Date
hueso
4c8eb63c38 add artifacts to .gitignore 2023-07-23 18:05:49 -03:00
hueso
8adccd2739 mark assembly blocks as memory-safe 2023-07-23 18:04:53 -03:00
hueso
e2ae92563e use ERC20 datatype 2023-07-23 18:04:50 -03:00
hueso
a3fd8bee16 revamped lock() conditionals 2023-07-23 18:02:41 -03:00
PedroCailleret
1a91b64024 increased lock gas savings 2023-06-05 22:04:46 -03:00
3 changed files with 1144 additions and 6 deletions

View File

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

File diff suppressed because one or more lines are too long

View File

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