added lock bonds (hardcoded to 6,25%)
This commit is contained in:
		
							parent
							
								
									55409a960c
								
							
						
					
					
						commit
						5c989e3596
					
				| @ -222,7 +222,9 @@ contract P2PIX is | |||||||
|                 msg.sender |                 msg.sender | ||||||
|             ); |             ); | ||||||
|         } else if (_amount > 1e2 ether) { |         } else if (_amount > 1e2 ether) { | ||||||
|              |             if (_amount > 1e6 ether) | ||||||
|  |                 revert AmountNotAllowed(); | ||||||
|  | 
 | ||||||
|             uint256 userCredit = userRecord[ |             uint256 userCredit = userRecord[ | ||||||
|                 _castAddrToKey(msg.sender) |                 _castAddrToKey(msg.sender) | ||||||
|             ]; |             ]; | ||||||
| @ -230,10 +232,15 @@ contract P2PIX is | |||||||
|             uint256 spendLimit; |             uint256 spendLimit; | ||||||
|             (spendLimit) = _limiter(userCredit / WAD); |             (spendLimit) = _limiter(userCredit / WAD); | ||||||
| 
 | 
 | ||||||
|             if ( |             if (_amount > (spendLimit * WAD)) { | ||||||
|                 _amount > (spendLimit * WAD) || |                 SafeTransferLib.safeTransferFrom( | ||||||
|                 _amount > 1e6 ether |                     t, | ||||||
|             ) revert AmountNotAllowed(); |                     msg.sender, | ||||||
|  |                     address(this), | ||||||
|  |                     _amount >> 4 // 6,25% | ||||||
|  |                 ); | ||||||
|  |                 _amount += _amount >> 4; | ||||||
|  |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         DT.Lock memory l = DT.Lock( |         DT.Lock memory l = DT.Lock( | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user