Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- MarketplaceTestnet
- Optimization enabled
- false
- Compiler version
- v0.8.24+commit.e11b9ed9
- EVM Version
- Verified at
- 2026-08-25T18:29:02.967571Z
Constructor Arguments
000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000050555531d7a9ae79a5ad9100f114def88c6691d90000000000000000000000005318788184cc6197df6005db533e4dcda5c565e4
Arg [0] (address) : 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [1] (address) : 0x50555531d7a9ae79a5ad9100f114def88c6691d9
Arg [2] (address) : 0x5318788184cc6197df6005db533e4dcda5c565e4
contracts/MarketplaceTestnet.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "./Marketplace.sol";
/**
* @title MarketplaceTestnet
* @notice SAMO ZA TESTNET (943). Enak kot Marketplace, le da je casovni zamik
* skrajsan na 10 minut, da je postopek napoved → izvedba mogoce
* preizkusiti v eni seji namesto v dveh dneh.
*
* ZAKAJ LOCENA POGODBA IN NE STIKALO:
* Stikalo bi bilo mogoce pomotoma nastaviti na mainnetu in nihce ne bi opazil —
* zamik bi bil videti prisoten, a bi bil brez ucinka. Locena pogodba tega ne
* dopusca: skrajsani zamik fizicno ne obstaja v Marketplace.sol. Isti prijem
* kot pri KYCWhitelistTestnet.
*
* ⚠️ Te pogodbe se NE deploya na mainnet (369).
*/
contract MarketplaceTestnet is Marketplace {
constructor(address _usdc, address _feeRecipient, address _kyc)
Marketplace(_usdc, _feeRecipient, _kyc)
{}
function zamik() public pure override returns (uint256) {
return 10 minutes;
}
}
@openzeppelin/contracts/interfaces/IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)
pragma solidity >=0.4.16;
import {IERC165} from "../utils/introspection/IERC165.sol";
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
@openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
@openzeppelin/contracts/interfaces/IERC1363.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)
pragma solidity >=0.6.2;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}
@openzeppelin/contracts/utils/StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC-1967 implementation slot:
* ```solidity
* contract ERC1967 {
* // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* TIP: Consider using this library along with {SlotDerivation}.
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct Int256Slot {
int256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Int256Slot` with member `value` located at `slot`.
*/
function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
/**
* @dev Returns a `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
}
contracts/AdminZamik.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title AdminZamik
* @notice Casovni zamik na nevarne admin spremembe.
*
* ZAKAJ TO OBSTAJA
* ----------------
* Owner kljuc na tej platformi NE more krasti: ne more kovati zetonov, ne more
* premikati tujih zetonov in ne more v escrow. Kar PA lahko, je tiho zamenjati
* nastavitve pod nogami uporabnikov — KYC listo, placilni token, prijavljeno
* vrednost sredstva.
*
* Vsi trije so napadi, ki jih je mogoce VIDETI VNAPREJ. Zato jih ne branimo z
* multisigom (ki varuje lastnika kljuca), ampak s casovnim zamikom (ki varuje
* UPORABNIKA): sprememba se mora najprej javno napovedati, sele po zamiku jo je
* mogoce izvesti. Uporabnik ima ves ta cas, da spremembo vidi in izstopi.
*
* Namenoma NI zunanje timelock pogodbe kot lastnika. Tak vzorec doda tveganje
* nedosegljivosti: ce lastniku kdaj ne uspe sestaviti transakcije skozi tujo
* pogodbo, so kontrakti zamrznjeni za vedno. Tu je zamik vgrajen, lastnik pa
* ostane navadna denarnica.
*
* KAJ ZAMIK NE POKRIVA (namerno)
* ------------------------------
* - pause() — zasilna zavora mora biti takojsnja, sicer ni zavora
* - unpause() — vrnitev v obratovanje naj bo hitra
* - odvzem pravice zaustavljalca — ob razkritem kljucu ga moras vreci TAKOJ
* Nevarnost caka, zasilna zavora ne.
*/
abstract contract AdminZamik is Ownable {
/// @notice Rok, v katerem je napoved uporabna. Po njem potece.
/// @dev Brez tega bi stara napoved lezala na verigi kot nabita puska:
/// napoves nekaj neopaznega danes, izvedes cez pol leta, ko nihce vec
/// ne gleda. Napoved, ki ni bila izvedena v roku, je treba ponoviti.
uint256 public constant ROK = 7 days;
/// @notice id napovedi → cas, od katerega je izvedljiva (0 = ni napovedi)
mapping(bytes32 => uint256) public izvedljivoOd;
event SpremembaNapovedana(bytes32 indexed id, string kaj, uint256 izvedljivoOd, uint256 potece);
event SpremembaIzvedena(bytes32 indexed id, string kaj);
event SpremembaPreklicana(bytes32 indexed id, string kaj);
/// @notice Koliko casa mora sprememba cakati. Na mainnetu 48 ur.
/// @dev virtual samo zato, da lahko testnetna razlicica skrajsa cakanje na
/// minute. Skrajsana vrednost tako fizicno ne more priti na mainnet —
/// isti prijem kot pri KYCWhitelistTestnet.
function zamik() public view virtual returns (uint256) {
return 48 hours;
}
// ── Notranje ────────────────────────────────────────────────────────────
/// @dev id MORA vsebovati tocne parametre spremembe, sicer bi lahko
/// napovedal nedolzno vrednost in izvedel skodljivo.
function _napovej(bytes32 id, string memory kaj) internal {
require(izvedljivoOd[id] == 0, "Ze napovedano");
uint256 od = block.timestamp + zamik();
izvedljivoOd[id] = od;
emit SpremembaNapovedana(id, kaj, od, od + ROK);
}
function _porabi(bytes32 id, string memory kaj) internal {
uint256 od = izvedljivoOd[id];
require(od != 0, "Ni napovedano");
require(block.timestamp >= od, "Zamik se ni potekel");
require(block.timestamp <= od + ROK, "Napoved je potekla");
delete izvedljivoOd[id];
emit SpremembaIzvedena(id, kaj);
}
// ── Javno ───────────────────────────────────────────────────────────────
/// @notice Preklic napovedane spremembe. Takojsen — premisliti se mora biti
/// mogoce hitreje, kot se izvede.
function prekliciSpremembo(bytes32 id, string calldata kaj) external onlyOwner {
require(izvedljivoOd[id] != 0, "Ni napovedano");
delete izvedljivoOd[id];
emit SpremembaPreklicana(id, kaj);
}
/// @notice Stanje napovedi — da ga stran in nadzorni sistem lahko prikazeta.
function stanjeNapovedi(bytes32 id)
external
view
returns (bool napovedana, uint256 od, uint256 potece, bool izvedljivaZdaj)
{
uint256 t = izvedljivoOd[id];
if (t == 0) return (false, 0, 0, false);
return (true, t, t + ROK, block.timestamp >= t && block.timestamp <= t + ROK);
}
}
contracts/Marketplace.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "./AdminZamik.sol";
/**
* @title Marketplace
* @notice Primarni in sekundarni trg za RWA tokene na mojdelez.si
*
* Tok:
* 1. Prodajalec listira X RWA tokenov po ceni P USDC/token (opcijsko dovoli ponudbe)
* 2. Kupec lahko kupi takoj (fiksna cena) ALI odda ponudbo (zaklene USDC v escrow)
* 3. Prodajalec lahko ponudbo sprejme (prenos RWA kupcu, USDC prodajalcu)
* 4. Portal zaračuna 0.5% marketplace fee na vsak uspešen nakup/sprejeto ponudbo
*
* Opomba: RWAToken._update zaračuna 0.5% transfer fee ob vsakem prenosu RWA tokenov.
*/
interface IKYCWhitelist {
function isWhitelisted(address account) external view returns (bool);
}
contract Marketplace is Ownable, ReentrancyGuard, Pausable, AdminZamik {
using SafeERC20 for IERC20;
// --- Konstante ---
uint256 public constant MARKETPLACE_FEE_BPS = 50; // 0.5%
// --- State ---
address public feeRecipient;
address public usdc; // USDC contract na PulseChain
address public kyc; // KYCWhitelist; ce address(0), je KYC gating IZKLOPLJEN (testno)
uint256 public nextListingId;
uint256 public nextOfferId;
// --- Escrow racunovodstvo (zascita pred dvigom tujih sredstev) ---
/// @notice USDC, zaklenjen v aktivnih ponudbah kupcev.
uint256 public escrowedUsdc;
/// @notice RWA tokeni po naslovu, zaklenjeni v aktivnih listingih.
mapping(address => uint256) public escrowedRwa;
struct Listing {
address seller;
address rwaToken; // kateri RWA asset
uint256 amount; // koliko RWA tokenov je na prodaj
uint256 pricePerToken; // cena v USDC (6 decimals) za 1 RWA token (18 decimals)
bool active;
bool isPrimary; // true = prvotna prodaja od lastnika asseta
bool acceptsOffers; // NOVO: true = kupci lahko oddajo svoje ponudbe
}
struct Offer {
address buyer;
uint256 listingId;
uint256 amount; // količina RWA (18 decimals)
uint256 pricePerToken; // ponujena cena v USDC (6 decimals)
uint256 lockedUsdc; // dejanski znesek zaklenjenega USDC-ja (escrow)
bool active; // true = ponudba čaka na odgovor
}
mapping(uint256 => Listing) public listings;
mapping(uint256 => Offer) public offers;
// rwaToken → seznam aktivnih listing ID-jev
mapping(address => uint256[]) public tokenListings;
// listingId → seznam vseh ponudb (offer ID-jev)
mapping(uint256 => uint256[]) public listingOffers;
// --- Events ---
event Listed(
uint256 indexed listingId,
address indexed seller,
address indexed rwaToken,
uint256 amount,
uint256 pricePerToken,
bool isPrimary,
bool acceptsOffers
);
event Purchased(
uint256 indexed listingId,
address indexed buyer,
uint256 amount,
uint256 totalUsdc,
uint256 fee
);
event ListingCancelled(uint256 indexed listingId, address indexed seller);
event ListingUpdated(uint256 indexed listingId, uint256 newPrice, uint256 newAmount);
event FeeRecipientUpdated(address indexed newRecipient);
// Novi eventi za modul ponudb
event OfferMade(
uint256 indexed offerId,
uint256 indexed listingId,
address indexed buyer,
uint256 amount,
uint256 pricePerToken,
uint256 lockedUsdc
);
event OfferAccepted(
uint256 indexed offerId,
uint256 indexed listingId,
address indexed buyer,
uint256 amount,
uint256 lockedUsdc
);
event OfferCancelled(uint256 indexed offerId, address indexed by);
// --- Constructor ---
constructor(address _usdc, address _feeRecipient, address _kyc) Ownable(msg.sender) {
require(_usdc != address(0), "USDC zero address");
require(_feeRecipient != address(0), "Fee recipient zero address");
usdc = _usdc;
feeRecipient = _feeRecipient;
kyc = _kyc; // lahko address(0) = KYC gating izklopljen (testno)
}
// --- KYC ---
/// @notice Ce je kyc nastavljen, mora klicatelj biti na beli listi.
modifier onlyVerified() {
require(kyc == address(0) || IKYCWhitelist(kyc).isWhitelisted(msg.sender), "Zahtevan KYC pregled");
_;
}
/// @notice 1. korak: javno napovej zamenjavo KYC liste.
/// @dev Zamenjava KYC liste je najmocnejsa nastavitev, ki jo owner ima —
/// napacna ali podtaknjena lista lahko komurkoli odpre trgovanje ali
/// posteno preverjenim zapre. Zato javno in z zamikom.
function napoviSetKyc(address _kyc) external onlyOwner {
_napovej(keccak256(abi.encode("setKyc", _kyc)), "Marketplace.setKyc");
}
/// @notice 2. korak: izvedi, ko je zamik potekel. Velja SAMO za napovedani naslov.
function setKyc(address _kyc) external onlyOwner {
_porabi(keccak256(abi.encode("setKyc", _kyc)), "Marketplace.setKyc");
kyc = _kyc;
}
// --- Listing ---
/**
* @notice Ustvari nov listing — primarni (prvotni lastnik) ali sekundarni (kupec naprej prodaja)
* @param rwaToken naslov RWA ERC-20 kontrakta
* @param amount število RWA tokenov za prodajo (18 decimals)
* @param pricePerToken cena v USDC za 1 RWA token (6 decimals)
* @param isPrimary true = prvotna tokenizacija, false = sekundarni trg
* @param acceptsOffers true = omogoči zbiranje ponudb na oglasu
*
* @dev NAMERNO brez onlyVerified: kdor ima RWA tokene za listanje, je zaradi
* KYC restrikcije v RWAToken._update ze preverjen (nepreverjen naslov jih
* sploh ne more prejeti). Dodaten gating tu bi bil odvecen, prodajalcu pa
* bi lahko zaprl pot do prodaje. Preverjeno s testi 30.7.2026.
*/
function list(
address rwaToken,
uint256 amount,
uint256 pricePerToken,
bool isPrimary,
bool acceptsOffers
) external nonReentrant whenNotPaused returns (uint256 listingId) {
require(rwaToken != address(0), "Invalid token");
require(amount > 0, "Amount must be > 0");
require(pricePerToken > 0, "Price must be > 0");
// Preveri da prodajalec ima dovolj tokenov
require(
IERC20(rwaToken).balanceOf(msg.sender) >= amount,
"Insufficient RWA balance"
);
// Escrow: prenesi RWA tokene v Marketplace kontrakt
// (RWAToken._update bo zaračunal 0.5% transfer fee — tokeni prispejo zmanjšani)
uint256 beforeBalance = IERC20(rwaToken).balanceOf(address(this));
IERC20(rwaToken).safeTransferFrom(msg.sender, address(this), amount);
uint256 afterBalance = IERC20(rwaToken).balanceOf(address(this));
uint256 received = afterBalance - beforeBalance; // dejanski prejeti znesek (po RWA fee)
escrowedRwa[rwaToken] += received;
listingId = nextListingId++;
listings[listingId] = Listing({
seller: msg.sender,
rwaToken: rwaToken,
amount: received, // dejansko shranjeni tokeni (po 0.5% RWA transfer fee)
pricePerToken: pricePerToken,
active: true,
isPrimary: isPrimary,
acceptsOffers: acceptsOffers
});
tokenListings[rwaToken].push(listingId);
emit Listed(listingId, msg.sender, rwaToken, received, pricePerToken, isPrimary, acceptsOffers);
}
/**
* @notice Kupi RWA tokene iz listinga (Fiksna cena)
*/
function buy(uint256 listingId, uint256 amount) external nonReentrant whenNotPaused onlyVerified {
Listing storage l = listings[listingId];
require(l.active, "Listing not active");
require(amount > 0 && amount <= l.amount, "Invalid amount");
require(msg.sender != l.seller, "Cannot buy your own listing");
// Izračun USDC stroškov
uint256 totalUsdc = amount * l.pricePerToken / 1e18;
require(totalUsdc > 0, "Price too low");
// Marketplace fee: 0.5% od kupca
uint256 fee = totalUsdc * MARKETPLACE_FEE_BPS / 10_000;
uint256 sellerReceives = totalUsdc - fee;
// Kupec plača USDC
IERC20(usdc).safeTransferFrom(msg.sender, l.seller, sellerReceives);
IERC20(usdc).safeTransferFrom(msg.sender, feeRecipient, fee);
// Posodobi listing
l.amount -= amount;
if (l.amount == 0) {
l.active = false;
}
escrowedRwa[l.rwaToken] -= amount;
// Pošlji RWA tokene kupcu
IERC20(l.rwaToken).safeTransfer(msg.sender, amount);
emit Purchased(listingId, msg.sender, amount, totalUsdc, fee);
}
/**
* @notice Prekliči listing in vrni RWA tokene prodajalcu
*/
function cancelListing(uint256 listingId) external nonReentrant {
Listing storage l = listings[listingId];
require(l.active, "Not active");
require(msg.sender == l.seller || msg.sender == owner(), "Not authorized");
l.active = false;
// Vrni tokene prodajalcu
uint256 vrniAmount = l.amount;
l.amount = 0;
escrowedRwa[l.rwaToken] -= vrniAmount;
IERC20(l.rwaToken).safeTransfer(l.seller, vrniAmount);
emit ListingCancelled(listingId, l.seller);
}
/**
* @notice Posodobi ceno ali količino obstoječega listinga
*/
function updateListing(
uint256 listingId,
uint256 newPricePerToken,
uint256 additionalAmount
) external nonReentrant {
Listing storage l = listings[listingId];
require(l.active, "Not active");
require(msg.sender == l.seller, "Not seller");
require(newPricePerToken > 0, "Price must be > 0");
if (newPricePerToken != l.pricePerToken) {
l.pricePerToken = newPricePerToken;
}
if (additionalAmount > 0) {
uint256 before = IERC20(l.rwaToken).balanceOf(address(this));
IERC20(l.rwaToken).safeTransferFrom(msg.sender, address(this), additionalAmount);
uint256 received = IERC20(l.rwaToken).balanceOf(address(this)) - before;
l.amount += received;
escrowedRwa[l.rwaToken] += received;
}
emit ListingUpdated(listingId, newPricePerToken, l.amount);
}
// --- Modul: Daj Ponudbo (Make an Offer) ---
/**
* @notice Kupec odda ponudbo in zaklene svoj USDC v pametno pogodbo
*/
function makeOffer(uint256 listingId, uint256 amount, uint256 pricePerToken) external nonReentrant whenNotPaused onlyVerified {
Listing storage l = listings[listingId];
require(l.active, "Listing not active");
require(l.acceptsOffers, "Offers not allowed on this listing");
require(amount > 0 && amount <= l.amount, "Invalid amount");
require(pricePerToken > 0, "Price must be > 0");
require(msg.sender != l.seller, "Cannot bid on own listing");
uint256 totalUsdc = amount * pricePerToken / 1e18;
require(totalUsdc > 0, "Total USDC too low");
uint256 offerId = nextOfferId++;
// Escrow: Zakleni kupčev USDC v pogodbo
IERC20(usdc).safeTransferFrom(msg.sender, address(this), totalUsdc);
escrowedUsdc += totalUsdc;
offers[offerId] = Offer({
buyer: msg.sender,
listingId: listingId,
amount: amount,
pricePerToken: pricePerToken,
lockedUsdc: totalUsdc,
active: true
});
listingOffers[listingId].push(offerId);
emit OfferMade(offerId, listingId, msg.sender, amount, pricePerToken, totalUsdc);
}
/**
* @notice Prodajalec sprejme ponudbo. RWA gre kupcu, USDC prodajalcu.
*/
function acceptOffer(uint256 offerId) external nonReentrant whenNotPaused {
Offer storage o = offers[offerId];
require(o.active, "Offer not active");
Listing storage l = listings[o.listingId];
require(l.active, "Listing not active");
require(msg.sender == l.seller, "Only seller can accept");
// Če se je listing medtem delno razprodal, ponudba morda presega zalogo
require(o.amount <= l.amount, "Offer amount exceeds available RWA");
o.active = false;
// Izračun feejev (od zaklenjenega USDC zneska)
uint256 fee = o.lockedUsdc * MARKETPLACE_FEE_BPS / 10_000;
uint256 sellerReceives = o.lockedUsdc - fee;
// Posodobi zalogo v listingu
l.amount -= o.amount;
if (l.amount == 0) {
l.active = false;
}
// Sprosti escrow racunovodstvo (USDC gre prodajalcu+fee, RWA kupcu)
escrowedUsdc -= o.lockedUsdc;
escrowedRwa[l.rwaToken] -= o.amount;
// 1. Prenos USDC (iz escrowa pogodbe → prodajalcu in marketplaceu)
IERC20(usdc).safeTransfer(l.seller, sellerReceives);
IERC20(usdc).safeTransfer(feeRecipient, fee);
// 2. Prenos RWA (iz escrowa pogodbe → kupcu)
// Opozorilo: RWAToken pogodba bo kupcu odštela 0.5% pri prejemu,
// ampak iz Marketplace pogodbe gre točen amount, kar ohranja natančno računovodstvo.
IERC20(l.rwaToken).safeTransfer(o.buyer, o.amount);
emit OfferAccepted(offerId, o.listingId, o.buyer, o.amount, o.lockedUsdc);
}
/**
* @notice Kupec umakne ponudbo ali prodajalec zavrne ponudbo (USDC se vrne kupcu)
*/
function cancelOffer(uint256 offerId) external nonReentrant {
Offer storage o = offers[offerId];
require(o.active, "Offer not active");
Listing storage l = listings[o.listingId];
// Preklic lahko sproži samo kupec ALI lastnik listinga (kot zavrnitev)
require(msg.sender == o.buyer || msg.sender == l.seller, "Not authorized to cancel");
o.active = false;
// Vrni zaklenjeni USDC kupcu
escrowedUsdc -= o.lockedUsdc;
IERC20(usdc).safeTransfer(o.buyer, o.lockedUsdc);
emit OfferCancelled(offerId, msg.sender);
}
// --- View funkcije ---
/**
* @notice Vrni vse aktivne listinge za določen RWA token
*/
function getActiveListings(address rwaToken) external view returns (uint256[] memory activeIds) {
uint256[] storage all = tokenListings[rwaToken];
uint256 count = 0;
for (uint256 i = 0; i < all.length; i++) {
if (listings[all[i]].active) count++;
}
activeIds = new uint256[](count);
uint256 idx = 0;
for (uint256 i = 0; i < all.length; i++) {
if (listings[all[i]].active) {
activeIds[idx++] = all[i];
}
}
}
/**
* @notice Vrni vse aktivne ponudbe za specifičen listing
*/
function getActiveOffers(uint256 listingId) external view returns (uint256[] memory activeOfferIds) {
uint256[] storage all = listingOffers[listingId];
uint256 count = 0;
for (uint256 i = 0; i < all.length; i++) {
if (offers[all[i]].active) count++;
}
activeOfferIds = new uint256[](count);
uint256 idx = 0;
for (uint256 i = 0; i < all.length; i++) {
if (offers[all[i]].active) {
activeOfferIds[idx++] = all[i];
}
}
}
/**
* @notice Izračun skupnega USDC za fiksni nakup
*/
function quoteBuy(uint256 listingId, uint256 amount)
external view
returns (uint256 totalUsdc, uint256 fee, uint256 sellerReceives)
{
Listing storage l = listings[listingId];
require(l.active, "Not active");
require(amount <= l.amount, "Exceeds available");
totalUsdc = amount * l.pricePerToken / 1e18;
fee = totalUsdc * MARKETPLACE_FEE_BPS / 10_000;
sellerReceives = totalUsdc - fee;
}
/**
* @notice Izračun stroškov pri oddaji ponudbe brez predhodnega kreiranja
*/
function quoteOffer(uint256 amount, uint256 pricePerToken)
external pure
returns (uint256 totalUsdc, uint256 fee, uint256 sellerReceives)
{
totalUsdc = amount * pricePerToken / 1e18;
fee = totalUsdc * MARKETPLACE_FEE_BPS / 10_000;
sellerReceives = totalUsdc - fee;
}
// --- Admin ---
function napoviSetFeeRecipient(address _feeRecipient) external onlyOwner {
require(_feeRecipient != address(0), "Zero address");
_napovej(keccak256(abi.encode("setFeeRecipient", _feeRecipient)), "Marketplace.setFeeRecipient");
}
function setFeeRecipient(address _feeRecipient) external onlyOwner {
require(_feeRecipient != address(0), "Zero address");
_porabi(keccak256(abi.encode("setFeeRecipient", _feeRecipient)), "Marketplace.setFeeRecipient");
feeRecipient = _feeRecipient;
emit FeeRecipientUpdated(_feeRecipient);
}
/**
* @notice Zamenjava placilnega tokena — dovoljena SAMO, ko ni zaklenjenega USDC.
* @dev Prej je bila zamenjava mozna kadarkoli: ce bi owner zamenjal USDC med
* aktivnimi ponudbami, bi cancelOffer vracal NAPACEN token in kupcev
* USDC bi ostal ujet. Zdaj je to onemogoceno.
*/
function napoviSetUsdc(address _usdc) external onlyOwner {
require(_usdc != address(0), "Zero address");
_napovej(keccak256(abi.encode("setUsdc", _usdc)), "Marketplace.setUsdc");
}
function setUsdc(address _usdc) external onlyOwner {
require(_usdc != address(0), "Zero address");
require(escrowedUsdc == 0, "Escrow ni prazen");
_porabi(keccak256(abi.encode("setUsdc", _usdc)), "Marketplace.setUsdc");
usdc = _usdc;
}
// --- Zasilna zavora ---
/**
* Zakaj ima pravico ustaviti VEC naslovov, spreminjati nastavitve pa samo owner:
* skoda, ki jo zmore podtaknjen zaustavljalec, je ustavljeno trgovanje —
* neprijetno, a ni kraje, in owner ga z unpause() takoj razveljavi. Skoda
* zaradi PREPOZNE zaustavitve pa je lahko trajna. Zato je pri tej edini
* funkciji hitrost vredna vec kot ozek dostop.
*
* Ledger je lahko v sefu; nadzorni sistem in rezervna denarnica ne.
*/
mapping(address => bool) public jeZaustavljalec;
event ZaustavljalecSpremenjen(address indexed kdo, bool lahko);
/// @dev Takojsno v obe smeri. Podelitev je nizko tveganje, odvzem pa mora
/// biti hiter — ob razkritem kljucu ga ne smes cakati 48 ur odstraniti.
function nastaviZaustavljalca(address kdo, bool lahko) external onlyOwner {
require(kdo != address(0), "Zero address");
jeZaustavljalec[kdo] = lahko;
emit ZaustavljalecSpremenjen(kdo, lahko);
}
/// @notice Ustavi NOVE posle (list/buy/makeOffer/acceptOffer).
/// @dev Izhodi (cancelListing, cancelOffer, updateListing) NAMERNO ostanejo
/// delujoci tudi med pavzo — uporabnik mora vedno lahko do svojih sredstev.
function pause() external {
require(msg.sender == owner() || jeZaustavljalec[msg.sender], "Ni pooblascen za zaustavitev");
_pause();
}
/// @dev Zagon nazaj ostane samo pri ownerju: ustaviti mora biti lahko,
/// spet odpreti pa tezko.
function unpause() external onlyOwner {
_unpause();
}
/**
* @notice Emergency: owner lahko dvigne SAMO presezek nad zaklenjenimi sredstvi
* (npr. pomotoma poslane tokene).
* @dev POPRAVLJENO (30.7.2026): prej je ta funkcija lahko dvignila tudi USDC,
* zaklenjen v ponudbah kupcev, in RWA iz aktivnih listingov — torej TUJA
* sredstva. Zdaj escrow racunovodstvo (escrowedUsdc / escrowedRwa) tvori
* spodnjo mejo, ki je owner ne more prebiti.
*/
function emergencyWithdraw(address token, uint256 amount) external onlyOwner {
uint256 zaklenjeno = token == usdc ? escrowedUsdc : escrowedRwa[token];
uint256 stanje = IERC20(token).balanceOf(address(this));
require(stanje >= zaklenjeno, "Nekonsistenten escrow");
require(stanje - zaklenjeno >= amount, "Presega prosti presezek");
IERC20(token).safeTransfer(owner(), amount);
}
/// @notice Onemogoceno: pomotoma poslan renounceOwnership() bi trajno ubil
/// pause(), fee nastavitve in KYC preklop.
function renounceOwnership() public pure override {
revert("Renounce onemogocen");
}
}
@openzeppelin/contracts/interfaces/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)
pragma solidity >=0.4.16;
import {IERC20} from "../token/ERC20/IERC20.sol";
@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
if (!_safeTransfer(token, to, value, true)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
if (!_safeTransferFrom(token, from, to, value, true)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _safeTransfer(token, to, value, false);
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _safeTransferFrom(token, from, to, value, false);
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
if (!_safeApprove(token, spender, value, false)) {
if (!_safeApprove(token, spender, 0, true)) revert SafeERC20FailedOperation(address(token));
if (!_safeApprove(token, spender, value, true)) revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Oppositely, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity `token.transfer(to, value)` call, relaxing the requirement on the return value: the
* return value is optional (but if data is returned, it must not be false).
*
* @param token The token targeted by the call.
* @param to The recipient of the tokens
* @param value The amount of token to transfer
* @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
*/
function _safeTransfer(IERC20 token, address to, uint256 value, bool bubble) private returns (bool success) {
bytes4 selector = IERC20.transfer.selector;
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(0x00, selector)
mstore(0x04, and(to, shr(96, not(0))))
mstore(0x24, value)
success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)
// if call success and return is true, all is good.
// otherwise (not success or return is not true), we need to perform further checks
if iszero(and(success, eq(mload(0x00), 1))) {
// if the call was a failure and bubble is enabled, bubble the error
if and(iszero(success), bubble) {
returndatacopy(fmp, 0x00, returndatasize())
revert(fmp, returndatasize())
}
// if the return value is not true, then the call is only successful if:
// - the token address has code
// - the returndata is empty
success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
}
mstore(0x40, fmp)
}
}
/**
* @dev Imitates a Solidity `token.transferFrom(from, to, value)` call, relaxing the requirement on the return
* value: the return value is optional (but if data is returned, it must not be false).
*
* @param token The token targeted by the call.
* @param from The sender of the tokens
* @param to The recipient of the tokens
* @param value The amount of token to transfer
* @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
*/
function _safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value,
bool bubble
) private returns (bool success) {
bytes4 selector = IERC20.transferFrom.selector;
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(0x00, selector)
mstore(0x04, and(from, shr(96, not(0))))
mstore(0x24, and(to, shr(96, not(0))))
mstore(0x44, value)
success := call(gas(), token, 0, 0x00, 0x64, 0x00, 0x20)
// if call success and return is true, all is good.
// otherwise (not success or return is not true), we need to perform further checks
if iszero(and(success, eq(mload(0x00), 1))) {
// if the call was a failure and bubble is enabled, bubble the error
if and(iszero(success), bubble) {
returndatacopy(fmp, 0x00, returndatasize())
revert(fmp, returndatasize())
}
// if the return value is not true, then the call is only successful if:
// - the token address has code
// - the returndata is empty
success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
}
mstore(0x40, fmp)
mstore(0x60, 0)
}
}
/**
* @dev Imitates a Solidity `token.approve(spender, value)` call, relaxing the requirement on the return value:
* the return value is optional (but if data is returned, it must not be false).
*
* @param token The token targeted by the call.
* @param spender The spender of the tokens
* @param value The amount of token to transfer
* @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
*/
function _safeApprove(IERC20 token, address spender, uint256 value, bool bubble) private returns (bool success) {
bytes4 selector = IERC20.approve.selector;
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(0x00, selector)
mstore(0x04, and(spender, shr(96, not(0))))
mstore(0x24, value)
success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)
// if call success and return is true, all is good.
// otherwise (not success or return is not true), we need to perform further checks
if iszero(and(success, eq(mload(0x00), 1))) {
// if the call was a failure and bubble is enabled, bubble the error
if and(iszero(success), bubble) {
returndatacopy(fmp, 0x00, returndatasize())
revert(fmp, returndatasize())
}
// if the return value is not true, then the call is only successful if:
// - the token address has code
// - the returndata is empty
success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
}
mstore(0x40, fmp)
}
}
}
@openzeppelin/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
@openzeppelin/contracts/utils/ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
import {StorageSlot} from "./StorageSlot.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*
* IMPORTANT: Deprecated. This storage-based reentrancy guard will be removed and replaced
* by the {ReentrancyGuardTransient} variant in v6.0.
*
* @custom:stateless
*/
abstract contract ReentrancyGuard {
using StorageSlot for bytes32;
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant REENTRANCY_GUARD_STORAGE =
0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_reentrancyGuardStorageSlot().getUint256Slot().value = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
/**
* @dev A `view` only version of {nonReentrant}. Use to block view functions
* from being called, preventing reading from inconsistent contract state.
*
* CAUTION: This is a "view" modifier and does not change the reentrancy
* status. Use it only on view functions. For payable or non-payable functions,
* use the standard {nonReentrant} modifier instead.
*/
modifier nonReentrantView() {
_nonReentrantBeforeView();
_;
}
function _nonReentrantBeforeView() private view {
if (_reentrancyGuardEntered()) {
revert ReentrancyGuardReentrantCall();
}
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
_nonReentrantBeforeView();
// Any calls to nonReentrant after this point will fail
_reentrancyGuardStorageSlot().getUint256Slot().value = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_reentrancyGuardStorageSlot().getUint256Slot().value = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _reentrancyGuardStorageSlot().getUint256Slot().value == ENTERED;
}
function _reentrancyGuardStorageSlot() internal pure virtual returns (bytes32) {
return REENTRANCY_GUARD_STORAGE;
}
}
@openzeppelin/contracts/utils/Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
bool private _paused;
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
@openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}},"optimizer":{"runs":200,"enabled":true},"libraries":{},"evmVersion":"paris"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_usdc","internalType":"address"},{"type":"address","name":"_feeRecipient","internalType":"address"},{"type":"address","name":"_kyc","internalType":"address"}]},{"type":"error","name":"EnforcedPause","inputs":[]},{"type":"error","name":"ExpectedPause","inputs":[]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"ReentrancyGuardReentrantCall","inputs":[]},{"type":"error","name":"SafeERC20FailedOperation","inputs":[{"type":"address","name":"token","internalType":"address"}]},{"type":"event","name":"FeeRecipientUpdated","inputs":[{"type":"address","name":"newRecipient","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Listed","inputs":[{"type":"uint256","name":"listingId","internalType":"uint256","indexed":true},{"type":"address","name":"seller","internalType":"address","indexed":true},{"type":"address","name":"rwaToken","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"pricePerToken","internalType":"uint256","indexed":false},{"type":"bool","name":"isPrimary","internalType":"bool","indexed":false},{"type":"bool","name":"acceptsOffers","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"ListingCancelled","inputs":[{"type":"uint256","name":"listingId","internalType":"uint256","indexed":true},{"type":"address","name":"seller","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"ListingUpdated","inputs":[{"type":"uint256","name":"listingId","internalType":"uint256","indexed":true},{"type":"uint256","name":"newPrice","internalType":"uint256","indexed":false},{"type":"uint256","name":"newAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OfferAccepted","inputs":[{"type":"uint256","name":"offerId","internalType":"uint256","indexed":true},{"type":"uint256","name":"listingId","internalType":"uint256","indexed":true},{"type":"address","name":"buyer","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"lockedUsdc","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OfferCancelled","inputs":[{"type":"uint256","name":"offerId","internalType":"uint256","indexed":true},{"type":"address","name":"by","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OfferMade","inputs":[{"type":"uint256","name":"offerId","internalType":"uint256","indexed":true},{"type":"uint256","name":"listingId","internalType":"uint256","indexed":true},{"type":"address","name":"buyer","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"pricePerToken","internalType":"uint256","indexed":false},{"type":"uint256","name":"lockedUsdc","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Purchased","inputs":[{"type":"uint256","name":"listingId","internalType":"uint256","indexed":true},{"type":"address","name":"buyer","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"totalUsdc","internalType":"uint256","indexed":false},{"type":"uint256","name":"fee","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"SpremembaIzvedena","inputs":[{"type":"bytes32","name":"id","internalType":"bytes32","indexed":true},{"type":"string","name":"kaj","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"SpremembaNapovedana","inputs":[{"type":"bytes32","name":"id","internalType":"bytes32","indexed":true},{"type":"string","name":"kaj","internalType":"string","indexed":false},{"type":"uint256","name":"izvedljivoOd","internalType":"uint256","indexed":false},{"type":"uint256","name":"potece","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"SpremembaPreklicana","inputs":[{"type":"bytes32","name":"id","internalType":"bytes32","indexed":true},{"type":"string","name":"kaj","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"ZaustavljalecSpremenjen","inputs":[{"type":"address","name":"kdo","internalType":"address","indexed":true},{"type":"bool","name":"lahko","internalType":"bool","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MARKETPLACE_FEE_BPS","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ROK","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"acceptOffer","inputs":[{"type":"uint256","name":"offerId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"buy","inputs":[{"type":"uint256","name":"listingId","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cancelListing","inputs":[{"type":"uint256","name":"listingId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cancelOffer","inputs":[{"type":"uint256","name":"offerId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyWithdraw","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"escrowedRwa","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"escrowedUsdc","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"feeRecipient","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"activeIds","internalType":"uint256[]"}],"name":"getActiveListings","inputs":[{"type":"address","name":"rwaToken","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"activeOfferIds","internalType":"uint256[]"}],"name":"getActiveOffers","inputs":[{"type":"uint256","name":"listingId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"izvedljivoOd","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"jeZaustavljalec","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"kyc","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"listingId","internalType":"uint256"}],"name":"list","inputs":[{"type":"address","name":"rwaToken","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"pricePerToken","internalType":"uint256"},{"type":"bool","name":"isPrimary","internalType":"bool"},{"type":"bool","name":"acceptsOffers","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"listingOffers","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"seller","internalType":"address"},{"type":"address","name":"rwaToken","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"pricePerToken","internalType":"uint256"},{"type":"bool","name":"active","internalType":"bool"},{"type":"bool","name":"isPrimary","internalType":"bool"},{"type":"bool","name":"acceptsOffers","internalType":"bool"}],"name":"listings","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"makeOffer","inputs":[{"type":"uint256","name":"listingId","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"pricePerToken","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"napoviSetFeeRecipient","inputs":[{"type":"address","name":"_feeRecipient","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"napoviSetKyc","inputs":[{"type":"address","name":"_kyc","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"napoviSetUsdc","inputs":[{"type":"address","name":"_usdc","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"nastaviZaustavljalca","inputs":[{"type":"address","name":"kdo","internalType":"address"},{"type":"bool","name":"lahko","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"nextListingId","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"nextOfferId","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"buyer","internalType":"address"},{"type":"uint256","name":"listingId","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"pricePerToken","internalType":"uint256"},{"type":"uint256","name":"lockedUsdc","internalType":"uint256"},{"type":"bool","name":"active","internalType":"bool"}],"name":"offers","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"prekliciSpremembo","inputs":[{"type":"bytes32","name":"id","internalType":"bytes32"},{"type":"string","name":"kaj","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"totalUsdc","internalType":"uint256"},{"type":"uint256","name":"fee","internalType":"uint256"},{"type":"uint256","name":"sellerReceives","internalType":"uint256"}],"name":"quoteBuy","inputs":[{"type":"uint256","name":"listingId","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"totalUsdc","internalType":"uint256"},{"type":"uint256","name":"fee","internalType":"uint256"},{"type":"uint256","name":"sellerReceives","internalType":"uint256"}],"name":"quoteOffer","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"pricePerToken","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeRecipient","inputs":[{"type":"address","name":"_feeRecipient","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setKyc","inputs":[{"type":"address","name":"_kyc","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setUsdc","inputs":[{"type":"address","name":"_usdc","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"napovedana","internalType":"bool"},{"type":"uint256","name":"od","internalType":"uint256"},{"type":"uint256","name":"potece","internalType":"uint256"},{"type":"bool","name":"izvedljivaZdaj","internalType":"bool"}],"name":"stanjeNapovedi","inputs":[{"type":"bytes32","name":"id","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenListings","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateListing","inputs":[{"type":"uint256","name":"listingId","internalType":"uint256"},{"type":"uint256","name":"newPricePerToken","internalType":"uint256"},{"type":"uint256","name":"additionalAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"usdc","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"zamik","inputs":[]}]
Contract Creation Code
0x60806040523480156200001157600080fd5b50604051620033b5380380620033b58339810160408190526200003491620001e7565b82828233806200005f57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6200006a816200017a565b5060017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00556001600160a01b038316620000db5760405162461bcd60e51b815260206004820152601160248201527055534443207a65726f206164647265737360781b604482015260640162000056565b6001600160a01b038216620001335760405162461bcd60e51b815260206004820152601a60248201527f46656520726563697069656e74207a65726f2061646472657373000000000000604482015260640162000056565b600380546001600160a01b039485166001600160a01b0319918216179091556002805493851693821693909317909255600480549190931691161790555062000231915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620001e257600080fd5b919050565b600080600060608486031215620001fd57600080fd5b6200020884620001ca565b92506200021860208501620001ca565b91506200022860408501620001ca565b90509250925092565b61317480620002416000396000f3fe608060405234801561001057600080fd5b50600436106102695760003560e01c80638902f58a11610151578063cb146879116100c3578063e74b981b11610087578063e74b981b1461068c578063e826f69a1461069f578063ef706adf146106a9578063f2fde38b146106bc578063f6cf2a16146106cf578063f998a865146106e257600080fd5b8063cb146879146105a6578063d48693d1146105b9578063d6febde8146105c1578063de74e57b146105d4578063e210a72d1461067957600080fd5b806395ccea671161011557806395ccea671461052e57806398625fe91461054157806399c2720614610554578063a9a9855d14610567578063aaccf1ec1461058a578063c815729d1461059357600080fd5b80638902f58a146104655780638a72ea6a1461046e5780638da5cb5b146104f757806390d6b45f1461050857806394a4b5611461051b57600080fd5b806346904840116101ea5780636286935b116101ae5780636286935b146103d8578063715018a6146103f857806376e382c814610400578063776528cd1461041357806383a221ec1461044a5780638456cb591461045d57600080fd5b8063469048401461036b5780634a2ddbd11461037e578063599b9bdb146103915780635c975abb146103b15780635f5d0655146103cf57600080fd5b8063305a67a811610231578063305a67a81461030a5780633e413bee1461031d5780633ed0fe35146103485780633f4ba83a1461035b578063465de68b1461036357600080fd5b80630854eef51461026e57806320e33db8146102a1578063246073e1146102b457806325b49a50146102e2578063263c1e61146102f7575b600080fd5b61028e61027c366004612c0c565b60016020526000908152604090205481565b6040519081526020015b60405180910390f35b61028e6102af366004612c25565b6106f5565b6102c76102c2366004612c25565b610726565b60408051938452602084019290925290820152606001610298565b6102f56102f0366004612c63565b610776565b005b6102f5610305366004612c63565b610815565b6102f5610318366004612c0c565b610877565b600354610330906001600160a01b031681565b6040516001600160a01b039091168152602001610298565b61028e610356366004612c93565b6109c7565b6102f5610e8a565b61028e603281565b600254610330906001600160a01b031681565b6102f561038c366004612cf0565b610e9c565b61028e61039f366004612c63565b60086020526000908152604090205481565b600054600160a01b900460ff165b6040519015158152602001610298565b61028e60065481565b6103eb6103e6366004612c63565b610f29565b6040516102989190612d27565b6102f561108b565b6102f561040e366004612d6b565b6110c9565b610426610421366004612c0c565b611170565b60408051941515855260208501939093529183015215156060820152608001610298565b6103eb610458366004612c0c565b6111dd565b6102f561132c565b61028e60075481565b6104be61047c366004612c0c565b600a602052600090815260409020805460018201546002830154600384015460048501546005909501546001600160a01b039094169492939192909160ff1686565b604080516001600160a01b03909716875260208701959095529385019290925260608401526080830152151560a082015260c001610298565b6000546001600160a01b0316610330565b600454610330906001600160a01b031681565b61028e610529366004612de7565b6113a8565b6102f561053c366004612de7565b6113c4565b6102f561054f366004612c63565b611543565b6102f5610562366004612c63565b6115cc565b6103bf610575366004612c63565b600d6020526000908152604090205460ff1681565b61028e60055481565b6102f56105a1366004612c0c565b611650565b6102f56105b4366004612c63565b611942565b61025861028e565b6102f56105cf366004612c25565b611a30565b6106336105e2366004612c0c565b600960205260009081526040902080546001820154600283015460038401546004909401546001600160a01b03938416949390921692909160ff808216916101008104821691620100009091041687565b604080516001600160a01b03988916815297909616602088015294860193909352606085019190915215156080840152151560a0830152151560c082015260e001610298565b6102f5610687366004612e11565b611d8e565b6102f561069a366004612c63565b612177565b61028e62093a8081565b6102f56106b7366004612c0c565b612254565b6102f56106ca366004612c63565b6123c1565b6102f56106dd366004612e11565b6123fc565b6102c76106f0366004612c25565b61266c565b600c602052816000526040600020818154811061071157600080fd5b90600052602060002001600091509150505481565b60008080670de0b6b3a764000061073d8587612e53565b6107479190612e70565b9250612710610757603285612e53565b6107619190612e70565b915061076d8284612e92565b90509250925092565b61077e61273d565b6001600160a01b0381166107ad5760405162461bcd60e51b81526004016107a490612ea5565b60405180910390fd5b610812816040516020016107c19190612ecb565b604051602081830303815290604052805190602001206040518060400160405280601b81526020017f4d61726b6574706c6163652e736574466565526563697069656e74000000000081525061276a565b50565b61081d61273d565b610812816040516020016108319190612f05565b60405160208183030381529060405280519060200120604051806040016040528060128152602001714d61726b6574706c6163652e7365744b796360701b81525061276a565b61087f612817565b6000818152600960205260409020600481015460ff166108b15760405162461bcd60e51b81526004016107a490612f36565b80546001600160a01b03163314806108d357506000546001600160a01b031633145b6109105760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b60448201526064016107a4565b60048101805460ff1916905560028101805460009182905560018301546001600160a01b03168252600860205260408220805491928392610952908490612e92565b909155505081546001830154610975916001600160a01b03918216911683612833565b81546040516001600160a01b039091169084907f8e25282255ab31897df2b0456bb993ac7f84d376861aefd84901d2d63a7428a290600090a35050610812600160008051602061311f83398151915255565b60006109d1612817565b6109d9612868565b6001600160a01b038616610a1f5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b60448201526064016107a4565b60008511610a645760405162461bcd60e51b81526020600482015260126024820152710416d6f756e74206d757374206265203e20360741b60448201526064016107a4565b60008411610a845760405162461bcd60e51b81526004016107a490612f5a565b6040516370a0823160e01b815233600482015285906001600160a01b038816906370a0823190602401602060405180830381865afa158015610aca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aee9190612f85565b1015610b3c5760405162461bcd60e51b815260206004820152601860248201527f496e73756666696369656e74205257412062616c616e6365000000000000000060448201526064016107a4565b6040516370a0823160e01b81523060048201526000906001600160a01b038816906370a0823190602401602060405180830381865afa158015610b83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba79190612f85565b9050610bbe6001600160a01b038816333089612893565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa158015610c05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c299190612f85565b90506000610c378383612e92565b6001600160a01b038a16600090815260086020526040812080549293508392909190610c64908490612f9e565b909155505060058054906000610c7983612fb1565b9190505593506040518060e00160405280336001600160a01b031681526020018a6001600160a01b0316815260200182815260200188815260200160011515815260200187151581526020018615158152506009600086815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550604082015181600201556060820151816003015560808201518160040160006101000a81548160ff02191690831515021790555060a08201518160040160016101000a81548160ff02191690831515021790555060c08201518160040160026101000a81548160ff021916908315150217905550905050600b60008a6001600160a01b03166001600160a01b03168152602001908152602001600020849080600181540180825580915050600190039060005260206000200160009091909190915055886001600160a01b0316336001600160a01b0316857fedcbe03cf21c8355114ce8632db7b73334223be2cbeda6ae8ec946deb723cfb8848b8b8b604051610e5f94939291909384526020840192909252151560408301521515606082015260800190565b60405180910390a4505050610e81600160008051602061311f83398151915255565b95945050505050565b610e9261273d565b610e9a6128c9565b565b610ea461273d565b6001600160a01b038216610eca5760405162461bcd60e51b81526004016107a490612ea5565b6001600160a01b0382166000818152600d6020908152604091829020805460ff191685151590811790915591519182527f9562c728fd52688e7dc1a376e3ee2035e842ac8dff05803952c69492f957d88a910160405180910390a25050565b6001600160a01b0381166000908152600b60205260408120606091805b8254811015610fa25760096000848381548110610f6557610f65612fca565b6000918252602080832090910154835282019290925260400190206004015460ff1615610f9a5781610f9681612fb1565b9250505b600101610f46565b508067ffffffffffffffff811115610fbc57610fbc612fe0565b604051908082528060200260200182016040528015610fe5578160200160208202803683370190505b5092506000805b8354811015611082576009600085838154811061100b5761100b612fca565b6000918252602080832090910154835282019290925260400190206004015460ff161561107a5783818154811061104457611044612fca565b906000526020600020015485838061105b90612fb1565b94508151811061106d5761106d612fca565b6020026020010181815250505b600101610fec565b50505050919050565b60405162461bcd60e51b81526020600482015260136024820152722932b737bab731b29037b732b6b7b3b7b1b2b760691b60448201526064016107a4565b6110d161273d565b600083815260016020526040812054900361111e5760405162461bcd60e51b815260206004820152600d60248201526c4e69206e61706f766564616e6f60981b60448201526064016107a4565b600083815260016020526040808220919091555183907f72003eda7c2c39777210bccbf69141a92bbe56d746914a16f5ee3aaf5e6f7a83906111639085908590612ff6565b60405180910390a2505050565b6000818152600160205260408120548190819081908082036111a0576000806000809450945094509450506111d6565b6001816111b062093a8082612f9e565b8342101580156111cc57506111c862093a8085612f9e565b4211155b9450945094509450505b9193509193565b6000818152600c60205260408120606091805b825481101561124c57600a600084838154811061120f5761120f612fca565b6000918252602080832090910154835282019290925260400190206005015460ff1615611244578161124081612fb1565b9250505b6001016111f0565b508067ffffffffffffffff81111561126657611266612fe0565b60405190808252806020026020018201604052801561128f578160200160208202803683370190505b5092506000805b835481101561108257600a60008583815481106112b5576112b5612fca565b6000918252602080832090910154835282019290925260400190206005015460ff1615611324578381815481106112ee576112ee612fca565b906000526020600020015485838061130590612fb1565b94508151811061131757611317612fca565b6020026020010181815250505b600101611296565b6000546001600160a01b03163314806113545750336000908152600d602052604090205460ff165b6113a05760405162461bcd60e51b815260206004820152601c60248201527f4e6920706f6f626c617363656e207a61207a617573746176697465760000000060448201526064016107a4565b610e9a61291e565b600b602052816000526040600020818154811061071157600080fd5b6113cc61273d565b6003546000906001600160a01b03848116911614611402576001600160a01b038316600090815260086020526040902054611406565b6007545b6040516370a0823160e01b81523060048201529091506000906001600160a01b038516906370a0823190602401602060405180830381865afa158015611450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114749190612f85565b9050818110156114be5760405162461bcd60e51b81526020600482015260156024820152744e656b6f6e73697374656e74656e20657363726f7760581b60448201526064016107a4565b826114c98383612e92565b10156115175760405162461bcd60e51b815260206004820152601760248201527f507265736567612070726f7374692070726573657a656b00000000000000000060448201526064016107a4565b61153d61152c6000546001600160a01b031690565b6001600160a01b0386169085612833565b50505050565b61154b61273d565b6001600160a01b0381166115715760405162461bcd60e51b81526004016107a490612ea5565b610812816040516020016115859190613025565b60405160208183030381529060405280519060200120604051806040016040528060138152602001724d61726b6574706c6163652e7365745573646360681b81525061276a565b6115d461273d565b61162e816040516020016115e89190612f05565b60405160208183030381529060405280519060200120604051806040016040528060128152602001714d61726b6574706c6163652e7365744b796360701b815250612961565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b611658612817565b611660612868565b6000818152600a60205260409020600581015460ff166116b55760405162461bcd60e51b815260206004820152601060248201526f4f66666572206e6f742061637469766560801b60448201526064016107a4565b60018101546000908152600960205260409020600481015460ff166116ec5760405162461bcd60e51b81526004016107a490613057565b80546001600160a01b0316331461173e5760405162461bcd60e51b815260206004820152601660248201527513db9b1e481cd95b1b195c8818d85b881858d8d95c1d60521b60448201526064016107a4565b8060020154826002015411156117a15760405162461bcd60e51b815260206004820152602260248201527f4f6666657220616d6f756e74206578636565647320617661696c61626c652052604482015261574160f01b60648201526084016107a4565b60058201805460ff191690556004820154600090612710906117c590603290612e53565b6117cf9190612e70565b905060008184600401546117e39190612e92565b905083600201548360020160008282546117fd9190612e92565b9091555050600283015460000361181b5760048301805460ff191690555b8360040154600760008282546118319190612e92565b9091555050600284015460018401546001600160a01b031660009081526008602052604081208054909190611867908490612e92565b90915550508254600354611888916001600160a01b03918216911683612833565b6002546003546118a5916001600160a01b03918216911684612833565b8354600285015460018501546118c9926001600160a01b0391821692911690612833565b83546001850154600286015460048701546040516001600160a01b039094169389927f8f414bb7b1129208b5a842a85f18292a47ad72117cca38e4363cf80dc189ec169261191f92918252602082015260400190565b60405180910390a450505050610812600160008051602061311f83398151915255565b61194a61273d565b6001600160a01b0381166119705760405162461bcd60e51b81526004016107a490612ea5565b600754156119b35760405162461bcd60e51b815260206004820152601060248201526f22b9b1b937bb90373490383930bd32b760811b60448201526064016107a4565b611a0e816040516020016119c79190613025565b60405160208183030381529060405280519060200120604051806040016040528060138152602001724d61726b6574706c6163652e7365745573646360681b815250612961565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b611a38612817565b611a40612868565b6004546001600160a01b03161580611ac0575060048054604051633af32abf60e01b815233928101929092526001600160a01b031690633af32abf90602401602060405180830381865afa158015611a9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ac09190613083565b611b035760405162461bcd60e51b815260206004820152601460248201527316985a1d195d985b8812d650c81c1c9959db195960621b60448201526064016107a4565b6000828152600960205260409020600481015460ff16611b355760405162461bcd60e51b81526004016107a490613057565b600082118015611b49575080600201548211155b611b865760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b60448201526064016107a4565b80546001600160a01b03163303611bdf5760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f742062757920796f7572206f776e206c697374696e67000000000060448201526064016107a4565b6000670de0b6b3a7640000826003015484611bfa9190612e53565b611c049190612e70565b905060008111611c465760405162461bcd60e51b815260206004820152600d60248201526c507269636520746f6f206c6f7760981b60448201526064016107a4565b6000612710611c56603284612e53565b611c609190612e70565b90506000611c6e8284612e92565b8454600354919250611c8f916001600160a01b039081169133911684612893565b600254600354611cae916001600160a01b039182169133911685612893565b84846002016000828254611cc29190612e92565b90915550506002840154600003611ce05760048401805460ff191690555b60018401546001600160a01b031660009081526008602052604081208054879290611d0c908490612e92565b90915550506001840154611d2a906001600160a01b03163387612833565b6040805186815260208101859052908101839052339087907f6fdf4fde4cc12592feea1edbf6fcc530b69dd9a0ccf9f1138212c11fc11b42629060600160405180910390a350505050611d8a600160008051602061311f83398151915255565b5050565b611d96612817565b611d9e612868565b6004546001600160a01b03161580611e1e575060048054604051633af32abf60e01b815233928101929092526001600160a01b031690633af32abf90602401602060405180830381865afa158015611dfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1e9190613083565b611e615760405162461bcd60e51b815260206004820152601460248201527316985a1d195d985b8812d650c81c1c9959db195960621b60448201526064016107a4565b6000838152600960205260409020600481015460ff16611e935760405162461bcd60e51b81526004016107a490613057565b600481015462010000900460ff16611ef85760405162461bcd60e51b815260206004820152602260248201527f4f6666657273206e6f7420616c6c6f776564206f6e2074686973206c697374696044820152616e6760f01b60648201526084016107a4565b600083118015611f0c575080600201548311155b611f495760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b60448201526064016107a4565b60008211611f695760405162461bcd60e51b81526004016107a490612f5a565b80546001600160a01b03163303611fc25760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f7420626964206f6e206f776e206c697374696e670000000000000060448201526064016107a4565b6000670de0b6b3a7640000611fd78486612e53565b611fe19190612e70565b9050600081116120285760405162461bcd60e51b8152602060048201526012602482015271546f74616c205553444320746f6f206c6f7760701b60448201526064016107a4565b600680546000918261203983612fb1565b90915550600354909150612058906001600160a01b0316333085612893565b816007600082825461206a9190612f9e565b90915550506040805160c0810182523380825260208083018a81528385018a815260608086018b8152608087018a8152600160a0890181815260008c8152600a89528b81209a518b546001600160a01b0319166001600160a01b03909116178b5596518a830155945160028a01559151600389015551600488015591516005909601805460ff1916961515969096179095558b8252600c83528582208054918201815582529082902001859055835189815290810188905292830185905291889184917f87d488fb4bdf418b8e1ab59c465718c2de65b4ae7d41e7f8dc1ca270b86ba698910160405180910390a4505050612172600160008051602061311f83398151915255565b505050565b61217f61273d565b6001600160a01b0381166121a55760405162461bcd60e51b81526004016107a490612ea5565b61220a816040516020016121b99190612ecb565b604051602081830303815290604052805190602001206040518060400160405280601b81526020017f4d61726b6574706c6163652e736574466565526563697069656e740000000000815250612961565b600280546001600160a01b0319166001600160a01b0383169081179091556040517f7a7b5a0a132f9e0581eb8527f66eae9ee89c2a3e79d4ac7e41a1f1f4d48a7fc290600090a250565b61225c612817565b6000818152600a60205260409020600581015460ff166122b15760405162461bcd60e51b815260206004820152601060248201526f4f66666572206e6f742061637469766560801b60448201526064016107a4565b6001810154600090815260096020526040902081546001600160a01b03163314806122e5575080546001600160a01b031633145b6123315760405162461bcd60e51b815260206004820152601860248201527f4e6f7420617574686f72697a656420746f2063616e63656c000000000000000060448201526064016107a4565b60058201805460ff19169055600482015460078054600090612354908490612e92565b90915550508154600483015460035461237b926001600160a01b0391821692911690612833565b604051339084907f1f51377b3e685a0e2419f9bb4ba7c07ec54936353ba3d0fb3c6538dab676622290600090a35050610812600160008051602061311f83398151915255565b6123c961273d565b6001600160a01b0381166123f357604051631e4fbdf760e01b8152600060048201526024016107a4565b61081281612a8a565b612404612817565b6000838152600960205260409020600481015460ff166124365760405162461bcd60e51b81526004016107a490612f36565b80546001600160a01b0316331461247c5760405162461bcd60e51b815260206004820152600a6024820152692737ba1039b2b63632b960b11b60448201526064016107a4565b6000831161249c5760405162461bcd60e51b81526004016107a490612f5a565b806003015483146124af57600381018390555b811561260d5760018101546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612500573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125249190612f85565b6001830154909150612541906001600160a01b0316333086612893565b60018201546040516370a0823160e01b815230600482015260009183916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612590573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125b49190612f85565b6125be9190612e92565b9050808360020160008282546125d49190612f9e565b909155505060018301546001600160a01b031660009081526008602052604081208054839290612605908490612f9e565b909155505050505b837ff7adc9a0380a940c6058d78194df6a9b9fa5bb431bbad15194913bb611f3f4f784836002015460405161264c929190918252602082015260400190565b60405180910390a250612172600160008051602061311f83398151915255565b600082815260096020526040812060048101548291829160ff166126a25760405162461bcd60e51b81526004016107a490612f36565b80600201548511156126ea5760405162461bcd60e51b81526020600482015260116024820152704578636565647320617661696c61626c6560781b60448201526064016107a4565b670de0b6b3a76400008160030154866127039190612e53565b61270d9190612e70565b935061271061271d603286612e53565b6127279190612e70565b92506127338385612e92565b9150509250925092565b6000546001600160a01b03163314610e9a5760405163118cdaa760e01b81523360048201526024016107a4565b600082815260016020526040902054156127b65760405162461bcd60e51b815260206004820152600d60248201526c5a65206e61706f766564616e6f60981b60448201526064016107a4565b60006127c461025842612f9e565b60008481526001602052604090208190559050827f63a0d065f46e07e30a4f246d28eb53f839982100439173db92dbd5700ab37c15838361280862093a8082612f9e565b604051611163939291906130e6565b61281f612ada565b600260008051602061311f83398151915255565b6128408383836001612b0a565b61217257604051635274afe760e01b81526001600160a01b03841660048201526024016107a4565b600054600160a01b900460ff1615610e9a5760405163d93c066560e01b815260040160405180910390fd5b6128a1848484846001612b70565b61153d57604051635274afe760e01b81526001600160a01b03851660048201526024016107a4565b6128d1612be2565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b612926612868565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586129013390565b600082815260016020526040812054908190036129b05760405162461bcd60e51b815260206004820152600d60248201526c4e69206e61706f766564616e6f60981b60448201526064016107a4565b804210156129f65760405162461bcd60e51b815260206004820152601360248201527216985b5a5ac81cd9481b9a481c1bdd195ad95b606a1b60448201526064016107a4565b612a0362093a8082612f9e565b421115612a475760405162461bcd60e51b81526020600482015260126024820152714e61706f766564206a6520706f74656b6c6160701b60448201526064016107a4565b600083815260016020526040808220919091555183907ffac4537038ebc9eaa00d86a88a6c2e268012d306f6442966aab36014a19543239061116390859061310b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008051602061311f83398151915254600203610e9a57604051633ee5aeb560e01b815260040160405180910390fd5b60405163a9059cbb60e01b60008181526001600160a01b038616600452602485905291602083604481808b5af192506001600051148316612b64578383151615612b57573d6000823e3d81fd5b6000873b113d1516831692505b60405250949350505050565b6040516323b872dd60e01b60008181526001600160a01b038781166004528616602452604485905291602083606481808c5af192506001600051148316612bd0578383151615612bc3573d6000823e3d81fd5b6000883b113d1516831692505b60405250600060605295945050505050565b600054600160a01b900460ff16610e9a57604051638dfc202b60e01b815260040160405180910390fd5b600060208284031215612c1e57600080fd5b5035919050565b60008060408385031215612c3857600080fd5b50508035926020909101359150565b80356001600160a01b0381168114612c5e57600080fd5b919050565b600060208284031215612c7557600080fd5b612c7e82612c47565b9392505050565b801515811461081257600080fd5b600080600080600060a08688031215612cab57600080fd5b612cb486612c47565b945060208601359350604086013592506060860135612cd281612c85565b91506080860135612ce281612c85565b809150509295509295909350565b60008060408385031215612d0357600080fd5b612d0c83612c47565b91506020830135612d1c81612c85565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b81811015612d5f57835183529284019291840191600101612d43565b50909695505050505050565b600080600060408486031215612d8057600080fd5b83359250602084013567ffffffffffffffff80821115612d9f57600080fd5b818601915086601f830112612db357600080fd5b813581811115612dc257600080fd5b876020828501011115612dd457600080fd5b6020830194508093505050509250925092565b60008060408385031215612dfa57600080fd5b612e0383612c47565b946020939093013593505050565b600080600060608486031215612e2657600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417612e6a57612e6a612e3d565b92915050565b600082612e8d57634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115612e6a57612e6a612e3d565b6020808252600c908201526b5a65726f206164647265737360a01b604082015260600190565b6040808252600f908201526e1cd95d119959549958da5c1a595b9d608a1b60608201526001600160a01b0391909116602082015260800190565b6040808252600690820152657365744b796360d01b60608201526001600160a01b0391909116602082015260800190565b6020808252600a90820152694e6f742061637469766560b01b604082015260600190565b60208082526011908201527005072696365206d757374206265203e203607c1b604082015260600190565b600060208284031215612f9757600080fd5b5051919050565b80820180821115612e6a57612e6a612e3d565b600060018201612fc357612fc3612e3d565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b6040808252600790820152667365745573646360c81b60608201526001600160a01b0391909116602082015260800190565b6020808252601290820152714c697374696e67206e6f742061637469766560701b604082015260600190565b60006020828403121561309557600080fd5b8151612c7e81612c85565b6000815180845260005b818110156130c6576020818501810151868301820152016130aa565b506000602082860101526020601f19601f83011685010191505092915050565b6060815260006130f960608301866130a0565b60208301949094525060400152919050565b602081526000612c7e60208301846130a056fe9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220ba05438381a8a0e80006459a2e9bd218959ceedeb07a34f6f76cae1ae2dfac3064736f6c63430008180033000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000050555531d7a9ae79a5ad9100f114def88c6691d90000000000000000000000005318788184cc6197df6005db533e4dcda5c565e4
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106102695760003560e01c80638902f58a11610151578063cb146879116100c3578063e74b981b11610087578063e74b981b1461068c578063e826f69a1461069f578063ef706adf146106a9578063f2fde38b146106bc578063f6cf2a16146106cf578063f998a865146106e257600080fd5b8063cb146879146105a6578063d48693d1146105b9578063d6febde8146105c1578063de74e57b146105d4578063e210a72d1461067957600080fd5b806395ccea671161011557806395ccea671461052e57806398625fe91461054157806399c2720614610554578063a9a9855d14610567578063aaccf1ec1461058a578063c815729d1461059357600080fd5b80638902f58a146104655780638a72ea6a1461046e5780638da5cb5b146104f757806390d6b45f1461050857806394a4b5611461051b57600080fd5b806346904840116101ea5780636286935b116101ae5780636286935b146103d8578063715018a6146103f857806376e382c814610400578063776528cd1461041357806383a221ec1461044a5780638456cb591461045d57600080fd5b8063469048401461036b5780634a2ddbd11461037e578063599b9bdb146103915780635c975abb146103b15780635f5d0655146103cf57600080fd5b8063305a67a811610231578063305a67a81461030a5780633e413bee1461031d5780633ed0fe35146103485780633f4ba83a1461035b578063465de68b1461036357600080fd5b80630854eef51461026e57806320e33db8146102a1578063246073e1146102b457806325b49a50146102e2578063263c1e61146102f7575b600080fd5b61028e61027c366004612c0c565b60016020526000908152604090205481565b6040519081526020015b60405180910390f35b61028e6102af366004612c25565b6106f5565b6102c76102c2366004612c25565b610726565b60408051938452602084019290925290820152606001610298565b6102f56102f0366004612c63565b610776565b005b6102f5610305366004612c63565b610815565b6102f5610318366004612c0c565b610877565b600354610330906001600160a01b031681565b6040516001600160a01b039091168152602001610298565b61028e610356366004612c93565b6109c7565b6102f5610e8a565b61028e603281565b600254610330906001600160a01b031681565b6102f561038c366004612cf0565b610e9c565b61028e61039f366004612c63565b60086020526000908152604090205481565b600054600160a01b900460ff165b6040519015158152602001610298565b61028e60065481565b6103eb6103e6366004612c63565b610f29565b6040516102989190612d27565b6102f561108b565b6102f561040e366004612d6b565b6110c9565b610426610421366004612c0c565b611170565b60408051941515855260208501939093529183015215156060820152608001610298565b6103eb610458366004612c0c565b6111dd565b6102f561132c565b61028e60075481565b6104be61047c366004612c0c565b600a602052600090815260409020805460018201546002830154600384015460048501546005909501546001600160a01b039094169492939192909160ff1686565b604080516001600160a01b03909716875260208701959095529385019290925260608401526080830152151560a082015260c001610298565b6000546001600160a01b0316610330565b600454610330906001600160a01b031681565b61028e610529366004612de7565b6113a8565b6102f561053c366004612de7565b6113c4565b6102f561054f366004612c63565b611543565b6102f5610562366004612c63565b6115cc565b6103bf610575366004612c63565b600d6020526000908152604090205460ff1681565b61028e60055481565b6102f56105a1366004612c0c565b611650565b6102f56105b4366004612c63565b611942565b61025861028e565b6102f56105cf366004612c25565b611a30565b6106336105e2366004612c0c565b600960205260009081526040902080546001820154600283015460038401546004909401546001600160a01b03938416949390921692909160ff808216916101008104821691620100009091041687565b604080516001600160a01b03988916815297909616602088015294860193909352606085019190915215156080840152151560a0830152151560c082015260e001610298565b6102f5610687366004612e11565b611d8e565b6102f561069a366004612c63565b612177565b61028e62093a8081565b6102f56106b7366004612c0c565b612254565b6102f56106ca366004612c63565b6123c1565b6102f56106dd366004612e11565b6123fc565b6102c76106f0366004612c25565b61266c565b600c602052816000526040600020818154811061071157600080fd5b90600052602060002001600091509150505481565b60008080670de0b6b3a764000061073d8587612e53565b6107479190612e70565b9250612710610757603285612e53565b6107619190612e70565b915061076d8284612e92565b90509250925092565b61077e61273d565b6001600160a01b0381166107ad5760405162461bcd60e51b81526004016107a490612ea5565b60405180910390fd5b610812816040516020016107c19190612ecb565b604051602081830303815290604052805190602001206040518060400160405280601b81526020017f4d61726b6574706c6163652e736574466565526563697069656e74000000000081525061276a565b50565b61081d61273d565b610812816040516020016108319190612f05565b60405160208183030381529060405280519060200120604051806040016040528060128152602001714d61726b6574706c6163652e7365744b796360701b81525061276a565b61087f612817565b6000818152600960205260409020600481015460ff166108b15760405162461bcd60e51b81526004016107a490612f36565b80546001600160a01b03163314806108d357506000546001600160a01b031633145b6109105760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b60448201526064016107a4565b60048101805460ff1916905560028101805460009182905560018301546001600160a01b03168252600860205260408220805491928392610952908490612e92565b909155505081546001830154610975916001600160a01b03918216911683612833565b81546040516001600160a01b039091169084907f8e25282255ab31897df2b0456bb993ac7f84d376861aefd84901d2d63a7428a290600090a35050610812600160008051602061311f83398151915255565b60006109d1612817565b6109d9612868565b6001600160a01b038616610a1f5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b60448201526064016107a4565b60008511610a645760405162461bcd60e51b81526020600482015260126024820152710416d6f756e74206d757374206265203e20360741b60448201526064016107a4565b60008411610a845760405162461bcd60e51b81526004016107a490612f5a565b6040516370a0823160e01b815233600482015285906001600160a01b038816906370a0823190602401602060405180830381865afa158015610aca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aee9190612f85565b1015610b3c5760405162461bcd60e51b815260206004820152601860248201527f496e73756666696369656e74205257412062616c616e6365000000000000000060448201526064016107a4565b6040516370a0823160e01b81523060048201526000906001600160a01b038816906370a0823190602401602060405180830381865afa158015610b83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba79190612f85565b9050610bbe6001600160a01b038816333089612893565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa158015610c05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c299190612f85565b90506000610c378383612e92565b6001600160a01b038a16600090815260086020526040812080549293508392909190610c64908490612f9e565b909155505060058054906000610c7983612fb1565b9190505593506040518060e00160405280336001600160a01b031681526020018a6001600160a01b0316815260200182815260200188815260200160011515815260200187151581526020018615158152506009600086815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550604082015181600201556060820151816003015560808201518160040160006101000a81548160ff02191690831515021790555060a08201518160040160016101000a81548160ff02191690831515021790555060c08201518160040160026101000a81548160ff021916908315150217905550905050600b60008a6001600160a01b03166001600160a01b03168152602001908152602001600020849080600181540180825580915050600190039060005260206000200160009091909190915055886001600160a01b0316336001600160a01b0316857fedcbe03cf21c8355114ce8632db7b73334223be2cbeda6ae8ec946deb723cfb8848b8b8b604051610e5f94939291909384526020840192909252151560408301521515606082015260800190565b60405180910390a4505050610e81600160008051602061311f83398151915255565b95945050505050565b610e9261273d565b610e9a6128c9565b565b610ea461273d565b6001600160a01b038216610eca5760405162461bcd60e51b81526004016107a490612ea5565b6001600160a01b0382166000818152600d6020908152604091829020805460ff191685151590811790915591519182527f9562c728fd52688e7dc1a376e3ee2035e842ac8dff05803952c69492f957d88a910160405180910390a25050565b6001600160a01b0381166000908152600b60205260408120606091805b8254811015610fa25760096000848381548110610f6557610f65612fca565b6000918252602080832090910154835282019290925260400190206004015460ff1615610f9a5781610f9681612fb1565b9250505b600101610f46565b508067ffffffffffffffff811115610fbc57610fbc612fe0565b604051908082528060200260200182016040528015610fe5578160200160208202803683370190505b5092506000805b8354811015611082576009600085838154811061100b5761100b612fca565b6000918252602080832090910154835282019290925260400190206004015460ff161561107a5783818154811061104457611044612fca565b906000526020600020015485838061105b90612fb1565b94508151811061106d5761106d612fca565b6020026020010181815250505b600101610fec565b50505050919050565b60405162461bcd60e51b81526020600482015260136024820152722932b737bab731b29037b732b6b7b3b7b1b2b760691b60448201526064016107a4565b6110d161273d565b600083815260016020526040812054900361111e5760405162461bcd60e51b815260206004820152600d60248201526c4e69206e61706f766564616e6f60981b60448201526064016107a4565b600083815260016020526040808220919091555183907f72003eda7c2c39777210bccbf69141a92bbe56d746914a16f5ee3aaf5e6f7a83906111639085908590612ff6565b60405180910390a2505050565b6000818152600160205260408120548190819081908082036111a0576000806000809450945094509450506111d6565b6001816111b062093a8082612f9e565b8342101580156111cc57506111c862093a8085612f9e565b4211155b9450945094509450505b9193509193565b6000818152600c60205260408120606091805b825481101561124c57600a600084838154811061120f5761120f612fca565b6000918252602080832090910154835282019290925260400190206005015460ff1615611244578161124081612fb1565b9250505b6001016111f0565b508067ffffffffffffffff81111561126657611266612fe0565b60405190808252806020026020018201604052801561128f578160200160208202803683370190505b5092506000805b835481101561108257600a60008583815481106112b5576112b5612fca565b6000918252602080832090910154835282019290925260400190206005015460ff1615611324578381815481106112ee576112ee612fca565b906000526020600020015485838061130590612fb1565b94508151811061131757611317612fca565b6020026020010181815250505b600101611296565b6000546001600160a01b03163314806113545750336000908152600d602052604090205460ff165b6113a05760405162461bcd60e51b815260206004820152601c60248201527f4e6920706f6f626c617363656e207a61207a617573746176697465760000000060448201526064016107a4565b610e9a61291e565b600b602052816000526040600020818154811061071157600080fd5b6113cc61273d565b6003546000906001600160a01b03848116911614611402576001600160a01b038316600090815260086020526040902054611406565b6007545b6040516370a0823160e01b81523060048201529091506000906001600160a01b038516906370a0823190602401602060405180830381865afa158015611450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114749190612f85565b9050818110156114be5760405162461bcd60e51b81526020600482015260156024820152744e656b6f6e73697374656e74656e20657363726f7760581b60448201526064016107a4565b826114c98383612e92565b10156115175760405162461bcd60e51b815260206004820152601760248201527f507265736567612070726f7374692070726573657a656b00000000000000000060448201526064016107a4565b61153d61152c6000546001600160a01b031690565b6001600160a01b0386169085612833565b50505050565b61154b61273d565b6001600160a01b0381166115715760405162461bcd60e51b81526004016107a490612ea5565b610812816040516020016115859190613025565b60405160208183030381529060405280519060200120604051806040016040528060138152602001724d61726b6574706c6163652e7365745573646360681b81525061276a565b6115d461273d565b61162e816040516020016115e89190612f05565b60405160208183030381529060405280519060200120604051806040016040528060128152602001714d61726b6574706c6163652e7365744b796360701b815250612961565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b611658612817565b611660612868565b6000818152600a60205260409020600581015460ff166116b55760405162461bcd60e51b815260206004820152601060248201526f4f66666572206e6f742061637469766560801b60448201526064016107a4565b60018101546000908152600960205260409020600481015460ff166116ec5760405162461bcd60e51b81526004016107a490613057565b80546001600160a01b0316331461173e5760405162461bcd60e51b815260206004820152601660248201527513db9b1e481cd95b1b195c8818d85b881858d8d95c1d60521b60448201526064016107a4565b8060020154826002015411156117a15760405162461bcd60e51b815260206004820152602260248201527f4f6666657220616d6f756e74206578636565647320617661696c61626c652052604482015261574160f01b60648201526084016107a4565b60058201805460ff191690556004820154600090612710906117c590603290612e53565b6117cf9190612e70565b905060008184600401546117e39190612e92565b905083600201548360020160008282546117fd9190612e92565b9091555050600283015460000361181b5760048301805460ff191690555b8360040154600760008282546118319190612e92565b9091555050600284015460018401546001600160a01b031660009081526008602052604081208054909190611867908490612e92565b90915550508254600354611888916001600160a01b03918216911683612833565b6002546003546118a5916001600160a01b03918216911684612833565b8354600285015460018501546118c9926001600160a01b0391821692911690612833565b83546001850154600286015460048701546040516001600160a01b039094169389927f8f414bb7b1129208b5a842a85f18292a47ad72117cca38e4363cf80dc189ec169261191f92918252602082015260400190565b60405180910390a450505050610812600160008051602061311f83398151915255565b61194a61273d565b6001600160a01b0381166119705760405162461bcd60e51b81526004016107a490612ea5565b600754156119b35760405162461bcd60e51b815260206004820152601060248201526f22b9b1b937bb90373490383930bd32b760811b60448201526064016107a4565b611a0e816040516020016119c79190613025565b60405160208183030381529060405280519060200120604051806040016040528060138152602001724d61726b6574706c6163652e7365745573646360681b815250612961565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b611a38612817565b611a40612868565b6004546001600160a01b03161580611ac0575060048054604051633af32abf60e01b815233928101929092526001600160a01b031690633af32abf90602401602060405180830381865afa158015611a9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ac09190613083565b611b035760405162461bcd60e51b815260206004820152601460248201527316985a1d195d985b8812d650c81c1c9959db195960621b60448201526064016107a4565b6000828152600960205260409020600481015460ff16611b355760405162461bcd60e51b81526004016107a490613057565b600082118015611b49575080600201548211155b611b865760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b60448201526064016107a4565b80546001600160a01b03163303611bdf5760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f742062757920796f7572206f776e206c697374696e67000000000060448201526064016107a4565b6000670de0b6b3a7640000826003015484611bfa9190612e53565b611c049190612e70565b905060008111611c465760405162461bcd60e51b815260206004820152600d60248201526c507269636520746f6f206c6f7760981b60448201526064016107a4565b6000612710611c56603284612e53565b611c609190612e70565b90506000611c6e8284612e92565b8454600354919250611c8f916001600160a01b039081169133911684612893565b600254600354611cae916001600160a01b039182169133911685612893565b84846002016000828254611cc29190612e92565b90915550506002840154600003611ce05760048401805460ff191690555b60018401546001600160a01b031660009081526008602052604081208054879290611d0c908490612e92565b90915550506001840154611d2a906001600160a01b03163387612833565b6040805186815260208101859052908101839052339087907f6fdf4fde4cc12592feea1edbf6fcc530b69dd9a0ccf9f1138212c11fc11b42629060600160405180910390a350505050611d8a600160008051602061311f83398151915255565b5050565b611d96612817565b611d9e612868565b6004546001600160a01b03161580611e1e575060048054604051633af32abf60e01b815233928101929092526001600160a01b031690633af32abf90602401602060405180830381865afa158015611dfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1e9190613083565b611e615760405162461bcd60e51b815260206004820152601460248201527316985a1d195d985b8812d650c81c1c9959db195960621b60448201526064016107a4565b6000838152600960205260409020600481015460ff16611e935760405162461bcd60e51b81526004016107a490613057565b600481015462010000900460ff16611ef85760405162461bcd60e51b815260206004820152602260248201527f4f6666657273206e6f7420616c6c6f776564206f6e2074686973206c697374696044820152616e6760f01b60648201526084016107a4565b600083118015611f0c575080600201548311155b611f495760405162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b60448201526064016107a4565b60008211611f695760405162461bcd60e51b81526004016107a490612f5a565b80546001600160a01b03163303611fc25760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f7420626964206f6e206f776e206c697374696e670000000000000060448201526064016107a4565b6000670de0b6b3a7640000611fd78486612e53565b611fe19190612e70565b9050600081116120285760405162461bcd60e51b8152602060048201526012602482015271546f74616c205553444320746f6f206c6f7760701b60448201526064016107a4565b600680546000918261203983612fb1565b90915550600354909150612058906001600160a01b0316333085612893565b816007600082825461206a9190612f9e565b90915550506040805160c0810182523380825260208083018a81528385018a815260608086018b8152608087018a8152600160a0890181815260008c8152600a89528b81209a518b546001600160a01b0319166001600160a01b03909116178b5596518a830155945160028a01559151600389015551600488015591516005909601805460ff1916961515969096179095558b8252600c83528582208054918201815582529082902001859055835189815290810188905292830185905291889184917f87d488fb4bdf418b8e1ab59c465718c2de65b4ae7d41e7f8dc1ca270b86ba698910160405180910390a4505050612172600160008051602061311f83398151915255565b505050565b61217f61273d565b6001600160a01b0381166121a55760405162461bcd60e51b81526004016107a490612ea5565b61220a816040516020016121b99190612ecb565b604051602081830303815290604052805190602001206040518060400160405280601b81526020017f4d61726b6574706c6163652e736574466565526563697069656e740000000000815250612961565b600280546001600160a01b0319166001600160a01b0383169081179091556040517f7a7b5a0a132f9e0581eb8527f66eae9ee89c2a3e79d4ac7e41a1f1f4d48a7fc290600090a250565b61225c612817565b6000818152600a60205260409020600581015460ff166122b15760405162461bcd60e51b815260206004820152601060248201526f4f66666572206e6f742061637469766560801b60448201526064016107a4565b6001810154600090815260096020526040902081546001600160a01b03163314806122e5575080546001600160a01b031633145b6123315760405162461bcd60e51b815260206004820152601860248201527f4e6f7420617574686f72697a656420746f2063616e63656c000000000000000060448201526064016107a4565b60058201805460ff19169055600482015460078054600090612354908490612e92565b90915550508154600483015460035461237b926001600160a01b0391821692911690612833565b604051339084907f1f51377b3e685a0e2419f9bb4ba7c07ec54936353ba3d0fb3c6538dab676622290600090a35050610812600160008051602061311f83398151915255565b6123c961273d565b6001600160a01b0381166123f357604051631e4fbdf760e01b8152600060048201526024016107a4565b61081281612a8a565b612404612817565b6000838152600960205260409020600481015460ff166124365760405162461bcd60e51b81526004016107a490612f36565b80546001600160a01b0316331461247c5760405162461bcd60e51b815260206004820152600a6024820152692737ba1039b2b63632b960b11b60448201526064016107a4565b6000831161249c5760405162461bcd60e51b81526004016107a490612f5a565b806003015483146124af57600381018390555b811561260d5760018101546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612500573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125249190612f85565b6001830154909150612541906001600160a01b0316333086612893565b60018201546040516370a0823160e01b815230600482015260009183916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612590573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125b49190612f85565b6125be9190612e92565b9050808360020160008282546125d49190612f9e565b909155505060018301546001600160a01b031660009081526008602052604081208054839290612605908490612f9e565b909155505050505b837ff7adc9a0380a940c6058d78194df6a9b9fa5bb431bbad15194913bb611f3f4f784836002015460405161264c929190918252602082015260400190565b60405180910390a250612172600160008051602061311f83398151915255565b600082815260096020526040812060048101548291829160ff166126a25760405162461bcd60e51b81526004016107a490612f36565b80600201548511156126ea5760405162461bcd60e51b81526020600482015260116024820152704578636565647320617661696c61626c6560781b60448201526064016107a4565b670de0b6b3a76400008160030154866127039190612e53565b61270d9190612e70565b935061271061271d603286612e53565b6127279190612e70565b92506127338385612e92565b9150509250925092565b6000546001600160a01b03163314610e9a5760405163118cdaa760e01b81523360048201526024016107a4565b600082815260016020526040902054156127b65760405162461bcd60e51b815260206004820152600d60248201526c5a65206e61706f766564616e6f60981b60448201526064016107a4565b60006127c461025842612f9e565b60008481526001602052604090208190559050827f63a0d065f46e07e30a4f246d28eb53f839982100439173db92dbd5700ab37c15838361280862093a8082612f9e565b604051611163939291906130e6565b61281f612ada565b600260008051602061311f83398151915255565b6128408383836001612b0a565b61217257604051635274afe760e01b81526001600160a01b03841660048201526024016107a4565b600054600160a01b900460ff1615610e9a5760405163d93c066560e01b815260040160405180910390fd5b6128a1848484846001612b70565b61153d57604051635274afe760e01b81526001600160a01b03851660048201526024016107a4565b6128d1612be2565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b612926612868565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586129013390565b600082815260016020526040812054908190036129b05760405162461bcd60e51b815260206004820152600d60248201526c4e69206e61706f766564616e6f60981b60448201526064016107a4565b804210156129f65760405162461bcd60e51b815260206004820152601360248201527216985b5a5ac81cd9481b9a481c1bdd195ad95b606a1b60448201526064016107a4565b612a0362093a8082612f9e565b421115612a475760405162461bcd60e51b81526020600482015260126024820152714e61706f766564206a6520706f74656b6c6160701b60448201526064016107a4565b600083815260016020526040808220919091555183907ffac4537038ebc9eaa00d86a88a6c2e268012d306f6442966aab36014a19543239061116390859061310b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008051602061311f83398151915254600203610e9a57604051633ee5aeb560e01b815260040160405180910390fd5b60405163a9059cbb60e01b60008181526001600160a01b038616600452602485905291602083604481808b5af192506001600051148316612b64578383151615612b57573d6000823e3d81fd5b6000873b113d1516831692505b60405250949350505050565b6040516323b872dd60e01b60008181526001600160a01b038781166004528616602452604485905291602083606481808c5af192506001600051148316612bd0578383151615612bc3573d6000823e3d81fd5b6000883b113d1516831692505b60405250600060605295945050505050565b600054600160a01b900460ff16610e9a57604051638dfc202b60e01b815260040160405180910390fd5b600060208284031215612c1e57600080fd5b5035919050565b60008060408385031215612c3857600080fd5b50508035926020909101359150565b80356001600160a01b0381168114612c5e57600080fd5b919050565b600060208284031215612c7557600080fd5b612c7e82612c47565b9392505050565b801515811461081257600080fd5b600080600080600060a08688031215612cab57600080fd5b612cb486612c47565b945060208601359350604086013592506060860135612cd281612c85565b91506080860135612ce281612c85565b809150509295509295909350565b60008060408385031215612d0357600080fd5b612d0c83612c47565b91506020830135612d1c81612c85565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b81811015612d5f57835183529284019291840191600101612d43565b50909695505050505050565b600080600060408486031215612d8057600080fd5b83359250602084013567ffffffffffffffff80821115612d9f57600080fd5b818601915086601f830112612db357600080fd5b813581811115612dc257600080fd5b876020828501011115612dd457600080fd5b6020830194508093505050509250925092565b60008060408385031215612dfa57600080fd5b612e0383612c47565b946020939093013593505050565b600080600060608486031215612e2657600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417612e6a57612e6a612e3d565b92915050565b600082612e8d57634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115612e6a57612e6a612e3d565b6020808252600c908201526b5a65726f206164647265737360a01b604082015260600190565b6040808252600f908201526e1cd95d119959549958da5c1a595b9d608a1b60608201526001600160a01b0391909116602082015260800190565b6040808252600690820152657365744b796360d01b60608201526001600160a01b0391909116602082015260800190565b6020808252600a90820152694e6f742061637469766560b01b604082015260600190565b60208082526011908201527005072696365206d757374206265203e203607c1b604082015260600190565b600060208284031215612f9757600080fd5b5051919050565b80820180821115612e6a57612e6a612e3d565b600060018201612fc357612fc3612e3d565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b6040808252600790820152667365745573646360c81b60608201526001600160a01b0391909116602082015260800190565b6020808252601290820152714c697374696e67206e6f742061637469766560701b604082015260600190565b60006020828403121561309557600080fd5b8151612c7e81612c85565b6000815180845260005b818110156130c6576020818501810151868301820152016130aa565b506000602082860101526020601f19601f83011685010191505092915050565b6060815260006130f960608301866130a0565b60208301949094525060400152919050565b602081526000612c7e60208301846130a056fe9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220ba05438381a8a0e80006459a2e9bd218959ceedeb07a34f6f76cae1ae2dfac3064736f6c63430008180033