Kyc contract allows the owner to enable or disable KYC verification for users by updating their verification status and emitting corresponding events.
-
enableKyc(user)
Enables KYC verification for a user, setting their status to verified, and emits the EnableKyc event; can only be called by the contract owner. -
disableKyc(user)
Disables KYC verification for a user, setting their status to unverified, and emits the DisableKyc event; can only be called by the contract owner.
ERC-20 token named "ICON Utility Coin" (symbol: IUC) with an initial supply specified at deployment, leveraging OpenZeppelin's ERC20 and Ownable contracts for standard token functionality and ownership management.
IPToken owner can grant, update, and revoke licenses for the usage of intellectual property associated with that token, with functionality to manage license details such as type, duration, and usage rights.
-
grant(uint256 ipTokenId, string memory licenseType, uint256 startDate, uint256 endDate, string memory usageRight)Grants a new license for the specified IP token, with details about the license type, start and end dates, and usage rights, only if the sender is the owner of the IP token.
-
update(uint256 licenseId, string memory licenseType, uint256 startDate, uint256 endDate, string memory usageRight)Updates an existing license by modifying its type, start and end dates, and usage rights, as long as the caller is the owner of the related IP token.
-
revoke(uint256 licenseId, bool status)Revokes or re-enables an existing license by changing its "enabled" status, only if the caller is the owner of the related IP token.
-
setIPTokenAddress(address _IPToken)Allows the owner of the contract to set or update the address of the associated IP token, emitting an event for the change.
-
onlyIPTokenOwner(uint256 tokenId)A modifier that ensures the caller is the owner of the specified IP token (ERC-721) before allowing access to the function.
This Solidity smart contract defines "ICON Right Token" (IRT), an ERC-721 non-fungible token with DAO-controlled minting, burning, and transfers, designed for proposal indexing and managed URI functionality.
-
constructor
Initializes the contract with the name "ICON Right Token" and symbol "IRT". -
mint(address to, string calldata tokenURI_, uint256 proposalIndex)
Mints a new token with a specified URI and associates it with a proposal index, restricted to the ICON DAO. -
mint(uint256 tokenId)
Burns a specified token, restricted to the ICON DAO. -
setTokenURI(uint256 tokenId, string calldata tokenURI_)
Updates the URI of an existing token, restricted to the ICON DAO. -
setBaseURI(string calldata baseURI_)
Updates the base URI for all tokens, restricted to the contract owner. -
setIconDaoAddress(address _iconDaoAddress)
Sets the address of the ICON DAO, restricted to the contract owner. -
_baseURI()
Retrieves the extended base URI for the tokens. -
_beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize)
Ensures that token transfers are only initiated through the ICON DAO. -
transferFrom(address from, address to, uint256 tokenId)
Transfers a token from one address to another, restricted to the ICON DAO. -
safeTransferFrom(address from, address to, uint256 tokenId)
Safely transfers a token from one address to another, restricted to the ICON DAO.
This Solidity smart contract implements a staking system for ICON tokens, enabling users to stake tokens, earn rewards, and manage penalties, fees, and reward distribution, with KYC verification and DAO-controlled actions.
-
constructor
Initializes the staking contract with the ICON token, reward per block, fee wallet, and KYC address, and sets up the default unstake fee structure. -
init
Configures the initial unstake fee structure with predefined durations and percentages. -
setFeeWallet(address _feeWallet)
Updates the wallet address where fees are collected, restricted to the contract owner. -
setUnStakeFee(uint256 _index, uint256 _minDays, uint256 _feePercent)
Modifies the parameters of an existing unstake fee tier, ensuring proper validation, restricted to the contract owner. -
addUnStakeFee(uint256 _minDays, uint256 _feePercent)
Adds a new unstake fee tier with specified duration and percentage, restricted to the contract owner. -
removeUnStakeFee(uint256 _index)
Removes an unstake fee tier by index, restricted to the contract owner. -
setHarvestFee(uint256 _feePercent)
Updates the fee percentage charged during harvesting, restricted to the contract owner. -
getMultiplier(uint256 _from, uint256 _to)
Calculates the block difference between two blocks to determine the reward multiplier. -
getPending(address _user)
Returns the pending reward amount for a user after deducting the harvest fee. -
_getPending(address _user)
Internally calculates the pending rewards for a user based on staking activity. -
getRewardBalance()
Retrieves the current available reward balance, accounting for accrued rewards since the last update. -
depositReward(uint256 _amount)
Deposits rewards into the contract by transferring tokens from the owner to the contract. -
updateStatus()
Updates the reward distribution and adjusts internal reward variables based on the latest staking status. -
stake(uint256 _amount)
Allows a user to stake a specified amount of tokens, updating the user's staking information and reward debt. -
unStake(uint256 _amount)
Enables a user to withdraw staked tokens, applying the applicable unstake fee based on staking duration. -
getUnStakeFeePercent(address _user)
Calculates the applicable unstake fee percentage for a user based on their staking duration. -
harvest(bool reStake)
Allows a user to claim pending rewards or reinvest them into the staking pool, applying the harvest fee if not restaking. -
penalty(address user, uint256 percent)
Applies a penalty to reduce a user's staked amount by a specified percentage, restricted to the DAO.
The ICONDao smart contract is a governance system that facilitates decentralized decision-making through proposal creation, voting, and execution for actions such as issuing, editing, transferring, or disputing ERC-721 tokens, while incorporating features like KYC verification, staking-based voting, and penalty enforcement for fraudulent activities.
Here's a detailed description of each function in the ICONDao contract:
-
constructor
Initializes the contract with KYC, staking, and token addresses, sets initial proposal fees, and establishes a default proposal period. -
createProposal
Allows verified KYC users with staked tokens to create proposals for actions like issuing, editing, transferring, or disputing tokens by paying the required fee. -
vote
Enables KYC-verified stakers to cast votes on active proposals, with the user's stake determining their voting power. -
execute
Executes a proposal if it has sufficient votes and is past the proposal period, triggering the corresponding action based on the proposal type. -
_executeIssueToken
Internally handles issuing a new token to a specified address with a unique URI, linked to a proposal. -
_executeEditToken
Internally modifies the metadata (URI) of an existing token based on proposal details. -
_executeTransferToken
Internally transfers ownership of a token from one address to another as approved by a proposal. -
_executeDisputeToken
Internally burns a disputed token, penalizes the submitter, and marks the proposal as disputed. -
setFee
Allows the contract owner to update the fee for a specific proposal type. -
setKycAddress
Allows the contract owner to update the KYC verification contract address. -
setIconRightTokenAddress
Allows the contract owner to update the ERC-721 token contract address. -
setStakingContractAddress
Allows the contract owner to update the staking contract address. -
setMinVoteAmount
Allows the contract owner to set the minimum number of votes required for a proposal to pass.