编译器
0.8.26+commit.8a97fa7a
文件 1 的 7:DeAlStoreLiquidity.sol
pragma solidity ^0.8.26;
import "contracts/IERC20Flat.sol";
import "contracts/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "contracts/IInvoiceRenting.sol";
interface IERC20Extended {
function decimals() external view returns (uint8);
}
contract DeAlStableLiquidity is ReentrancyGuard {
address public contractOwner;
event WorkerGotPayed(uint256 amount,address workerAddress);
event AmountPurchasedMoreInfo(uint256 amount,string info,uint256 invoiceId);
uint8 private paymentTokenDecimals;
uint8 private rewardTokenDecimals;
string public typeOfContract;
IInvoice public invoices;
uint256 public feeUSDC=0;
uint256 public feeDeAl=0;
event ProductAdded(
string name,
string barcode,
uint256 price,
uint256 quantity,
uint256 discountPercentage,
string description
);
event NewReceipt(
uint256 receiptId,
uint256 timestamp,
address clientAddress,
string productBarcode,
uint256 amountPaid,
string ProductDesc
);
struct Product {
string name;
string barcode;
uint256 price;
uint256 quantity;
string[] productImages;
string productDescription;
uint256 discountPercentage;
string category;
}
struct Receipt {
uint256 index;
uint256 timestamp;
address clientAddress;
string productBarcode;
uint256 amountPaid;
}
struct Locker {
uint256 duration;
uint256 startTime;
}
Locker public theLocker;
uint256 public total = 0;
uint256 public Balance = 0;
string[] public productBarcodes;
mapping(string => Product) public products;
mapping(uint256 => Receipt) public receipts;
mapping(uint256 => string) public infos;
uint256 public receiptCounter = 1;
IERC20Flat public tokenContract;
IERC20Flat public rewardToken;
uint256 public rewardsPool;
mapping(uint256 => uint256[]) receiptNFTs;
constructor(
address _ERCUltra,
address _invoices,
address _paymentToken
) {
typeOfContract = "Liquidity";
invoices = IInvoice(_invoices);
tokenContract = IERC20Flat(_paymentToken);
rewardToken = IERC20Flat(_ERCUltra);
contractOwner = msg.sender;
tokenContract.approve(address(this), type(uint256).max);
rewardsPool = 0;
paymentTokenDecimals = IERC20Extended(_paymentToken).decimals();
rewardTokenDecimals = IERC20Extended(_ERCUltra).decimals();
}
modifier onlyOwner() {
require(msg.sender == contractOwner, "Only owner");
_;
}
function verifyReceipt(address client, uint256 receiptId) public view returns (bool) {
Receipt storage receipt = receipts[receiptId];
return (receipt.clientAddress == client && receipt.index == receiptId);
}
function verifySpecificReceiptOfSpecificProduct(address client, uint256 receiptId, string memory productBarcode) public view returns (bool) {
Receipt storage receipt = receipts[receiptId];
return (receipt.clientAddress == client && receipt.index == receiptId && keccak256(abi.encodePacked(receipt.productBarcode)) == keccak256(abi.encodePacked(productBarcode)));
}
function lockProduct(string memory _barcode, uint256 _duration) nonReentrant onlyOwner public {
theLocker = Locker({
duration: _duration,
startTime: block.timestamp
});
}
function depositToRewardPool(uint256 amount) nonReentrant onlyOwner public returns(uint256) {
require(rewardToken.transferFrom(msg.sender, address(this), amount*10**rewardTokenDecimals), "Transfer failed");
rewardsPool += amount*10**rewardTokenDecimals;
return rewardsPool;
}
function getProductPics(string memory _barcode) public view returns (string[] memory) {
return products[_barcode].productImages;
}
function isClient(address _address) public view returns (bool) {
return true;
}
function deposit(uint256 _amount) nonReentrant public {
require(_amount > 0, "");
require(tokenContract.transferFrom(msg.sender, address(this), _amount), "Failed to transfer tokens");
Balance += _amount;
total += _amount;
}
function changeOwner(address _newOwner) nonReentrant onlyOwner public returns (bool) {
contractOwner = _newOwner;
}
function sell(uint256 _amount,string memory _barcode,uint256 _invoiceId) nonReentrant public {
Product storage product = products[_barcode];
address sender = msg.sender;
require(invoices.verifyOwnership(sender,receiptNFTs[_invoiceId][0],_barcode),"You did not deposited DeAl");
invoices.burnNFT(receiptNFTs[_invoiceId][0]);
uint256 price = product.price;
if (product.discountPercentage > 0) {
price = price * (100 - product.discountPercentage) / 100;
}
uint256 totalAmountToPay = _amount*price*98/100;
require(Balance>=totalAmountToPay,"Not Enough Balance");
require(rewardToken.transferFrom(msg.sender, address(this), _amount * 1e18), "Reward token transfer failed");
feeDeAl += _amount * 1e18 * 3 / 100;
rewardsPool += _amount * 1e18 * 97 / 100;
require(tokenContract.transfer(msg.sender, totalAmountToPay), "Payment token transfer failed");
Balance -= totalAmountToPay;
}
function emergencyWithdrawRewardsPool() nonReentrant onlyOwner public {
require(block.timestamp > theLocker.startTime + theLocker.duration, "Product is locked");
if(rewardsPool!=0) {
require(rewardToken.transfer(msg.sender, rewardsPool), "Reward transfer failed");
rewardsPool=0;
}
}
function getNFTsForReceipt(uint256 _receiptId) public view returns (uint256[] memory) {
return receiptNFTs[_receiptId];
}
function addProduct(
string memory _name,
string memory _barcode,
uint256 _priceInNormalNumber,
uint256 _quantity,
string[] memory _productImages,
string memory _productDescription,
uint256 _discountPercentage,
string memory _category
) nonReentrant onlyOwner public {
require(bytes(products[_barcode].barcode).length == 0, "Product already exists");
require(_discountPercentage<=100,"discount greater than 100%!");
Product storage newProduct = products[_barcode];
newProduct.name = _name;
newProduct.barcode = _barcode;
newProduct.price = _priceInNormalNumber;
newProduct.quantity = _quantity;
newProduct.productImages = _productImages;
newProduct.productDescription = _productDescription;
newProduct.discountPercentage = _discountPercentage;
newProduct.category = _category;
productBarcodes.push(_barcode);
emit ProductAdded(
_name,
_barcode,
_priceInNormalNumber,
_quantity,
_discountPercentage,
_productDescription
);
}
function getAllCategories() public view returns (string[] memory) {
string[] memory allCategories = new string[](productBarcodes.length);
uint256 categoryCount = 0;
for (uint256 i = 0; i < productBarcodes.length; i++) {
string memory category = products[productBarcodes[i]].category;
bool isUnique = true;
for (uint256 j = 0; j < categoryCount; j++) {
if (keccak256(abi.encodePacked(allCategories[j])) == keccak256(abi.encodePacked(category))) {
isUnique = false;
break;
}
}
if (isUnique) {
allCategories[categoryCount] = category;
categoryCount++;
}
}
string[] memory uniqueCategories = new string[](categoryCount);
for (uint256 i = 0; i < categoryCount; i++) {
uniqueCategories[i] = allCategories[i];
}
return uniqueCategories;
}
function updateProductQuantity(string memory _barcode, uint256 _newQuantity) nonReentrant onlyOwner public {
for (uint256 i = 0; i < productBarcodes.length; i++) {
if (keccak256(abi.encodePacked(productBarcodes[i])) == keccak256(abi.encodePacked(_barcode))) {
products[productBarcodes[i]].quantity = _newQuantity;
break;
}
}
}
function purchaseProduct(string memory _productBarcode,uint256 _amount, string memory _info, string memory metadata) nonReentrant public {
Product storage product = products[_productBarcode];
require(product.quantity >= 1, "Out of stock");
uint256 amountToPay = product.price*_amount;
if (product.discountPercentage > 0) {
amountToPay = amountToPay * (100 - product.discountPercentage) / 100;
}
require(tokenContract.transferFrom(msg.sender, address(this), amountToPay), "Token transfer failed");
feeUSDC += amountToPay*2/100;
product.quantity-=1;
uint256 newReceiptId = receiptCounter;
receiptCounter++;
Balance += amountToPay*98/100;
total += amountToPay*98/100;
Receipt memory receipt = Receipt({
index: newReceiptId,
timestamp: block.timestamp,
clientAddress: msg.sender,
productBarcode: _productBarcode,
amountPaid: amountToPay
});
infos[newReceiptId] = string(abi.encodePacked("Amount of the product: ", Strings.toString(_amount), "\n More info: ", _info));
receipts[newReceiptId] = receipt;
emit NewReceipt(
newReceiptId,
receipt.timestamp,
msg.sender,
receipt.productBarcode,
receipt.amountPaid,
product.productDescription
);
emit AmountPurchasedMoreInfo(_amount,_info,newReceiptId);
require(rewardsPool>=_amount*1e18,"Not enough in the Pool try purchase less");
{
require(rewardToken.transfer(msg.sender, _amount*1e18), "Reward transfer failed");
rewardsPool -= _amount*1e18;
}
uint256[] memory nftIds = new uint256[](1);
uint256 nftId = invoices.mintNFT(msg.sender, metadata,_productBarcode);
nftIds[0] = nftId;
receiptNFTs[newReceiptId] = nftIds;
}
function getAllReceipts() public view returns (Receipt[] memory) {
Receipt[] memory allReceipts = new Receipt[](receiptCounter);
for (uint256 i = 0; i < receiptCounter; i++) {
allReceipts[i] = receipts[i];
}
return allReceipts;
}
function changeProductDiscount(string memory _barcode, uint256 _newDiscountPercentage) nonReentrant onlyOwner public {
require(bytes(products[_barcode].barcode).length != 0, "not found");
require(_newDiscountPercentage<=100,"discount greater than 100%!");
products[_barcode].discountPercentage = _newDiscountPercentage;
}
function editProduct(
string memory _barcode,
string memory _name,
uint256 _priceInNormalNumber,
string[] memory _productImages,
string memory _productDescription,
string memory _category
) nonReentrant onlyOwner public {
require(bytes(products[_barcode].name).length != 0, "");
products[_barcode].name = _name;
products[_barcode].price = _priceInNormalNumber;
products[_barcode].productImages = _productImages;
products[_barcode].productDescription = _productDescription;
products[_barcode].category = _category;
}
function getAllProductsBarcodes() public view returns (string[] memory) {
return productBarcodes;
}
function withdrawUSDCFees() public onlyOwner {
require(tokenContract.transfer(msg.sender,feeUSDC),"Fee Failed");
feeUSDC=0;
require(rewardToken.transfer(msg.sender,feeDeAl),"Fee Failed");
feeDeAl=0;
}
}
文件 2 的 7:IERC20Flat.sol
pragma solidity ^0.8.0;
interface IERC20Flat {
function transfer(address to, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function burnFrom(address account, uint256 amount) external;
}
文件 3 的 7:IInvoiceRenting.sol
pragma solidity ^0.8.26;
interface IInvoice {
function mintNFT(address recipient, string memory tokenURI, string memory productBarcode) external returns (uint256);
function burnNFT(uint256 tokenId) external;
function mintNFTWithTimer(address recipient, string memory tokenURI, uint256 duration, string memory productBarcode) external returns (uint256);
function verifyOwnership(address owner, uint256 tokenId, string memory productBarcode) external view returns (bool);
}
文件 4 的 7:Math.sol
pragma solidity ^0.8.0;
library Math {
enum Rounding {
Down,
Up,
Zero
}
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a & b) + (a ^ b) / 2;
}
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
return a == 0 ? 0 : (a - 1) / b + 1;
}
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
uint256 prod0;
uint256 prod1;
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
if (prod1 == 0) {
return prod0 / denominator;
}
require(denominator > prod1, "Math: mulDiv overflow");
uint256 remainder;
assembly {
remainder := mulmod(x, y, denominator)
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
uint256 twos = denominator & (~denominator + 1);
assembly {
denominator := div(denominator, twos)
prod0 := div(prod0, twos)
twos := add(div(sub(0, twos), twos), 1)
}
prod0 |= prod1 * twos;
uint256 inverse = (3 * denominator) ^ 2;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
result = prod0 * inverse;
return result;
}
}
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 result = 1 << (log2(a) >> 1);
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}
文件 5 的 7:ReentrancyGuard.sol
pragma solidity ^0.8.23;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
}
function _nonReentrantAfter() private {
_status = _NOT_ENTERED;
}
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
文件 6 的 7:SignedMath.sol
pragma solidity ^0.8.0;
library SignedMath {
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
function average(int256 a, int256 b) internal pure returns (int256) {
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
function abs(int256 n) internal pure returns (uint256) {
unchecked {
return uint256(n >= 0 ? n : -n);
}
}
}
文件 7 的 7:Strings.sol
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
}
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}
{
"compilationTarget": {
"contracts/DeAlStoreLiquidity.sol": "DeAlStableLiquidity"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"_ERCUltra","type":"address"},{"internalType":"address","name":"_invoices","type":"address"},{"internalType":"address","name":"_paymentToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"info","type":"string"},{"indexed":false,"internalType":"uint256","name":"invoiceId","type":"uint256"}],"name":"AmountPurchasedMoreInfo","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"receiptId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"address","name":"clientAddress","type":"address"},{"indexed":false,"internalType":"string","name":"productBarcode","type":"string"},{"indexed":false,"internalType":"uint256","name":"amountPaid","type":"uint256"},{"indexed":false,"internalType":"string","name":"ProductDesc","type":"string"}],"name":"NewReceipt","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"barcode","type":"string"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"discountPercentage","type":"uint256"},{"indexed":false,"internalType":"string","name":"description","type":"string"}],"name":"ProductAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"workerAddress","type":"address"}],"name":"WorkerGotPayed","type":"event"},{"inputs":[],"name":"Balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_barcode","type":"string"},{"internalType":"uint256","name":"_priceInNormalNumber","type":"uint256"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"string[]","name":"_productImages","type":"string[]"},{"internalType":"string","name":"_productDescription","type":"string"},{"internalType":"uint256","name":"_discountPercentage","type":"uint256"},{"internalType":"string","name":"_category","type":"string"}],"name":"addProduct","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_barcode","type":"string"},{"internalType":"uint256","name":"_newDiscountPercentage","type":"uint256"}],"name":"changeProductDiscount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositToRewardPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_barcode","type":"string"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"uint256","name":"_priceInNormalNumber","type":"uint256"},{"internalType":"string[]","name":"_productImages","type":"string[]"},{"internalType":"string","name":"_productDescription","type":"string"},{"internalType":"string","name":"_category","type":"string"}],"name":"editProduct","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdrawRewardsPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeDeAl","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeUSDC","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllCategories","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllProductsBarcodes","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllReceipts","outputs":[{"components":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"address","name":"clientAddress","type":"address"},{"internalType":"string","name":"productBarcode","type":"string"},{"internalType":"uint256","name":"amountPaid","type":"uint256"}],"internalType":"struct DeAlStableLiquidity.Receipt[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_receiptId","type":"uint256"}],"name":"getNFTsForReceipt","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_barcode","type":"string"}],"name":"getProductPics","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"infos","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"invoices","outputs":[{"internalType":"contract IInvoice","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isClient","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_barcode","type":"string"},{"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"lockProduct","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"productBarcodes","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"products","outputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"barcode","type":"string"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"string","name":"productDescription","type":"string"},{"internalType":"uint256","name":"discountPercentage","type":"uint256"},{"internalType":"string","name":"category","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_productBarcode","type":"string"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"string","name":"_info","type":"string"},{"internalType":"string","name":"metadata","type":"string"}],"name":"purchaseProduct","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"receiptCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"receipts","outputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"address","name":"clientAddress","type":"address"},{"internalType":"string","name":"productBarcode","type":"string"},{"internalType":"uint256","name":"amountPaid","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20Flat","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"string","name":"_barcode","type":"string"},{"internalType":"uint256","name":"_invoiceId","type":"uint256"}],"name":"sell","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"theLocker","outputs":[{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenContract","outputs":[{"internalType":"contract IERC20Flat","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"total","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"typeOfContract","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_barcode","type":"string"},{"internalType":"uint256","name":"_newQuantity","type":"uint256"}],"name":"updateProductQuantity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"client","type":"address"},{"internalType":"uint256","name":"receiptId","type":"uint256"}],"name":"verifyReceipt","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"client","type":"address"},{"internalType":"uint256","name":"receiptId","type":"uint256"},{"internalType":"string","name":"productBarcode","type":"string"}],"name":"verifySpecificReceiptOfSpecificProduct","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawUSDCFees","outputs":[],"stateMutability":"nonpayable","type":"function"}]