Source Code
Latest 25 from a total of 17,436 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Sell Shares | 73111702 | 302 days ago | IN | 0 POL | 0.00492894 | ||||
| Buy Shares | 72388164 | 320 days ago | IN | 0.20999999 POL | 0.01326674 | ||||
| Sell Shares | 70324445 | 371 days ago | IN | 0 POL | 0.00562531 | ||||
| Sell Shares | 69688353 | 387 days ago | IN | 0 POL | 0.00533635 | ||||
| Sell Shares | 68955360 | 405 days ago | IN | 0 POL | 0.00647925 | ||||
| Sell Shares | 68939309 | 405 days ago | IN | 0 POL | 0.0051426 | ||||
| Sell Shares | 68939292 | 405 days ago | IN | 0 POL | 0.0051426 | ||||
| Sell Shares | 68939218 | 405 days ago | IN | 0 POL | 0.00521694 | ||||
| Sell Shares | 68939205 | 405 days ago | IN | 0 POL | 0.00521694 | ||||
| Sell Shares | 68939131 | 405 days ago | IN | 0 POL | 0.00492894 | ||||
| Sell Shares | 68939120 | 405 days ago | IN | 0 POL | 0.00478494 | ||||
| Sell Shares | 68939105 | 405 days ago | IN | 0 POL | 0.00478494 | ||||
| Sell Shares | 68939045 | 405 days ago | IN | 0 POL | 0.00478458 | ||||
| Sell Shares | 68939034 | 405 days ago | IN | 0 POL | 0.00521658 | ||||
| Sell Shares | 68939011 | 405 days ago | IN | 0 POL | 0.00460467 | ||||
| Sell Shares | 68939003 | 405 days ago | IN | 0 POL | 0.00460467 | ||||
| Sell Shares | 68938993 | 405 days ago | IN | 0 POL | 0.00474867 | ||||
| Sell Shares | 68938982 | 405 days ago | IN | 0 POL | 0.00478494 | ||||
| Sell Shares | 68938971 | 405 days ago | IN | 0 POL | 0.00492894 | ||||
| Sell Shares | 68938962 | 405 days ago | IN | 0 POL | 0.00478494 | ||||
| Sell Shares | 68938957 | 405 days ago | IN | 0 POL | 0.00478494 | ||||
| Sell Shares | 68938948 | 405 days ago | IN | 0 POL | 0.00492894 | ||||
| Sell Shares | 68938928 | 405 days ago | IN | 0 POL | 0.00478494 | ||||
| Sell Shares | 68938918 | 405 days ago | IN | 0 POL | 0.00478494 | ||||
| Sell Shares | 68938910 | 405 days ago | IN | 0 POL | 0.00478494 |
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 72388164 | 320 days ago | 0.10499999 POL | ||||
| 72388164 | 320 days ago | 0.105 POL | ||||
| 68539473 | 415 days ago | 0.10499999 POL | ||||
| 68539473 | 415 days ago | 0.105 POL | ||||
| 67364175 | 445 days ago | 0.10499999 POL | ||||
| 67364175 | 445 days ago | 0.105 POL | ||||
| 67031084 | 453 days ago | 0.10499999 POL | ||||
| 67031084 | 453 days ago | 0.105 POL | ||||
| 66709607 | 461 days ago | 0.10499999 POL | ||||
| 66709607 | 461 days ago | 0.105 POL | ||||
| 66477952 | 467 days ago | 0.10499999 POL | ||||
| 66477952 | 467 days ago | 0.105 POL | ||||
| 66448397 | 468 days ago | 0.10499999 POL | ||||
| 66448397 | 468 days ago | 0.105 POL | ||||
| 66205076 | 474 days ago | 0.10499999 POL | ||||
| 66205076 | 474 days ago | 0.105 POL | ||||
| 66197922 | 474 days ago | 0.10499999 POL | ||||
| 66197922 | 474 days ago | 0.105 POL | ||||
| 66175551 | 475 days ago | 0.10499999 POL | ||||
| 66175551 | 475 days ago | 0.105 POL | ||||
| 66162634 | 475 days ago | 0.10499999 POL | ||||
| 66162634 | 475 days ago | 0.105 POL | ||||
| 66120877 | 476 days ago | 0.10499999 POL | ||||
| 66120877 | 476 days ago | 0.105 POL | ||||
| 66120850 | 476 days ago | 0.10499999 POL |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
CrossSpaceTradingMain
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../math.sol";
import "./crossspace_content_v2.sol";
import "./crossspace_user_v2.sol";
contract CrossSpaceTradingMain is Ownable, ReentrancyGuard {
address public contentContractAddress;
address public userContractAddress;
bool public isPaused;
// Author => Subject => (Holder => User Contract Balance)
mapping(address => mapping(string => mapping(address => uint256))) public userContractBalance;
event TradingPaused(bool isPaused);
constructor(address _contentContractAddress, address _userContractAddress) {
contentContractAddress = _contentContractAddress;
userContractAddress = _userContractAddress;
isPaused = true;
}
function setPaused(bool _isPaused) public onlyOwner {
isPaused = _isPaused;
emit TradingPaused(_isPaused);
}
function getTotalBuyPriceDetails(address author, string calldata subject, uint256 amount) public view returns (uint256[] memory) {
// Assert that the contract addresses are not null
require(contentContractAddress != address(0), "Content contract address is null");
require(userContractAddress != address(0), "User contract address is null");
// Convert the contract address to the proper contract type
CrossSpaceShareContentV2 contentContract = CrossSpaceShareContentV2(contentContractAddress);
CrossSpaceShareUserV2 shareUserContract = CrossSpaceShareUserV2(userContractAddress);
// We will calculate the fees for both contract and add them to the total price
uint256 contentTotalBeforeFee = contentContract.getBuyPrice(author, subject, amount);
uint256 contentTotalAfterFee = contentContract.getBuyPriceAfterFee(author, subject, amount);
// We call the contract to get the amount of shares from the price and the total cost
uint256 userShareAmountInWei = shareUserContract.getBuyAmountInWeiByValue(author, contentTotalBeforeFee); // We will use the same price to buy user share
uint256 userShareFeeBeforeFee = shareUserContract.getBuyPrice(author, userShareAmountInWei);
uint256 userShareFeeAfterFee = shareUserContract.getBuyPriceAfterFee(author, userShareAmountInWei);
uint256 grandTotal = contentTotalAfterFee + userShareFeeAfterFee;
uint256[] memory result = new uint256[](6);
result[0] = contentTotalBeforeFee;
result[1] = contentTotalAfterFee;
result[2] = userShareAmountInWei;
result[3] = userShareFeeBeforeFee;
result[4] = userShareFeeAfterFee;
result[5] = grandTotal;
return result;
}
function _getUserAmountToSell(address author, string calldata subject, address holder, uint256 totalAmount) private view returns (uint256) {
// Assert that the contract addresses are not null
require(contentContractAddress != address(0), "Content contract address is null");
CrossSpaceShareContentV2 contentContract = CrossSpaceShareContentV2(contentContractAddress);
// Let's calculate the amount of user shares to sell for later
uint256 userTotalShare = userContractBalance[author][subject][holder];
uint256 contentTotalBalance = contentContract.sharesBalance(author,subject,holder);
require(contentTotalBalance >= totalAmount, "Insufficient shares");
uint256 userShareToSell = totalAmount * userTotalShare / contentTotalBalance;
return userShareToSell;
}
function getTotalSellPriceDetails(address author, string calldata subject, address holder, uint256 amount) public view returns (uint256[] memory) {
// Assert that the contract addresses are not null
require(contentContractAddress != address(0), "Content contract address is null");
require(userContractAddress != address(0), "User contract address is null");
// Convert the contract address to the proper contract type
CrossSpaceShareContentV2 contentContract = CrossSpaceShareContentV2(contentContractAddress);
CrossSpaceShareUserV2 shareUserContract = CrossSpaceShareUserV2(userContractAddress);
// Let's calculate the amount of user shares to sell for later
uint256 userShareToSell = _getUserAmountToSell(author, subject, holder, amount);
// Let's calculate the fees for content
uint256 contentTotalBeforeFee = contentContract.getSellPrice(author, subject, amount);
uint256 contentTotalAfterFee = contentContract.getSellPriceAfterFee(author, subject, amount);
// Let's calculate the fees for user
uint256 userShareFeeBeforeFee = shareUserContract.getSellPrice(author, userShareToSell);
uint256 userShareFeeAfterFee = shareUserContract.getSellPriceAfterFee(author, userShareToSell);
uint256 grandTotal = contentTotalAfterFee + userShareFeeAfterFee;
uint256[] memory result = new uint256[](6);
result[0] = contentTotalBeforeFee;
result[1] = contentTotalAfterFee;
result[2] = userShareToSell;
result[3] = userShareFeeBeforeFee;
result[4] = userShareFeeAfterFee;
result[5] = grandTotal;
return result;
}
function buyShares(address author, string calldata subject, uint256 amount) public payable nonReentrant {
// Require not paused
require(!isPaused, "Contract is paused");
// Assert that the contract addresses are not null
require(contentContractAddress != address(0), "Content contract address is null");
require(userContractAddress != address(0), "User contract address is null");
// Convert the contract address to the proper contract type
CrossSpaceShareContentV2 contentContract = CrossSpaceShareContentV2(contentContractAddress);
CrossSpaceShareUserV2 shareUserContract = CrossSpaceShareUserV2(userContractAddress);
// We will calculate the fees for both contract and add them to the total price
uint256 contentTotalBeforeFee = contentContract.getBuyPrice(author, subject, amount);
uint256 contentTotalAfterFee = contentContract.getBuyPriceAfterFee(author, subject, amount);
// We call the contract to get the amount of shares from the price and the total cost
uint256 userShareAmountInWei = shareUserContract.getBuyAmountInWeiByValue(author, contentTotalBeforeFee); // We will use the same price to buy user share
uint256 userShareFeeAfterFee = shareUserContract.getBuyPriceAfterFee(author, userShareAmountInWei);
uint256 grandTotal = contentTotalAfterFee + userShareFeeAfterFee;
// Assert that the user sent enough funds
require(msg.value >= grandTotal, "Not enough funds");
// Buy the shares for the user contract
// Save the amount of shares in the mapping
userContractBalance[author][subject][msg.sender] = userContractBalance[author][subject][msg.sender] + userShareAmountInWei;
// Buy the shares for the content contract
contentContract.buyShares{value: contentTotalAfterFee}(author, subject, msg.sender, amount);
// Transfer the funds to the user contract and call the buy shares function
shareUserContract.buyShares{value: userShareFeeAfterFee}(author, msg.sender, userShareAmountInWei);
// Return the excess payment
if (msg.value > grandTotal) {
(bool success, ) = msg.sender.call{value: msg.value - grandTotal}("");
require(success, "Unable to send funds");
}
}
function sellShares(address author, string calldata subject, uint256 amount) public nonReentrant {
// Require not paused
require(!isPaused, "Contract is paused");
// Assert that the contract addresses are not null
require(contentContractAddress != address(0), "Content contract address is null");
require(userContractAddress != address(0), "User contract address is null");
// Convert the contract address to the proper contract type
CrossSpaceShareContentV2 contentContract = CrossSpaceShareContentV2(contentContractAddress);
CrossSpaceShareUserV2 shareUserContract = CrossSpaceShareUserV2(userContractAddress);
// Let's calculate the amount of user shares to sell for later
uint256 userTotalShare = userContractBalance[author][subject][msg.sender];
uint256 contentTotalBalance = contentContract.sharesBalance(author,subject,msg.sender);
require(contentTotalBalance >= amount, "Insufficient shares");
uint256 userShareToSell = amount * userTotalShare / contentTotalBalance;
require(userShareToSell <= userTotalShare, "Insufficient user shares");
userContractBalance[author][subject][msg.sender] = userContractBalance[author][subject][msg.sender] - userShareToSell;
// Sell
contentContract.sellShares(author, subject, msg.sender, amount);
shareUserContract.sellShares(author, msg.sender, userShareToSell);
}
function getUserContractBalance(address author, string calldata subject, address holder) public view returns (uint256) {
return userContractBalance[author][subject][holder];
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../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.
*
* By default, the owner account will be the one that deploys the contract. 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;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @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 {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @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 {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_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);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @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 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].
*/
abstract contract ReentrancyGuard {
// 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;
uint256 private _status;
constructor() {
_status = _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();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _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 _status == _ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @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;
}
}pragma solidity ^0.8.9;
library math {
/**
* @dev Compute the largest integer smaller than or equal to the cubic root of `n`
*/
function floorCbrt(uint256 n) internal pure returns (uint256) { unchecked {
uint256 x = 0;
for (uint256 y = 1 << 255; y > 0; y >>= 3) {
x <<= 1;
uint256 z = 3 * x * (x + 1) + 1;
if (n / y >= z) {
n -= y * z;
x += 1;
}
}
return x;
}}
/**
* @dev Compute the smallest integer larger than or equal to the cubic root of `n`
*/
function ceilCbrt(uint256 n) internal pure returns (uint256) { unchecked {
uint256 x = floorCbrt(n);
return x ** 3 == n ? x : x + 1;
}}
}pragma solidity ^0.8.9;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./crossspace_user_v2.sol";
contract CrossSpaceShareContentV2 is Ownable, ReentrancyGuard {
address public parentProtocolAddress;
address public protocolFeeDestination;
uint256 public protocolFeePercent = 500;
uint256 public subjectFeePercent = 500;
uint256 public PRICE_DIVIDER = 32000;
bool public allowAuthorSellLastShare = false;
uint256 public constant PERCENT_BASE = 10000;
uint256 public constant MAX_FEE_PERCENT = 1000; // 10% cap
event TradeContent(address trader, address author, string subject, bool isBuy, uint256 shareAmount, uint256 maticAmount, uint256 protocolMaticAmount, uint256 subjectMaticAmount, uint256 supply);
event ParentProtocolAddressUpdated(address parentProtocolAddress);
event ProtocolFeeDestinationUpdated(address protocolFeeDestination);
event ProtocolFeePercentUpdated(uint256 protocolFeePercent);
event SubjectFeePercentUpdated(uint256 subjectFeePercent);
constructor(uint256 _priceDivider, bool _allowAuthorSellLastShare) {
protocolFeeDestination = _msgSender();
allowAuthorSellLastShare = _allowAuthorSellLastShare;
PRICE_DIVIDER = _priceDivider;
}
// Author => Subject => (Holder => Balance)
mapping(address => mapping(string => mapping(address => uint256))) public sharesBalance;
// Author => Subject => Supply
mapping(address => mapping(string => uint256)) public sharesSupply;
function setParentProtocolAddress(address _parentProtocolAddress) public onlyOwner {
parentProtocolAddress = _parentProtocolAddress;
emit ParentProtocolAddressUpdated(_parentProtocolAddress);
}
function setFeeDestination(address _feeDestination) public onlyOwner {
protocolFeeDestination = _feeDestination;
emit ProtocolFeeDestinationUpdated(_feeDestination);
}
function setProtocolFeePercent(uint256 _feePercent) public onlyOwner {
// Requie the fee percent to be less than or equal to 10%
require(_feePercent <= MAX_FEE_PERCENT, "Fee percent is greater than 10%");
protocolFeePercent = _feePercent;
emit ProtocolFeePercentUpdated(_feePercent);
}
function setSubjectFeePercent(uint256 _feePercent) public onlyOwner {
// Requie the fee percent to be less than or equal to 10%
require(_feePercent <= MAX_FEE_PERCENT, "Fee percent is greater than 10%");
subjectFeePercent = _feePercent;
emit SubjectFeePercentUpdated(_feePercent);
}
function getPrice(uint256 supply, uint256 amount) public view returns (uint256) {
uint256 sum1 = supply == 0 ? 0 : (supply)* (supply+1) * (2 * supply + 1) / 6;
uint256 sum2 = (supply + amount) * (supply + amount + 1) * (2 * (supply + amount) + 1) / 6;
uint256 summation = sum2 - sum1;
return summation * 1 ether / PRICE_DIVIDER;
}
function getBuyPrice(address author, string calldata subject, uint256 amount) public view returns (uint256) {
return getPrice(sharesSupply[author][subject], amount);
}
function getSellPrice(address author, string calldata subject, uint256 amount) public view returns (uint256) {
return getPrice(sharesSupply[author][subject] - amount, amount);
}
function getBuyPriceAfterFee(address author, string calldata subject, uint256 amount) public view returns (uint256) {
uint256 price = getBuyPrice(author, subject, amount);
uint256 protocolFee = price * protocolFeePercent / PERCENT_BASE;
uint256 subjectFee = price * subjectFeePercent / PERCENT_BASE;
return price + protocolFee + subjectFee;
}
function getSellPriceAfterFee(address author, string calldata subject, uint256 amount) public view returns (uint256) {
uint256 price = getSellPrice(author, subject, amount);
uint256 protocolFee = price * protocolFeePercent / PERCENT_BASE;
uint256 subjectFee = price * subjectFeePercent / PERCENT_BASE;
return price - protocolFee - subjectFee;
}
function buyShares(address author, string calldata subject, address sender, uint256 amount) public payable nonReentrant {
// Require the caller to be the parent protocol
require(msg.sender == parentProtocolAddress, "Caller is not the parent protocol");
require(tx.origin == sender, "sender is not the original sender");
uint256 supply = sharesSupply[author][subject];
require(supply > 0 || author == sender, "Only the shares' subject owner can buy the first share");
uint256 price = getPrice(supply, amount);
uint256 protocolFee = price * protocolFeePercent / PERCENT_BASE;
uint256 subjectFee = price * subjectFeePercent / PERCENT_BASE;
require(msg.value >= price + protocolFee + subjectFee, "Insufficient payment");
// Buy the shares for the content
sharesBalance[author][subject][sender] = sharesBalance[author][subject][sender] + amount;
sharesSupply[author][subject] = supply + amount;
emit TradeContent(sender, author, subject, true, amount, price, protocolFee, subjectFee, supply + amount);
(bool success1, ) = protocolFeeDestination.call{value: protocolFee}("");
(bool success2, ) = author.call{value: subjectFee}("");
// If the sender send any extra money, send it back
if (msg.value > price + protocolFee + subjectFee) {
(bool success3, ) = sender.call{value: msg.value - price - protocolFee - subjectFee}("");
require(success3, "Unable to send funds");
}
require(success1 && success2, "Unable to send funds");
}
function sellShares(address author, string calldata subject, address sender, uint256 amount) public nonReentrant{
// Require the caller to be the parent protocol and the original sender to be the sender
require(msg.sender == parentProtocolAddress, "Caller is not the parent protocol");
require(tx.origin == sender, "sender is not the original sender");
uint256 supply = sharesSupply[author][subject];
require(supply >= amount, "Cannot sell more than the shares supply");
require(author != sender || supply > amount || allowAuthorSellLastShare, "Author cannot sell the last share");
uint256 price = getPrice(supply - amount, amount);
uint256 protocolFee = price * protocolFeePercent / PERCENT_BASE;
uint256 subjectFee = price * subjectFeePercent / PERCENT_BASE;
require(sharesBalance[author][subject][sender] >= amount, "Insufficient shares");
// Sell the shares for the content
sharesBalance[author][subject][sender] = sharesBalance[author][subject][sender] - amount;
sharesSupply[author][subject] = supply - amount;
emit TradeContent(sender, author, subject, false, amount, price, protocolFee, subjectFee, supply - amount);
(bool success1, ) = sender.call{value: price - protocolFee - subjectFee}("");
(bool success2, ) = protocolFeeDestination.call{value: protocolFee}("");
(bool success3, ) = author.call{value: subjectFee}("");
require(success1 && success2 && success3, "Unable to send funds");
}
}pragma solidity ^0.8.9;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../math.sol";
contract CrossSpaceShareUserV2 is Ownable, ReentrancyGuard {
address public parentProtocolAddress;
address public protocolFeeDestination;
uint256 public protocolFeePercent = 500;
uint256 public subjectFeePercent = 500;
uint256 public PRICE_DIVIDER = 32000;
bool public allowAuthorSellLastShare = false;
uint256 public constant PERCENT_BASE = 10000;
uint256 public constant MAX_FEE_PERCENT = 1000;
constructor(uint256 _priceDivider, bool _allowAuthorSellLastShare) {
protocolFeeDestination = _msgSender();
allowAuthorSellLastShare = _allowAuthorSellLastShare;
PRICE_DIVIDER = _priceDivider;
}
event TradeUser(address trader, address author, bool isBuy, uint256 shareAmountInWei, uint256 maticAmount, uint256 protocolMaticAmount, uint256 subjectMaticAmount, uint256 supplyInWei);
event ParentProtocolAddressUpdated(address parentProtocolAddress);
event ProtocolFeeDestinationUpdated(address protocolFeeDestination);
event ProtocolFeePercentUpdated(uint256 protocolFeePercent);
event SubjectFeePercentUpdated(uint256 subjectFeePercent);
// Author => (Holder => Balance)
mapping(address => mapping(address => uint256)) public sharesBalanceInWei;
// Author => SupplyInWei
mapping(address => uint256) public sharesSupplyInWei;
function setFeeDestination(address _feeDestination) public onlyOwner {
protocolFeeDestination = _feeDestination;
emit ProtocolFeeDestinationUpdated(_feeDestination);
}
function setParentProtocolAddress(address _parentProtocolAddress) public onlyOwner {
parentProtocolAddress = _parentProtocolAddress;
emit ParentProtocolAddressUpdated(_parentProtocolAddress);
}
function setProtocolFeePercent(uint256 _feePercent) public onlyOwner {
// Requie the fee percent to be less than or equal to 10%
require(_feePercent <= MAX_FEE_PERCENT, "Fee percent is greater than 10%");
protocolFeePercent = _feePercent;
emit ProtocolFeePercentUpdated(_feePercent);
}
function setSubjectFeePercent(uint256 _feePercent) public onlyOwner {
// Requie the fee percent to be less than or equal to 10%
require(_feePercent <= MAX_FEE_PERCENT, "Fee percent is greater than 10%");
subjectFeePercent = _feePercent;
emit SubjectFeePercentUpdated(_feePercent);
}
function getPrice(uint256 supplyInWei, uint256 amountInWei) public view returns (uint256) {
uint256 price = (amountInWei * (amountInWei*amountInWei + 3*amountInWei* supplyInWei + 3*supplyInWei*supplyInWei));
uint256 normalizedPrice = price / PRICE_DIVIDER / 3e36;
return normalizedPrice;
}
function getBuyPrice(address author, uint256 amountInWei) public view returns (uint256) {
return getPrice(sharesSupplyInWei[author], amountInWei);
}
function getSellPrice(address author, uint256 amountInWei) public view returns (uint256) {
return getPrice(sharesSupplyInWei[author] - amountInWei, amountInWei);
}
function getAmountInWeiByValue(uint256 supplyInWei, uint256 priceInWei) public view returns (uint256) {
uint256 np =priceInWei* 3e36 * PRICE_DIVIDER;
uint256 a = math.floorCbrt(np + supplyInWei * supplyInWei * supplyInWei) - supplyInWei;
return a;
}
function getBuyPriceAfterFee(address author, uint256 amount) public view returns (uint256) {
uint256 price = getBuyPrice(author, amount);
uint256 protocolFee = price * protocolFeePercent / PERCENT_BASE;
uint256 subjectFee = price * subjectFeePercent / PERCENT_BASE;
return price + protocolFee + subjectFee;
}
function getSellPriceAfterFee(address author, uint256 amount) public view returns (uint256) {
uint256 price = getSellPrice(author, amount);
uint256 protocolFee = price * protocolFeePercent / PERCENT_BASE;
uint256 subjectFee = price * subjectFeePercent / PERCENT_BASE;
return price - protocolFee - subjectFee;
}
function getBuyAmountInWeiByValue(address author, uint256 priceInWei) public view returns (uint256) {
return getAmountInWeiByValue(sharesSupplyInWei[author], priceInWei);
}
function buyShares(address author, address sender, uint256 amountInWei) public payable nonReentrant {
// Require the caller to be the parent protocol
require(msg.sender == parentProtocolAddress, "Caller is not the parent protocol");
require(tx.origin == sender, "sender is not the original sender");
uint256 supplyInWei = sharesSupplyInWei[author];
require(supplyInWei > 0 || author == sender, "Only the shares' subject owner can buy the first share");
uint256 price = getPrice(supplyInWei, amountInWei);
uint256 protocolFee = price * protocolFeePercent / PERCENT_BASE;
uint256 subjectFee = price * subjectFeePercent / PERCENT_BASE;
require(msg.value >= price + protocolFee + subjectFee, "Insufficient payment");
sharesBalanceInWei[author][sender] = sharesBalanceInWei[author][sender] + amountInWei;
sharesSupplyInWei[author] = supplyInWei + amountInWei;
emit TradeUser(sender, author, true, amountInWei, price, protocolFee, subjectFee, supplyInWei + amountInWei);
(bool success1, ) = protocolFeeDestination.call{value: protocolFee}("");
(bool success2, ) = author.call{value: subjectFee}("");
// Return the excess payment
if (msg.value > price + protocolFee + subjectFee) {
(bool success3, ) = sender.call{value: msg.value - price - protocolFee - subjectFee}("");
require(success3, "Unable to send funds");
}
require(success1 && success2, "Unable to send funds");
}
function sellShares(address author, address sender, uint256 amountInWei) public nonReentrant {
// Require the caller to be the parent protocol
require(msg.sender == parentProtocolAddress, "Caller is not the parent protocol");
require(tx.origin == sender, "sender is not the original sender");
uint256 supplyInWei = sharesSupplyInWei[author];
require(supplyInWei >= amountInWei, "Cannot sell exceeding shares supply");
require(author != sender || supplyInWei > amountInWei || allowAuthorSellLastShare, "Author cannot sell the last share");
uint256 price = getPrice(supplyInWei - amountInWei, amountInWei);
uint256 protocolFee = price * protocolFeePercent / PERCENT_BASE;
uint256 subjectFee = price * subjectFeePercent / PERCENT_BASE;
require(sharesBalanceInWei[author][sender] >= amountInWei, "Insufficient shares");
sharesBalanceInWei[author][sender] = sharesBalanceInWei[author][sender] - amountInWei;
sharesSupplyInWei[author] = supplyInWei - amountInWei;
emit TradeUser(sender, author, false, amountInWei, price, protocolFee, subjectFee, supplyInWei - amountInWei);
(bool success1, ) = sender.call{value: price - protocolFee - subjectFee}("");
(bool success2, ) = protocolFeeDestination.call{value: protocolFee}("");
(bool success3, ) = author.call{value: subjectFee}("");
require(success1 && success2 && success3, "Unable to send funds");
}
}{
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_contentContractAddress","type":"address"},{"internalType":"address","name":"_userContractAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isPaused","type":"bool"}],"name":"TradingPaused","type":"event"},{"inputs":[{"internalType":"address","name":"author","type":"address"},{"internalType":"string","name":"subject","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"buyShares","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"contentContractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"author","type":"address"},{"internalType":"string","name":"subject","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getTotalBuyPriceDetails","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"author","type":"address"},{"internalType":"string","name":"subject","type":"string"},{"internalType":"address","name":"holder","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getTotalSellPriceDetails","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"author","type":"address"},{"internalType":"string","name":"subject","type":"string"},{"internalType":"address","name":"holder","type":"address"}],"name":"getUserContractBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"author","type":"address"},{"internalType":"string","name":"subject","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sellShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isPaused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"userContractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"string","name":"","type":"string"},{"internalType":"address","name":"","type":"address"}],"name":"userContractBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b506040516200325338038062003253833981810160405281019062000037919062000239565b620000576200004b6200010360201b60201c565b6200010b60201b60201c565b6001808190555081600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600360146101000a81548160ff021916908315150217905550505062000280565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200020182620001d4565b9050919050565b6200021381620001f4565b81146200021f57600080fd5b50565b600081519050620002338162000208565b92915050565b60008060408385031215620002535762000252620001cf565b5b6000620002638582860162000222565b9250506020620002768582860162000222565b9150509250929050565b612fc380620002906000396000f3fe6080604052600436106100c25760003560e01c80634fe3d5981161007f5780639699e514116100595780639699e51414610259578063b187bd2614610296578063d92aabfc146102c1578063f2fde38b146102ec576100c2565b80634fe3d598146101da578063715018a6146102175780638da5cb5b1461022e576100c2565b80630c3967ee146100c757806316a61c80146100e357806316c38b3c14610120578063174953e9146101495780632310167f146101725780634c6ef3d71461019d575b600080fd5b6100e160048036038101906100dc9190612240565b610315565b005b3480156100ef57600080fd5b5061010a60048036038101906101059190612240565b610a74565b6040516101179190612372565b60405180910390f35b34801561012c57600080fd5b50610147600480360381019061014291906123cc565b610ff3565b005b34801561015557600080fd5b50610170600480360381019061016b9190612240565b61104f565b005b34801561017e57600080fd5b50610187611625565b6040516101949190612408565b60405180910390f35b3480156101a957600080fd5b506101c460048036038101906101bf9190612564565b61164b565b6040516101d191906125e2565b60405180910390f35b3480156101e657600080fd5b5061020160048036038101906101fc91906125fd565b611693565b60405161020e91906125e2565b60405180910390f35b34801561022357600080fd5b5061022c61173a565b005b34801561023a57600080fd5b5061024361174e565b6040516102509190612408565b60405180910390f35b34801561026557600080fd5b50610280600480360381019061027b9190612671565b611777565b60405161028d9190612372565b60405180910390f35b3480156102a257600080fd5b506102ab611c79565b6040516102b89190612708565b60405180910390f35b3480156102cd57600080fd5b506102d6611c8c565b6040516102e39190612408565b60405180910390f35b3480156102f857600080fd5b50610313600480360381019061030e9190612723565b611cb2565b005b61031d611d36565b600360149054906101000a900460ff161561036d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610364906127ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156103ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f690612819565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610491576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048890612885565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008273ffffffffffffffffffffffffffffffffffffffff166325384b4c888888886040518563ffffffff1660e01b815260040161052094939291906128d2565b60206040518083038186803b15801561053857600080fd5b505afa15801561054c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105709190612927565b905060008373ffffffffffffffffffffffffffffffffffffffff16637faebbd3898989896040518563ffffffff1660e01b81526004016105b394939291906128d2565b60206040518083038186803b1580156105cb57600080fd5b505afa1580156105df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106039190612927565b905060008373ffffffffffffffffffffffffffffffffffffffff1663a74ead828a856040518363ffffffff1660e01b8152600401610642929190612954565b60206040518083038186803b15801561065a57600080fd5b505afa15801561066e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106929190612927565b905060008473ffffffffffffffffffffffffffffffffffffffff16630f026f6d8b846040518363ffffffff1660e01b81526004016106d1929190612954565b60206040518083038186803b1580156106e957600080fd5b505afa1580156106fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107219190612927565b90506000818461073191906129ac565b905080341015610776576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076d90612a4e565b60405180910390fd5b82600460008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208b8b6040516107c6929190612a9e565b908152602001604051809103902060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461081c91906129ac565b600460008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208b8b60405161086b929190612a9e565b908152602001604051809103902060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff16635cd7896d858d8d8d338e6040518763ffffffff1660e01b81526004016108fc959493929190612ab7565b6000604051808303818588803b15801561091557600080fd5b505af1158015610929573d6000803e3d6000fd5b50505050508573ffffffffffffffffffffffffffffffffffffffff1663dd06f6bd838d33876040518563ffffffff1660e01b815260040161096c93929190612b05565b6000604051808303818588803b15801561098557600080fd5b505af1158015610999573d6000803e3d6000fd5b505050505080341115610a5f5760003373ffffffffffffffffffffffffffffffffffffffff1682346109cb9190612b3c565b6040516109d790612ba1565b60006040518083038185875af1925050503d8060008114610a14576040519150601f19603f3d011682016040523d82523d6000602084013e610a19565b606091505b5050905080610a5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5490612c02565b60405180910390fd5b505b50505050505050610a6e611d86565b50505050565b6060600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aff90612819565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9190612885565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008273ffffffffffffffffffffffffffffffffffffffff166325384b4c898989896040518563ffffffff1660e01b8152600401610c2994939291906128d2565b60206040518083038186803b158015610c4157600080fd5b505afa158015610c55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c799190612927565b905060008373ffffffffffffffffffffffffffffffffffffffff16637faebbd38a8a8a8a6040518563ffffffff1660e01b8152600401610cbc94939291906128d2565b60206040518083038186803b158015610cd457600080fd5b505afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c9190612927565b905060008373ffffffffffffffffffffffffffffffffffffffff1663a74ead828b856040518363ffffffff1660e01b8152600401610d4b929190612954565b60206040518083038186803b158015610d6357600080fd5b505afa158015610d77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9b9190612927565b905060008473ffffffffffffffffffffffffffffffffffffffff16634635256e8c846040518363ffffffff1660e01b8152600401610dda929190612954565b60206040518083038186803b158015610df257600080fd5b505afa158015610e06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2a9190612927565b905060008573ffffffffffffffffffffffffffffffffffffffff16630f026f6d8d856040518363ffffffff1660e01b8152600401610e69929190612954565b60206040518083038186803b158015610e8157600080fd5b505afa158015610e95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb99190612927565b905060008185610ec991906129ac565b90506000600667ffffffffffffffff811115610ee857610ee7612439565b5b604051908082528060200260200182016040528015610f165781602001602082028036833780820191505090505b5090508681600081518110610f2e57610f2d612c22565b5b6020026020010181815250508581600181518110610f4f57610f4e612c22565b5b6020026020010181815250508481600281518110610f7057610f6f612c22565b5b6020026020010181815250508381600381518110610f9157610f90612c22565b5b6020026020010181815250508281600481518110610fb257610fb1612c22565b5b6020026020010181815250508181600581518110610fd357610fd2612c22565b5b602002602001018181525050809950505050505050505050949350505050565b610ffb611d8f565b80600360146101000a81548160ff0219169083151502179055507f64891834b8201e4fdeda37096a5f1c16360f209047b1e9a93839cc5bbbb763bd816040516110449190612708565b60405180910390a150565b611057611d36565b600360149054906101000a900460ff16156110a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109e906127ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611139576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113090612819565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156111cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c290612885565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020868660405161126a929190612a9e565b908152602001604051809103902060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008373ffffffffffffffffffffffffffffffffffffffff1663220b647d898989336040518563ffffffff1660e01b81526004016112f99493929190612c51565b60206040518083038186803b15801561131157600080fd5b505afa158015611325573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113499190612927565b90508481101561138e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138590612cdd565b60405180910390fd5b600081838761139d9190612cfd565b6113a79190612d86565b9050828111156113ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e390612e03565b60405180910390fd5b80600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020898960405161143c929190612a9e565b908152602001604051809103902060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114929190612b3c565b600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002089896040516114e1929190612a9e565b908152602001604051809103902060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff1663a95bdf938a8a8a338b6040518663ffffffff1660e01b8152600401611571959493929190612ab7565b600060405180830381600087803b15801561158b57600080fd5b505af115801561159f573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff1663bc810c1a8a33846040518463ffffffff1660e01b81526004016115e093929190612b05565b600060405180830381600087803b1580156115fa57600080fd5b505af115801561160e573d6000803e3d6000fd5b50505050505050505061161f611d86565b50505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60046020528260005260406000208280516020810182018051848252602083016020850120818352809550505050505060205280600052604060002060009250925050505481565b6000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084846040516116e4929190612a9e565b908152602001604051809103902060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050949350505050565b611742611d8f565b61174c6000611e0d565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561180b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180290612819565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561189d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189490612885565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060006118fa8989898989611ed1565b905060008373ffffffffffffffffffffffffffffffffffffffff1663be32e6848b8b8b8a6040518563ffffffff1660e01b815260040161193d94939291906128d2565b60206040518083038186803b15801561195557600080fd5b505afa158015611969573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198d9190612927565b905060008473ffffffffffffffffffffffffffffffffffffffff16633def7b938c8c8c8b6040518563ffffffff1660e01b81526004016119d094939291906128d2565b60206040518083038186803b1580156119e857600080fd5b505afa1580156119fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a209190612927565b905060008473ffffffffffffffffffffffffffffffffffffffff16639ae717818d866040518363ffffffff1660e01b8152600401611a5f929190612954565b60206040518083038186803b158015611a7757600080fd5b505afa158015611a8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aaf9190612927565b905060008573ffffffffffffffffffffffffffffffffffffffff16632267a89c8e876040518363ffffffff1660e01b8152600401611aee929190612954565b60206040518083038186803b158015611b0657600080fd5b505afa158015611b1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3e9190612927565b905060008184611b4e91906129ac565b90506000600667ffffffffffffffff811115611b6d57611b6c612439565b5b604051908082528060200260200182016040528015611b9b5781602001602082028036833780820191505090505b5090508581600081518110611bb357611bb2612c22565b5b6020026020010181815250508481600181518110611bd457611bd3612c22565b5b6020026020010181815250508681600281518110611bf557611bf4612c22565b5b6020026020010181815250508381600381518110611c1657611c15612c22565b5b6020026020010181815250508281600481518110611c3757611c36612c22565b5b6020026020010181815250508181600581518110611c5857611c57612c22565b5b60200260200101818152505080995050505050505050505095945050505050565b600360149054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611cba611d8f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611d2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2190612e95565b60405180910390fd5b611d3381611e0d565b50565b60026001541415611d7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7390612f01565b60405180910390fd5b6002600181905550565b60018081905550565b611d9761212b565b73ffffffffffffffffffffffffffffffffffffffff16611db561174e565b73ffffffffffffffffffffffffffffffffffffffff1614611e0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e0290612f6d565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611f64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5b90612819565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208787604051611fdc929190612a9e565b908152602001604051809103902060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008273ffffffffffffffffffffffffffffffffffffffff1663220b647d8a8a8a8a6040518563ffffffff1660e01b815260040161206b9493929190612c51565b60206040518083038186803b15801561208357600080fd5b505afa158015612097573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120bb9190612927565b905084811015612100576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f790612cdd565b60405180910390fd5b600081838761210f9190612cfd565b6121199190612d86565b90508094505050505095945050505050565b600033905090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061217282612147565b9050919050565b61218281612167565b811461218d57600080fd5b50565b60008135905061219f81612179565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126121ca576121c96121a5565b5b8235905067ffffffffffffffff8111156121e7576121e66121aa565b5b602083019150836001820283011115612203576122026121af565b5b9250929050565b6000819050919050565b61221d8161220a565b811461222857600080fd5b50565b60008135905061223a81612214565b92915050565b6000806000806060858703121561225a5761225961213d565b5b600061226887828801612190565b945050602085013567ffffffffffffffff81111561228957612288612142565b5b612295878288016121b4565b935093505060406122a88782880161222b565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6122e98161220a565b82525050565b60006122fb83836122e0565b60208301905092915050565b6000602082019050919050565b600061231f826122b4565b61232981856122bf565b9350612334836122d0565b8060005b8381101561236557815161234c88826122ef565b975061235783612307565b925050600181019050612338565b5085935050505092915050565b6000602082019050818103600083015261238c8184612314565b905092915050565b60008115159050919050565b6123a981612394565b81146123b457600080fd5b50565b6000813590506123c6816123a0565b92915050565b6000602082840312156123e2576123e161213d565b5b60006123f0848285016123b7565b91505092915050565b61240281612167565b82525050565b600060208201905061241d60008301846123f9565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61247182612428565b810181811067ffffffffffffffff821117156124905761248f612439565b5b80604052505050565b60006124a3612133565b90506124af8282612468565b919050565b600067ffffffffffffffff8211156124cf576124ce612439565b5b6124d882612428565b9050602081019050919050565b82818337600083830152505050565b6000612507612502846124b4565b612499565b90508281526020810184848401111561252357612522612423565b5b61252e8482856124e5565b509392505050565b600082601f83011261254b5761254a6121a5565b5b813561255b8482602086016124f4565b91505092915050565b60008060006060848603121561257d5761257c61213d565b5b600061258b86828701612190565b935050602084013567ffffffffffffffff8111156125ac576125ab612142565b5b6125b886828701612536565b92505060406125c986828701612190565b9150509250925092565b6125dc8161220a565b82525050565b60006020820190506125f760008301846125d3565b92915050565b600080600080606085870312156126175761261661213d565b5b600061262587828801612190565b945050602085013567ffffffffffffffff81111561264657612645612142565b5b612652878288016121b4565b9350935050604061266587828801612190565b91505092959194509250565b60008060008060006080868803121561268d5761268c61213d565b5b600061269b88828901612190565b955050602086013567ffffffffffffffff8111156126bc576126bb612142565b5b6126c8888289016121b4565b945094505060406126db88828901612190565b92505060606126ec8882890161222b565b9150509295509295909350565b61270281612394565b82525050565b600060208201905061271d60008301846126f9565b92915050565b6000602082840312156127395761273861213d565b5b600061274784828501612190565b91505092915050565b600082825260208201905092915050565b7f436f6e7472616374206973207061757365640000000000000000000000000000600082015250565b6000612797601283612750565b91506127a282612761565b602082019050919050565b600060208201905081810360008301526127c68161278a565b9050919050565b7f436f6e74656e7420636f6e74726163742061646472657373206973206e756c6c600082015250565b6000612803602083612750565b915061280e826127cd565b602082019050919050565b60006020820190508181036000830152612832816127f6565b9050919050565b7f5573657220636f6e74726163742061646472657373206973206e756c6c000000600082015250565b600061286f601d83612750565b915061287a82612839565b602082019050919050565b6000602082019050818103600083015261289e81612862565b9050919050565b60006128b18385612750565b93506128be8385846124e5565b6128c783612428565b840190509392505050565b60006060820190506128e760008301876123f9565b81810360208301526128fa8185876128a5565b905061290960408301846125d3565b95945050505050565b60008151905061292181612214565b92915050565b60006020828403121561293d5761293c61213d565b5b600061294b84828501612912565b91505092915050565b600060408201905061296960008301856123f9565b61297660208301846125d3565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006129b78261220a565b91506129c28361220a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156129f7576129f661297d565b5b828201905092915050565b7f4e6f7420656e6f7567682066756e647300000000000000000000000000000000600082015250565b6000612a38601083612750565b9150612a4382612a02565b602082019050919050565b60006020820190508181036000830152612a6781612a2b565b9050919050565b600081905092915050565b6000612a858385612a6e565b9350612a928385846124e5565b82840190509392505050565b6000612aab828486612a79565b91508190509392505050565b6000608082019050612acc60008301886123f9565b8181036020830152612adf8186886128a5565b9050612aee60408301856123f9565b612afb60608301846125d3565b9695505050505050565b6000606082019050612b1a60008301866123f9565b612b2760208301856123f9565b612b3460408301846125d3565b949350505050565b6000612b478261220a565b9150612b528361220a565b925082821015612b6557612b6461297d565b5b828203905092915050565b600081905092915050565b50565b6000612b8b600083612b70565b9150612b9682612b7b565b600082019050919050565b6000612bac82612b7e565b9150819050919050565b7f556e61626c6520746f2073656e642066756e6473000000000000000000000000600082015250565b6000612bec601483612750565b9150612bf782612bb6565b602082019050919050565b60006020820190508181036000830152612c1b81612bdf565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000606082019050612c6660008301876123f9565b8181036020830152612c798185876128a5565b9050612c8860408301846123f9565b95945050505050565b7f496e73756666696369656e742073686172657300000000000000000000000000600082015250565b6000612cc7601383612750565b9150612cd282612c91565b602082019050919050565b60006020820190508181036000830152612cf681612cba565b9050919050565b6000612d088261220a565b9150612d138361220a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612d4c57612d4b61297d565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612d918261220a565b9150612d9c8361220a565b925082612dac57612dab612d57565b5b828204905092915050565b7f496e73756666696369656e742075736572207368617265730000000000000000600082015250565b6000612ded601883612750565b9150612df882612db7565b602082019050919050565b60006020820190508181036000830152612e1c81612de0565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000612e7f602683612750565b9150612e8a82612e23565b604082019050919050565b60006020820190508181036000830152612eae81612e72565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000612eeb601f83612750565b9150612ef682612eb5565b602082019050919050565b60006020820190508181036000830152612f1a81612ede565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f57602083612750565b9150612f6282612f21565b602082019050919050565b60006020820190508181036000830152612f8681612f4a565b905091905056fea2646970667358221220d72d527fe4f360dd85bc6d405602491aac0d11368baa08467a45d836ea55df6264736f6c6343000809003300000000000000000000000075ac7ada4d345952f6e759778be1cfebcb8a20ae000000000000000000000000d42d47815c862914a0b2d4b35b30fe535f3a66b5
Deployed Bytecode
0x6080604052600436106100c25760003560e01c80634fe3d5981161007f5780639699e514116100595780639699e51414610259578063b187bd2614610296578063d92aabfc146102c1578063f2fde38b146102ec576100c2565b80634fe3d598146101da578063715018a6146102175780638da5cb5b1461022e576100c2565b80630c3967ee146100c757806316a61c80146100e357806316c38b3c14610120578063174953e9146101495780632310167f146101725780634c6ef3d71461019d575b600080fd5b6100e160048036038101906100dc9190612240565b610315565b005b3480156100ef57600080fd5b5061010a60048036038101906101059190612240565b610a74565b6040516101179190612372565b60405180910390f35b34801561012c57600080fd5b50610147600480360381019061014291906123cc565b610ff3565b005b34801561015557600080fd5b50610170600480360381019061016b9190612240565b61104f565b005b34801561017e57600080fd5b50610187611625565b6040516101949190612408565b60405180910390f35b3480156101a957600080fd5b506101c460048036038101906101bf9190612564565b61164b565b6040516101d191906125e2565b60405180910390f35b3480156101e657600080fd5b5061020160048036038101906101fc91906125fd565b611693565b60405161020e91906125e2565b60405180910390f35b34801561022357600080fd5b5061022c61173a565b005b34801561023a57600080fd5b5061024361174e565b6040516102509190612408565b60405180910390f35b34801561026557600080fd5b50610280600480360381019061027b9190612671565b611777565b60405161028d9190612372565b60405180910390f35b3480156102a257600080fd5b506102ab611c79565b6040516102b89190612708565b60405180910390f35b3480156102cd57600080fd5b506102d6611c8c565b6040516102e39190612408565b60405180910390f35b3480156102f857600080fd5b50610313600480360381019061030e9190612723565b611cb2565b005b61031d611d36565b600360149054906101000a900460ff161561036d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610364906127ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156103ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f690612819565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610491576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048890612885565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008273ffffffffffffffffffffffffffffffffffffffff166325384b4c888888886040518563ffffffff1660e01b815260040161052094939291906128d2565b60206040518083038186803b15801561053857600080fd5b505afa15801561054c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105709190612927565b905060008373ffffffffffffffffffffffffffffffffffffffff16637faebbd3898989896040518563ffffffff1660e01b81526004016105b394939291906128d2565b60206040518083038186803b1580156105cb57600080fd5b505afa1580156105df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106039190612927565b905060008373ffffffffffffffffffffffffffffffffffffffff1663a74ead828a856040518363ffffffff1660e01b8152600401610642929190612954565b60206040518083038186803b15801561065a57600080fd5b505afa15801561066e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106929190612927565b905060008473ffffffffffffffffffffffffffffffffffffffff16630f026f6d8b846040518363ffffffff1660e01b81526004016106d1929190612954565b60206040518083038186803b1580156106e957600080fd5b505afa1580156106fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107219190612927565b90506000818461073191906129ac565b905080341015610776576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076d90612a4e565b60405180910390fd5b82600460008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208b8b6040516107c6929190612a9e565b908152602001604051809103902060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461081c91906129ac565b600460008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208b8b60405161086b929190612a9e565b908152602001604051809103902060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff16635cd7896d858d8d8d338e6040518763ffffffff1660e01b81526004016108fc959493929190612ab7565b6000604051808303818588803b15801561091557600080fd5b505af1158015610929573d6000803e3d6000fd5b50505050508573ffffffffffffffffffffffffffffffffffffffff1663dd06f6bd838d33876040518563ffffffff1660e01b815260040161096c93929190612b05565b6000604051808303818588803b15801561098557600080fd5b505af1158015610999573d6000803e3d6000fd5b505050505080341115610a5f5760003373ffffffffffffffffffffffffffffffffffffffff1682346109cb9190612b3c565b6040516109d790612ba1565b60006040518083038185875af1925050503d8060008114610a14576040519150601f19603f3d011682016040523d82523d6000602084013e610a19565b606091505b5050905080610a5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5490612c02565b60405180910390fd5b505b50505050505050610a6e611d86565b50505050565b6060600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aff90612819565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9190612885565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008273ffffffffffffffffffffffffffffffffffffffff166325384b4c898989896040518563ffffffff1660e01b8152600401610c2994939291906128d2565b60206040518083038186803b158015610c4157600080fd5b505afa158015610c55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c799190612927565b905060008373ffffffffffffffffffffffffffffffffffffffff16637faebbd38a8a8a8a6040518563ffffffff1660e01b8152600401610cbc94939291906128d2565b60206040518083038186803b158015610cd457600080fd5b505afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c9190612927565b905060008373ffffffffffffffffffffffffffffffffffffffff1663a74ead828b856040518363ffffffff1660e01b8152600401610d4b929190612954565b60206040518083038186803b158015610d6357600080fd5b505afa158015610d77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9b9190612927565b905060008473ffffffffffffffffffffffffffffffffffffffff16634635256e8c846040518363ffffffff1660e01b8152600401610dda929190612954565b60206040518083038186803b158015610df257600080fd5b505afa158015610e06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2a9190612927565b905060008573ffffffffffffffffffffffffffffffffffffffff16630f026f6d8d856040518363ffffffff1660e01b8152600401610e69929190612954565b60206040518083038186803b158015610e8157600080fd5b505afa158015610e95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb99190612927565b905060008185610ec991906129ac565b90506000600667ffffffffffffffff811115610ee857610ee7612439565b5b604051908082528060200260200182016040528015610f165781602001602082028036833780820191505090505b5090508681600081518110610f2e57610f2d612c22565b5b6020026020010181815250508581600181518110610f4f57610f4e612c22565b5b6020026020010181815250508481600281518110610f7057610f6f612c22565b5b6020026020010181815250508381600381518110610f9157610f90612c22565b5b6020026020010181815250508281600481518110610fb257610fb1612c22565b5b6020026020010181815250508181600581518110610fd357610fd2612c22565b5b602002602001018181525050809950505050505050505050949350505050565b610ffb611d8f565b80600360146101000a81548160ff0219169083151502179055507f64891834b8201e4fdeda37096a5f1c16360f209047b1e9a93839cc5bbbb763bd816040516110449190612708565b60405180910390a150565b611057611d36565b600360149054906101000a900460ff16156110a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109e906127ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611139576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113090612819565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156111cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c290612885565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020868660405161126a929190612a9e565b908152602001604051809103902060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008373ffffffffffffffffffffffffffffffffffffffff1663220b647d898989336040518563ffffffff1660e01b81526004016112f99493929190612c51565b60206040518083038186803b15801561131157600080fd5b505afa158015611325573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113499190612927565b90508481101561138e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138590612cdd565b60405180910390fd5b600081838761139d9190612cfd565b6113a79190612d86565b9050828111156113ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e390612e03565b60405180910390fd5b80600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020898960405161143c929190612a9e565b908152602001604051809103902060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114929190612b3c565b600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002089896040516114e1929190612a9e565b908152602001604051809103902060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff1663a95bdf938a8a8a338b6040518663ffffffff1660e01b8152600401611571959493929190612ab7565b600060405180830381600087803b15801561158b57600080fd5b505af115801561159f573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff1663bc810c1a8a33846040518463ffffffff1660e01b81526004016115e093929190612b05565b600060405180830381600087803b1580156115fa57600080fd5b505af115801561160e573d6000803e3d6000fd5b50505050505050505061161f611d86565b50505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60046020528260005260406000208280516020810182018051848252602083016020850120818352809550505050505060205280600052604060002060009250925050505481565b6000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084846040516116e4929190612a9e565b908152602001604051809103902060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050949350505050565b611742611d8f565b61174c6000611e0d565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561180b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180290612819565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561189d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189490612885565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060006118fa8989898989611ed1565b905060008373ffffffffffffffffffffffffffffffffffffffff1663be32e6848b8b8b8a6040518563ffffffff1660e01b815260040161193d94939291906128d2565b60206040518083038186803b15801561195557600080fd5b505afa158015611969573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198d9190612927565b905060008473ffffffffffffffffffffffffffffffffffffffff16633def7b938c8c8c8b6040518563ffffffff1660e01b81526004016119d094939291906128d2565b60206040518083038186803b1580156119e857600080fd5b505afa1580156119fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a209190612927565b905060008473ffffffffffffffffffffffffffffffffffffffff16639ae717818d866040518363ffffffff1660e01b8152600401611a5f929190612954565b60206040518083038186803b158015611a7757600080fd5b505afa158015611a8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aaf9190612927565b905060008573ffffffffffffffffffffffffffffffffffffffff16632267a89c8e876040518363ffffffff1660e01b8152600401611aee929190612954565b60206040518083038186803b158015611b0657600080fd5b505afa158015611b1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3e9190612927565b905060008184611b4e91906129ac565b90506000600667ffffffffffffffff811115611b6d57611b6c612439565b5b604051908082528060200260200182016040528015611b9b5781602001602082028036833780820191505090505b5090508581600081518110611bb357611bb2612c22565b5b6020026020010181815250508481600181518110611bd457611bd3612c22565b5b6020026020010181815250508681600281518110611bf557611bf4612c22565b5b6020026020010181815250508381600381518110611c1657611c15612c22565b5b6020026020010181815250508281600481518110611c3757611c36612c22565b5b6020026020010181815250508181600581518110611c5857611c57612c22565b5b60200260200101818152505080995050505050505050505095945050505050565b600360149054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611cba611d8f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611d2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2190612e95565b60405180910390fd5b611d3381611e0d565b50565b60026001541415611d7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7390612f01565b60405180910390fd5b6002600181905550565b60018081905550565b611d9761212b565b73ffffffffffffffffffffffffffffffffffffffff16611db561174e565b73ffffffffffffffffffffffffffffffffffffffff1614611e0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e0290612f6d565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611f64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5b90612819565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208787604051611fdc929190612a9e565b908152602001604051809103902060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008273ffffffffffffffffffffffffffffffffffffffff1663220b647d8a8a8a8a6040518563ffffffff1660e01b815260040161206b9493929190612c51565b60206040518083038186803b15801561208357600080fd5b505afa158015612097573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120bb9190612927565b905084811015612100576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f790612cdd565b60405180910390fd5b600081838761210f9190612cfd565b6121199190612d86565b90508094505050505095945050505050565b600033905090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061217282612147565b9050919050565b61218281612167565b811461218d57600080fd5b50565b60008135905061219f81612179565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126121ca576121c96121a5565b5b8235905067ffffffffffffffff8111156121e7576121e66121aa565b5b602083019150836001820283011115612203576122026121af565b5b9250929050565b6000819050919050565b61221d8161220a565b811461222857600080fd5b50565b60008135905061223a81612214565b92915050565b6000806000806060858703121561225a5761225961213d565b5b600061226887828801612190565b945050602085013567ffffffffffffffff81111561228957612288612142565b5b612295878288016121b4565b935093505060406122a88782880161222b565b91505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6122e98161220a565b82525050565b60006122fb83836122e0565b60208301905092915050565b6000602082019050919050565b600061231f826122b4565b61232981856122bf565b9350612334836122d0565b8060005b8381101561236557815161234c88826122ef565b975061235783612307565b925050600181019050612338565b5085935050505092915050565b6000602082019050818103600083015261238c8184612314565b905092915050565b60008115159050919050565b6123a981612394565b81146123b457600080fd5b50565b6000813590506123c6816123a0565b92915050565b6000602082840312156123e2576123e161213d565b5b60006123f0848285016123b7565b91505092915050565b61240281612167565b82525050565b600060208201905061241d60008301846123f9565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61247182612428565b810181811067ffffffffffffffff821117156124905761248f612439565b5b80604052505050565b60006124a3612133565b90506124af8282612468565b919050565b600067ffffffffffffffff8211156124cf576124ce612439565b5b6124d882612428565b9050602081019050919050565b82818337600083830152505050565b6000612507612502846124b4565b612499565b90508281526020810184848401111561252357612522612423565b5b61252e8482856124e5565b509392505050565b600082601f83011261254b5761254a6121a5565b5b813561255b8482602086016124f4565b91505092915050565b60008060006060848603121561257d5761257c61213d565b5b600061258b86828701612190565b935050602084013567ffffffffffffffff8111156125ac576125ab612142565b5b6125b886828701612536565b92505060406125c986828701612190565b9150509250925092565b6125dc8161220a565b82525050565b60006020820190506125f760008301846125d3565b92915050565b600080600080606085870312156126175761261661213d565b5b600061262587828801612190565b945050602085013567ffffffffffffffff81111561264657612645612142565b5b612652878288016121b4565b9350935050604061266587828801612190565b91505092959194509250565b60008060008060006080868803121561268d5761268c61213d565b5b600061269b88828901612190565b955050602086013567ffffffffffffffff8111156126bc576126bb612142565b5b6126c8888289016121b4565b945094505060406126db88828901612190565b92505060606126ec8882890161222b565b9150509295509295909350565b61270281612394565b82525050565b600060208201905061271d60008301846126f9565b92915050565b6000602082840312156127395761273861213d565b5b600061274784828501612190565b91505092915050565b600082825260208201905092915050565b7f436f6e7472616374206973207061757365640000000000000000000000000000600082015250565b6000612797601283612750565b91506127a282612761565b602082019050919050565b600060208201905081810360008301526127c68161278a565b9050919050565b7f436f6e74656e7420636f6e74726163742061646472657373206973206e756c6c600082015250565b6000612803602083612750565b915061280e826127cd565b602082019050919050565b60006020820190508181036000830152612832816127f6565b9050919050565b7f5573657220636f6e74726163742061646472657373206973206e756c6c000000600082015250565b600061286f601d83612750565b915061287a82612839565b602082019050919050565b6000602082019050818103600083015261289e81612862565b9050919050565b60006128b18385612750565b93506128be8385846124e5565b6128c783612428565b840190509392505050565b60006060820190506128e760008301876123f9565b81810360208301526128fa8185876128a5565b905061290960408301846125d3565b95945050505050565b60008151905061292181612214565b92915050565b60006020828403121561293d5761293c61213d565b5b600061294b84828501612912565b91505092915050565b600060408201905061296960008301856123f9565b61297660208301846125d3565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006129b78261220a565b91506129c28361220a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156129f7576129f661297d565b5b828201905092915050565b7f4e6f7420656e6f7567682066756e647300000000000000000000000000000000600082015250565b6000612a38601083612750565b9150612a4382612a02565b602082019050919050565b60006020820190508181036000830152612a6781612a2b565b9050919050565b600081905092915050565b6000612a858385612a6e565b9350612a928385846124e5565b82840190509392505050565b6000612aab828486612a79565b91508190509392505050565b6000608082019050612acc60008301886123f9565b8181036020830152612adf8186886128a5565b9050612aee60408301856123f9565b612afb60608301846125d3565b9695505050505050565b6000606082019050612b1a60008301866123f9565b612b2760208301856123f9565b612b3460408301846125d3565b949350505050565b6000612b478261220a565b9150612b528361220a565b925082821015612b6557612b6461297d565b5b828203905092915050565b600081905092915050565b50565b6000612b8b600083612b70565b9150612b9682612b7b565b600082019050919050565b6000612bac82612b7e565b9150819050919050565b7f556e61626c6520746f2073656e642066756e6473000000000000000000000000600082015250565b6000612bec601483612750565b9150612bf782612bb6565b602082019050919050565b60006020820190508181036000830152612c1b81612bdf565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000606082019050612c6660008301876123f9565b8181036020830152612c798185876128a5565b9050612c8860408301846123f9565b95945050505050565b7f496e73756666696369656e742073686172657300000000000000000000000000600082015250565b6000612cc7601383612750565b9150612cd282612c91565b602082019050919050565b60006020820190508181036000830152612cf681612cba565b9050919050565b6000612d088261220a565b9150612d138361220a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612d4c57612d4b61297d565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612d918261220a565b9150612d9c8361220a565b925082612dac57612dab612d57565b5b828204905092915050565b7f496e73756666696369656e742075736572207368617265730000000000000000600082015250565b6000612ded601883612750565b9150612df882612db7565b602082019050919050565b60006020820190508181036000830152612e1c81612de0565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000612e7f602683612750565b9150612e8a82612e23565b604082019050919050565b60006020820190508181036000830152612eae81612e72565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000612eeb601f83612750565b9150612ef682612eb5565b602082019050919050565b60006020820190508181036000830152612f1a81612ede565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f57602083612750565b9150612f6282612f21565b602082019050919050565b60006020820190508181036000830152612f8681612f4a565b905091905056fea2646970667358221220d72d527fe4f360dd85bc6d405602491aac0d11368baa08467a45d836ea55df6264736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000075ac7ada4d345952f6e759778be1cfebcb8a20ae000000000000000000000000d42d47815c862914a0b2d4b35b30fe535f3a66b5
-----Decoded View---------------
Arg [0] : _contentContractAddress (address): 0x75Ac7ada4d345952f6e759778BE1cFEBCB8a20ae
Arg [1] : _userContractAddress (address): 0xd42D47815c862914A0b2d4b35b30fE535f3A66B5
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000075ac7ada4d345952f6e759778be1cfebcb8a20ae
Arg [1] : 000000000000000000000000d42d47815c862914a0b2d4b35b30fe535f3a66b5
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$484.69
Net Worth in POL
Token Allocations
ETH
100.00%
Multichain Portfolio | 32 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $2,308.04 | 0.21 | $484.69 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.