Failed to verify contract
See original GitHub issueI’m currently trying to verify two contracts with truffle-plugin-verify on the rinkeby network. Migrating over truffle is working without problems. Some time ago the verifying worked fine too, but now it’s not possible for me to verify a special contract. I already tried to verify the same contracts on different devices and it worked. Pretty strange behavior. Especially that one of both contracts is always possible to verify and the other not.
Verifying Challenger Fail - Unable to verify Verifying ChallengeManager Pass - Verified: https://rinkeby.etherscan.io/address/0x1Df6a238d6AF71Fc5e07ed1038dC328c44E7ef11#contracts
DEBUG logging is turned ON
Running truffle-plugin-verify v0.5.14
Verifying Challenger
Reading artifact file at /home/sebastian/Documents/Dev/fitness-challenge/build/contracts/Challenger.json
Retrieving constructor parameters from https://api-rinkeby.etherscan.io/api?apiKey=placeholder&module=account&action=txlist&address=0x840d1c5691AC815Cb931eeb8d21C9d722D19e8C0&page=1&sort=asc&offset=1
Constructor parameters retrieved: 0x0000000000000000000000001df6a238d6af71fc5e07ed1038dc328c44e7ef11
Sending verify request with POST arguments:
{
"apikey": "placeholder",
"module": "contract",
"action": "verifysourcecode",
"contractaddress": "0x840d1c5691AC815Cb931eeb8d21C9d722D19e8C0",
"sourceCode": "{\"language\":\"Solidity\",\"sources\":{\"/contracts/ChallengeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.5.17 <0.9.0;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"./Evaluation.sol\\\";\\nimport \\\"./LockFactory.sol\\\";\\n\\ncontract ChallengeManager is LockFactory {\\n uint256 counter = 0;\\n // only for testing, used to determine which chellenge gets displayed on the frontEnd\\n uint256 displayedChallenge = 0;\\n\\n struct Challenge {\\n uint256 id;\\n address creator;\\n string title;\\n string description;\\n uint256 start;\\n uint256 end;\\n uint256 participantsCount;\\n uint256 price;\\n address first;\\n LeaderboardEntry[] leaderBoard;\\n Evaluation evaluation;\\n }\\n\\n struct LeaderboardEntry {\\n address challenger;\\n uint256 data;\\n uint256 time;\\n }\\n\\n mapping(uint256 => Challenge) public challenges;\\n\\n function setDisplayedChallengeID(uint256 id) external {\\n displayedChallenge = id;\\n }\\n\\n function getDisplayedChallengeID() public view returns (uint256) {\\n return displayedChallenge;\\n }\\n\\n function createChallenge(\\n string calldata title,\\n string calldata description,\\n uint256 start,\\n uint256 end,\\n uint256 participantsCount,\\n uint256 price,\\n address evaluationAdr\\n ) external returns (Challenge memory) {\\n createNewLock(counter, end - start, price, participantsCount);\\n\\n challenges[counter].id = counter;\\n challenges[counter].creator = msg.sender;\\n challenges[counter].title = title;\\n challenges[counter].description = description;\\n challenges[counter].start = start;\\n challenges[counter].end = end;\\n challenges[counter].participantsCount = participantsCount;\\n challenges[counter].price = price;\\n challenges[counter].evaluation = Evaluation(evaluationAdr);\\n\\n return challenges[counter++];\\n }\\n\\n function addLeaderboardEntry(\\n uint256 id,\\n address sender,\\n uint256 data,\\n uint256 time\\n ) public {\\n challenges[id].leaderBoard.push(LeaderboardEntry(sender, data, time));\\n }\\n\\n function getWinner(uint256 challengeId) public view returns (address) {\\n require(block.timestamp >= challenges[challengeId].end);\\n return challenges[challengeId].first;\\n }\\n\\n function getAllChallenges() public view returns (Challenge[] memory) {\\n Challenge[] memory array = new Challenge[](counter);\\n for (uint256 i = 0; i < array.length; i++) {\\n array[i].id = challenges[i].id;\\n array[i].creator = challenges[i].creator;\\n array[i].title = challenges[i].title;\\n array[i].description = challenges[i].description;\\n array[i].start = challenges[i].start;\\n array[i].end = challenges[i].end;\\n array[i].participantsCount = challenges[i].participantsCount;\\n array[i].price = challenges[i].price;\\n array[i].first = challenges[i].first;\\n }\\n return array;\\n }\\n}\\n\"},\"/contracts/Challenger.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.5.17 <0.9.0;\\n\\nimport \\\"./ChallengeManager.sol\\\";\\n\\ncontract Challenger {\\n ChallengeManager internal manager;\\n\\n constructor(address adr) public {\\n manager = ChallengeManager(adr);\\n }\\n function unlockChallenge(uint256 id) external payable {\\n IPublicLock lock = manager.getLock(id);\\n require(address(lock) != address(0), \\\"NO_LOCK_WITH_THIS_KEY\\\");\\n lock.purchase.value(msg.value)(\\n lock.keyPrice(),\\n msg.sender,\\n 0x0d5900731140977cd80b7Bd2DCE9cEc93F8a176B,\\n \\\"0x00\\\"\\n );\\n }\\n\\n function submitData(\\n uint256 id,\\n uint32 data,\\n uint256 time\\n ) external returns (bool) {\\n manager.addLeaderboardEntry(id, msg.sender, data, time);\\n }\\n\\n function receivePrice(uint256 challengeId) external {\\n require(isWinner(challengeId), \\\"Not the winner\\\");\\n //add lock withdraw\\n }\\n\\n function isWinner(uint256 challengeId) public view returns (bool) {\\n return msg.sender == manager.getWinner(challengeId);\\n }\\n}\\n\"},\"/contracts/Evaluation.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.5.17 <0.9.0;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"./ChallengeManager.sol\\\";\\n\\ninterface Evaluation {\\n function evaluate(ChallengeManager.LeaderboardEntry[] calldata entry)\\n external\\n returns (uint256 id);\\n\\n function setRules(string calldata rules) external;\\n}\\n\"},\"/contracts/LockFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.17 <0.9.0;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"./interfaces/unlock/IPublicLock.sol\\\";\\nimport \\\"./interfaces/unlock/IUnlock.sol\\\";\\n\\ncontract LockFactory {\\n IUnlock internal unlock;\\n\\n mapping(uint256 => IPublicLock) lockToId;\\n\\n constructor() public {\\n unlock = IUnlock(0xD8C88BE5e8EB88E38E6ff5cE186d764676012B0b);\\n }\\n\\n function createNewLock(\\n uint256 id,\\n uint256 duration,\\n uint256 price,\\n uint256 numberOfKeys\\n ) internal {\\n IPublicLock lock = IPublicLock(\\n address(\\n uint160(\\n unlock.createLock(\\n duration,\\n address(0),\\n price,\\n numberOfKeys,\\n \\\"foo\\\",\\n bytes12(keccak256(abi.encodePacked(id)))\\n )\\n )\\n )\\n );\\n lockToId[id] = lock;\\n }\\n\\n function getKeyPrice(uint256 id) external view returns (uint256) {\\n return lockToId[id].keyPrice();\\n }\\n\\n function updateKeyPrice(uint256 id, uint256 keyPrice) external {\\n lockToId[id].updateKeyPricing(keyPrice, address(0));\\n }\\n\\n function getLock(uint256 id) public view returns (IPublicLock) {\\n return lockToId[id];\\n }\\n}\\n\"},\"/contracts/interfaces/unlock/IPublicLock.sol\":{\"content\":\"pragma solidity 0.5.17;\\n\\n/**\\n * @title The PublicLock Interface\\n * @author Nick Furfaro (unlock-protocol.com)\\n */\\n\\ncontract IPublicLock {\\n // See indentationissue description here:\\n // https://github.com/duaraghav8/Ethlint/issues/268\\n // solium-disable indentation\\n\\n /// Functions\\n\\n function initialize(\\n address _lockCreator,\\n uint256 _expirationDuration,\\n address _tokenAddress,\\n uint256 _keyPrice,\\n uint256 _maxNumberOfKeys,\\n string calldata _lockName\\n ) external;\\n\\n /**\\n * @notice Allow the contract to accept tips in ETH sent directly to the contract.\\n * @dev This is okay to use even if the lock is priced in ERC-20 tokens\\n */\\n function() external payable;\\n\\n /**\\n * @dev Never used directly\\n */\\n function initialize() external;\\n\\n /**\\n * @notice The version number of the current implementation on this network.\\n * @return The current version number.\\n */\\n function publicLockVersion() public pure returns (uint256);\\n\\n /**\\n * @notice Gets the current balance of the account provided.\\n * @param _tokenAddress The token type to retrieve the balance of.\\n * @param _account The account to get the balance of.\\n * @return The number of tokens of the given type for the given address, possibly 0.\\n */\\n function getBalance(address _tokenAddress, address _account)\\n external\\n view\\n returns (uint256);\\n\\n /**\\n * @notice Used to disable lock before migrating keys and/or destroying contract.\\n * @dev Throws if called by other than a lock manager.\\n * @dev Throws if lock contract has already been disabled.\\n */\\n function disableLock() external;\\n\\n /**\\n * @dev Called by a lock manager or beneficiary to withdraw all funds from the lock and send them to the `beneficiary`.\\n * @dev Throws if called by other than a lock manager or beneficiary\\n * @param _tokenAddress specifies the token address to withdraw or 0 for ETH. This is usually\\n * the same as `tokenAddress` in MixinFunds.\\n * @param _amount specifies the max amount to withdraw, which may be reduced when\\n * considering the available balance. Set to 0 or MAX_UINT to withdraw everything.\\n * -- however be wary of draining funds as it breaks the `cancelAndRefund` and `expireAndRefundFor`\\n * use cases.\\n */\\n function withdraw(address _tokenAddress, uint256 _amount) external;\\n\\n /**\\n * @notice An ERC-20 style approval, allowing the spender to transfer funds directly from this lock.\\n */\\n function approveBeneficiary(address _spender, uint256 _amount)\\n external\\n returns (bool);\\n\\n /**\\n * A function which lets a Lock manager of the lock to change the price for future purchases.\\n * @dev Throws if called by other than a Lock manager\\n * @dev Throws if lock has been disabled\\n * @dev Throws if _tokenAddress is not a valid token\\n * @param _keyPrice The new price to set for keys\\n * @param _tokenAddress The address of the erc20 token to use for pricing the keys,\\n * or 0 to use ETH\\n */\\n function updateKeyPricing(uint256 _keyPrice, address _tokenAddress)\\n external;\\n\\n /**\\n * A function which lets a Lock manager update the beneficiary account,\\n * which receives funds on withdrawal.\\n * @dev Throws if called by other than a Lock manager or beneficiary\\n * @dev Throws if _beneficiary is address(0)\\n * @param _beneficiary The new address to set as the beneficiary\\n */\\n function updateBeneficiary(address _beneficiary) external;\\n\\n /**\\n * Checks if the user has a non-expired key.\\n * @param _user The address of the key owner\\n */\\n function getHasValidKey(address _user) external view returns (bool);\\n\\n /**\\n * @notice Find the tokenId for a given user\\n * @return The tokenId of the NFT, else returns 0\\n * @param _account The address of the key owner\\n */\\n function getTokenIdFor(address _account) external view returns (uint256);\\n\\n /**\\n * A function which returns a subset of the keys for this Lock as an array\\n * @param _page the page of key owners requested when faceted by page size\\n * @param _pageSize the number of Key Owners requested per page\\n * @dev Throws if there are no key owners yet\\n */\\n function getOwnersByPage(uint256 _page, uint256 _pageSize)\\n external\\n view\\n returns (address[] memory);\\n\\n /**\\n * Checks if the given address owns the given tokenId.\\n * @param _tokenId The tokenId of the key to check\\n * @param _keyOwner The potential key owners address\\n */\\n function isKeyOwner(uint256 _tokenId, address _keyOwner)\\n external\\n view\\n returns (bool);\\n\\n /**\\n * @dev Returns the key's ExpirationTimestamp field for a given owner.\\n * @param _keyOwner address of the user for whom we search the key\\n * @dev Returns 0 if the owner has never owned a key for this lock\\n */\\n function keyExpirationTimestampFor(address _keyOwner)\\n external\\n view\\n returns (uint256 timestamp);\\n\\n /**\\n * Public function which returns the total number of unique owners (both expired\\n * and valid). This may be larger than totalSupply.\\n */\\n function numberOfOwners() external view returns (uint256);\\n\\n /**\\n * Allows a Lock manager to assign a descriptive name for this Lock.\\n * @param _lockName The new name for the lock\\n * @dev Throws if called by other than a Lock manager\\n */\\n function updateLockName(string calldata _lockName) external;\\n\\n /**\\n * Allows a Lock manager to assign a Symbol for this Lock.\\n * @param _lockSymbol The new Symbol for the lock\\n * @dev Throws if called by other than a Lock manager\\n */\\n function updateLockSymbol(string calldata _lockSymbol) external;\\n\\n /**\\n * @dev Gets the token symbol\\n * @return string representing the token symbol\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * Allows a Lock manager to update the baseTokenURI for this Lock.\\n * @dev Throws if called by other than a Lock manager\\n * @param _baseTokenURI String representing the base of the URI for this lock.\\n */\\n function setBaseTokenURI(string calldata _baseTokenURI) external;\\n\\n /** @notice A distinct Uniform Resource Identifier (URI) for a given asset.\\n * @dev Throws if `_tokenId` is not a valid NFT. URIs are defined in RFC\\n * 3986. The URI may point to a JSON file that conforms to the \\\"ERC721\\n * Metadata JSON Schema\\\".\\n * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md\\n * @param _tokenId The tokenID we're inquiring about\\n * @return String representing the URI for the requested token\\n */\\n function tokenURI(uint256 _tokenId) external view returns (string memory);\\n\\n /**\\n * @notice Allows a Lock manager to add or remove an event hook\\n */\\n function setEventHooks(address _onKeyPurchaseHook, address _onKeyCancelHook)\\n external;\\n\\n /**\\n * Allows a Lock manager to give a collection of users a key with no charge.\\n * Each key may be assigned a different expiration date.\\n * @dev Throws if called by other than a Lock manager\\n * @param _recipients An array of receiving addresses\\n * @param _expirationTimestamps An array of expiration Timestamps for the keys being granted\\n */\\n function grantKeys(\\n address[] calldata _recipients,\\n uint256[] calldata _expirationTimestamps,\\n address[] calldata _keyManagers\\n ) external;\\n\\n /**\\n * @dev Purchase function\\n * @param _value the number of tokens to pay for this purchase >= the current keyPrice - any applicable discount\\n * (_value is ignored when using ETH)\\n * @param _recipient address of the recipient of the purchased key\\n * @param _referrer address of the user making the referral\\n * @param _data arbitrary data populated by the front-end which initiated the sale\\n * @dev Throws if lock is disabled. Throws if lock is sold-out. Throws if _recipient == address(0).\\n * @dev Setting _value to keyPrice exactly doubles as a security feature. That way if a Lock manager increases the\\n * price while my transaction is pending I can't be charged more than I expected (only applicable to ERC-20 when more\\n * than keyPrice is approved for spending).\\n */\\n function purchase(\\n uint256 _value,\\n address _recipient,\\n address _referrer,\\n bytes calldata _data\\n ) external payable;\\n\\n /**\\n * @notice returns the minimum price paid for a purchase with these params.\\n * @dev this considers any discount from Unlock or the OnKeyPurchase hook.\\n */\\n function purchasePriceFor(\\n address _recipient,\\n address _referrer,\\n bytes calldata _data\\n ) external view returns (uint256);\\n\\n /**\\n * Allow a Lock manager to change the transfer fee.\\n * @dev Throws if called by other than a Lock manager\\n * @param _transferFeeBasisPoints The new transfer fee in basis-points(bps).\\n * Ex: 200 bps = 2%\\n */\\n function updateTransferFee(uint256 _transferFeeBasisPoints) external;\\n\\n /**\\n * Determines how much of a fee a key owner would need to pay in order to\\n * transfer the key to another account. This is pro-rated so the fee goes down\\n * overtime.\\n * @dev Throws if _keyOwner does not have a valid key\\n * @param _keyOwner The owner of the key check the transfer fee for.\\n * @param _time The amount of time to calculate the fee for.\\n * @return The transfer fee in seconds.\\n */\\n function getTransferFee(address _keyOwner, uint256 _time)\\n external\\n view\\n returns (uint256);\\n\\n /**\\n * @dev Invoked by a Lock manager to expire the user's key and perform a refund and cancellation of the key\\n * @param _keyOwner The key owner to whom we wish to send a refund to\\n * @param amount The amount to refund the key-owner\\n * @dev Throws if called by other than a Lock manager\\n * @dev Throws if _keyOwner does not have a valid key\\n */\\n function expireAndRefundFor(address _keyOwner, uint256 amount) external;\\n\\n /**\\n * @dev allows the key manager to expire a given tokenId\\n * and send a refund to the keyOwner based on the amount of time remaining.\\n * @param _tokenId The id of the key to cancel.\\n */\\n function cancelAndRefund(uint256 _tokenId) external;\\n\\n /**\\n * @dev Cancels a key managed by a different user and sends the funds to the keyOwner.\\n * @param _keyManager the key managed by this user will be canceled\\n * @param _v _r _s getCancelAndRefundApprovalHash signed by the _keyManager\\n * @param _tokenId The key to cancel\\n */\\n function cancelAndRefundFor(\\n address _keyManager,\\n uint8 _v,\\n bytes32 _r,\\n bytes32 _s,\\n uint256 _tokenId\\n ) external;\\n\\n /**\\n * @notice Sets the minimum nonce for a valid off-chain approval message from the\\n * senders account.\\n * @dev This can be used to invalidate a previously signed message.\\n */\\n function invalidateOffchainApproval(uint256 _nextAvailableNonce) external;\\n\\n /**\\n * Allow a Lock manager to change the refund penalty.\\n * @dev Throws if called by other than a Lock manager\\n * @param _freeTrialLength The new duration of free trials for this lock\\n * @param _refundPenaltyBasisPoints The new refund penaly in basis-points(bps)\\n */\\n function updateRefundPenalty(\\n uint256 _freeTrialLength,\\n uint256 _refundPenaltyBasisPoints\\n ) external;\\n\\n /**\\n * @dev Determines how much of a refund a key owner would receive if they issued\\n * @param _keyOwner The key owner to get the refund value for.\\n * a cancelAndRefund block.timestamp.\\n * Note that due to the time required to mine a tx, the actual refund amount will be lower\\n * than what the user reads from this call.\\n */\\n function getCancelAndRefundValueFor(address _keyOwner)\\n external\\n view\\n returns (uint256 refund);\\n\\n function keyManagerToNonce(address) external view returns (uint256);\\n\\n /**\\n * @notice returns the hash to sign in order to allow another user to cancel on your behalf.\\n * @dev this can be computed in JS instead of read from the contract.\\n * @param _keyManager The key manager's address (also the message signer)\\n * @param _txSender The address cancelling cancel on behalf of the keyOwner\\n * @return approvalHash The hash to sign\\n */\\n function getCancelAndRefundApprovalHash(\\n address _keyManager,\\n address _txSender\\n ) external view returns (bytes32 approvalHash);\\n\\n function addKeyGranter(address account) external;\\n\\n function addLockManager(address account) external;\\n\\n function isKeyGranter(address account) external view returns (bool);\\n\\n function isLockManager(address account) external view returns (bool);\\n\\n function onKeyPurchaseHook() external view returns (address);\\n\\n function onKeyCancelHook() external view returns (address);\\n\\n function revokeKeyGranter(address _granter) external;\\n\\n function renounceLockManager() external;\\n\\n ///===================================================================\\n /// Auto-generated getter functions from public state variables\\n\\n function beneficiary() external view returns (address);\\n\\n function expirationDuration() external view returns (uint256);\\n\\n function freeTrialLength() external view returns (uint256);\\n\\n function isAlive() external view returns (bool);\\n\\n function keyPrice() external view returns (uint256);\\n\\n function maxNumberOfKeys() external view returns (uint256);\\n\\n function owners(uint256) external view returns (address);\\n\\n function refundPenaltyBasisPoints() external view returns (uint256);\\n\\n function tokenAddress() external view returns (address);\\n\\n function transferFeeBasisPoints() external view returns (uint256);\\n\\n function unlockProtocol() external view returns (address);\\n\\n function keyManagerOf(uint256) external view returns (address);\\n\\n ///===================================================================\\n\\n /**\\n * @notice Allows the key owner to safely share their key (parent key) by\\n * transferring a portion of the remaining time to a new key (child key).\\n * @dev Throws if key is not valid.\\n * @dev Throws if `_to` is the zero address\\n * @param _to The recipient of the shared key\\n * @param _tokenId the key to share\\n * @param _timeShared The amount of time shared\\n * checks if `_to` is a smart contract (code size > 0). If so, it calls\\n * `onERC721Received` on `_to` and throws if the return value is not\\n * `bytes4(keccak256('onERC721Received(address,address,uint,bytes)'))`.\\n * @dev Emit Transfer event\\n */\\n function shareKey(\\n address _to,\\n uint256 _tokenId,\\n uint256 _timeShared\\n ) external;\\n\\n /**\\n * @notice Update transfer and cancel rights for a given key\\n * @param _tokenId The id of the key to assign rights for\\n * @param _keyManager The address to assign the rights to for the given key\\n */\\n function setKeyManagerOf(uint256 _tokenId, address _keyManager) external;\\n\\n /// @notice A descriptive name for a collection of NFTs in this contract\\n function name() external view returns (string memory _name);\\n\\n ///===================================================================\\n\\n /// From ERC165.sol\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n\\n ///===================================================================\\n\\n /// From ERC-721\\n /**\\n * @dev Returns the number of NFTs in `owner`'s account.\\n */\\n function balanceOf(address _owner) public view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the NFT specified by `tokenId`.\\n */\\n function ownerOf(uint256 tokenId) public view returns (address _owner);\\n\\n /**\\n * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to\\n * another (`to`).\\n *\\n *\\n *\\n * Requirements:\\n * - `from`, `to` cannot be zero.\\n * - `tokenId` must be owned by `from`.\\n * - If the caller is not `from`, it must be have been allowed to move this\\n * NFT by either {approve} or {setApprovalForAll}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) public;\\n\\n /**\\n * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to\\n * another (`to`).\\n *\\n * Requirements:\\n * - If the caller is not `from`, it must be approved to move this NFT by\\n * either {approve} or {setApprovalForAll}.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) public;\\n\\n function approve(address to, uint256 tokenId) public;\\n\\n /**\\n * @notice Get the approved address for a single NFT\\n * @dev Throws if `_tokenId` is not a valid NFT.\\n * @param _tokenId The NFT to find the approved address for\\n * @return The approved address for this NFT, or the zero address if there is none\\n */\\n function getApproved(uint256 _tokenId)\\n public\\n view\\n returns (address operator);\\n\\n function setApprovalForAll(address operator, bool _approved) public;\\n\\n function isApprovedForAll(address _owner, address operator)\\n public\\n view\\n returns (bool);\\n\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) public;\\n\\n function totalSupply() public view returns (uint256);\\n\\n function tokenOfOwnerByIndex(address _owner, uint256 index)\\n public\\n view\\n returns (uint256 tokenId);\\n\\n function tokenByIndex(uint256 index) public view returns (uint256);\\n\\n /**\\n * @notice An ERC-20 style transfer.\\n * @param _value sends a token with _value * expirationDuration (the amount of time remaining on a standard purchase).\\n * @dev The typical use case would be to call this with _value 1, which is on par with calling `transferFrom`. If the user\\n * has more than `expirationDuration` time remaining this may use the `shareKey` function to send some but not all of the token.\\n */\\n function transfer(address _to, uint256 _value)\\n external\\n returns (bool success);\\n}\\n\"},\"/contracts/interfaces/unlock/IUnlock.sol\":{\"content\":\"pragma solidity 0.5.17;\\n\\n/**\\n * @title The Unlock Interface\\n * @author Nick Furfaro (unlock-protocol.com)\\n **/\\n\\ninterface IUnlock {\\n // Use initialize instead of a constructor to support proxies(for upgradeability via zos).\\n function initialize(address _unlockOwner) external;\\n\\n /**\\n * @dev Create lock\\n * This deploys a lock for a creator. It also keeps track of the deployed lock.\\n * @param _tokenAddress set to the ERC20 token address, or 0 for ETH.\\n * @param _salt an identifier for the Lock, which is unique for the user.\\n * This may be implemented as a sequence ID or with RNG. It's used with `create2`\\n * to know the lock's address before the transaction is mined.\\n */\\n function createLock(\\n uint256 _expirationDuration,\\n address _tokenAddress,\\n uint256 _keyPrice,\\n uint256 _maxNumberOfKeys,\\n string calldata _lockName,\\n bytes12 _salt\\n ) external returns (address);\\n\\n /**\\n * This function keeps track of the added GDP, as well as grants of discount tokens\\n * to the referrer, if applicable.\\n * The number of discount tokens granted is based on the value of the referal,\\n * the current growth rate and the lock's discount token distribution rate\\n * This function is invoked by a previously deployed lock only.\\n */\\n function recordKeyPurchase(\\n uint256 _value,\\n address _referrer // solhint-disable-line no-unused-vars\\n ) external;\\n\\n /**\\n * This function will keep track of consumed discounts by a given user.\\n * It will also grant discount tokens to the creator who is granting the discount based on the\\n * amount of discount and compensation rate.\\n * This function is invoked by a previously deployed lock only.\\n */\\n function recordConsumedDiscount(\\n uint256 _discount,\\n uint256 _tokens // solhint-disable-line no-unused-vars\\n ) external;\\n\\n /**\\n * This function returns the discount available for a user, when purchasing a\\n * a key from a lock.\\n * This does not modify the state. It returns both the discount and the number of tokens\\n * consumed to grant that discount.\\n */\\n function computeAvailableDiscountFor(\\n address _purchaser, // solhint-disable-line no-unused-vars\\n uint256 _keyPrice // solhint-disable-line no-unused-vars\\n ) external view returns (uint256 discount, uint256 tokens);\\n\\n // Function to read the globalTokenURI field.\\n function globalBaseTokenURI() external view returns (string memory);\\n\\n /**\\n * @dev Redundant with globalBaseTokenURI() for backwards compatibility with v3 & v4 locks.\\n */\\n function getGlobalBaseTokenURI() external view returns (string memory);\\n\\n // Function to read the globalTokenSymbol field.\\n function globalTokenSymbol() external view returns (string memory);\\n\\n // Function to read the chainId field.\\n function chainId() external view returns (uint256);\\n\\n /**\\n * @dev Redundant with globalTokenSymbol() for backwards compatibility with v3 & v4 locks.\\n */\\n function getGlobalTokenSymbol() external view returns (string memory);\\n\\n /**\\n * @notice Allows the owner to update configuration variables\\n */\\n function configUnlock(\\n address _udt,\\n address _weth,\\n uint256 _estimatedGasForPurchase,\\n string calldata _symbol,\\n string calldata _URI,\\n uint256 _chainId\\n ) external;\\n\\n /**\\n * @notice Upgrade the PublicLock template used for future calls to `createLock`.\\n * @dev This will initialize the template and revokeOwnership.\\n */\\n function setLockTemplate(address payable _publicLockAddress) external;\\n\\n // Allows the owner to change the value tracking variables as needed.\\n function resetTrackedValue(\\n uint256 _grossNetworkProduct,\\n uint256 _totalDiscountGranted\\n ) external;\\n\\n function grossNetworkProduct() external view returns (uint256);\\n\\n function totalDiscountGranted() external view returns (uint256);\\n\\n function locks(address)\\n external\\n view\\n returns (\\n bool deployed,\\n uint256 totalSales,\\n uint256 yieldedDiscountTokens\\n );\\n\\n // The address of the public lock template, used when `createLock` is called\\n function publicLockAddress() external view returns (address);\\n\\n // Map token address to exchange contract address if the token is supported\\n // Used for GDP calculations\\n function uniswapOracles(address) external view returns (address);\\n\\n // The WETH token address, used for value calculations\\n function weth() external view returns (address);\\n\\n // The UDT token address, used to mint tokens on referral\\n function udt() external view returns (address);\\n\\n // The approx amount of gas required to purchase a key\\n function estimatedGasForPurchase() external view returns (uint256);\\n\\n // The version number of the current Unlock implementation on this network\\n function unlockVersion() external pure returns (uint16);\\n\\n /**\\n * @notice allows the owner to set the oracle address to use for value conversions\\n * setting the _oracleAddress to address(0) removes support for the token\\n * @dev This will also call update to ensure at least one datapoint has been recorded.\\n */\\n function setOracle(address _tokenAddress, address _oracleAddress) external;\\n\\n /**\\n * @dev Returns true if the caller is the current owner.\\n */\\n function isOwner() external view returns (bool);\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() external view returns (address);\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external;\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external;\\n}\\n\"}},\"settings\":{\"remappings\":[],\"optimizer\":{\"enabled\":false,\"runs\":200},\"evmVersion\":\"istanbul\",\"libraries\":{}}}",
"codeformat": "solidity-standard-json-input",
"contractname": "/contracts/Challenger.sol:Challenger",
"compilerversion": "v0.5.17+commit.d19bba13",
"constructorArguements": "0000000000000000000000001df6a238d6af71fc5e07ed1038dc328c44e7ef11"
}
Checking status of verification request kfpzuhaae6q1qj6qd8vwq3uia4klnafhhqxilurngkafveifvw
Fail - Unable to verify
Verifying ChallengeManager
Reading artifact file at /home/sebastian/Documents/Dev/fitness-challenge/build/contracts/ChallengeManager.json
Retrieving constructor parameters from https://api-rinkeby.etherscan.io/api?apiKey=placeholder&module=account&action=txlist&address=0x1Df6a238d6AF71Fc5e07ed1038dC328c44E7ef11&page=1&sort=asc&offset=1
Constructor parameters retrieved: 0x
Sending verify request with POST arguments:
{
"apikey": "placeholder",
"module": "contract",
"action": "verifysourcecode",
"contractaddress": "0x1Df6a238d6AF71Fc5e07ed1038dC328c44E7ef11",
"sourceCode": "{\"language\":\"Solidity\",\"sources\":{\"/contracts/ChallengeManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.5.17 <0.9.0;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"./Evaluation.sol\\\";\\nimport \\\"./LockFactory.sol\\\";\\n\\ncontract ChallengeManager is LockFactory {\\n uint256 counter = 0;\\n // only for testing, used to determine which chellenge gets displayed on the frontEnd\\n uint256 displayedChallenge = 0;\\n\\n struct Challenge {\\n uint256 id;\\n address creator;\\n string title;\\n string description;\\n uint256 start;\\n uint256 end;\\n uint256 participantsCount;\\n uint256 price;\\n address first;\\n LeaderboardEntry[] leaderBoard;\\n Evaluation evaluation;\\n }\\n\\n struct LeaderboardEntry {\\n address challenger;\\n uint256 data;\\n uint256 time;\\n }\\n\\n mapping(uint256 => Challenge) public challenges;\\n\\n function setDisplayedChallengeID(uint256 id) external {\\n displayedChallenge = id;\\n }\\n\\n function getDisplayedChallengeID() public view returns (uint256) {\\n return displayedChallenge;\\n }\\n\\n function createChallenge(\\n string calldata title,\\n string calldata description,\\n uint256 start,\\n uint256 end,\\n uint256 participantsCount,\\n uint256 price,\\n address evaluationAdr\\n ) external returns (Challenge memory) {\\n createNewLock(counter, end - start, price, participantsCount);\\n\\n challenges[counter].id = counter;\\n challenges[counter].creator = msg.sender;\\n challenges[counter].title = title;\\n challenges[counter].description = description;\\n challenges[counter].start = start;\\n challenges[counter].end = end;\\n challenges[counter].participantsCount = participantsCount;\\n challenges[counter].price = price;\\n challenges[counter].evaluation = Evaluation(evaluationAdr);\\n\\n return challenges[counter++];\\n }\\n\\n function addLeaderboardEntry(\\n uint256 id,\\n address sender,\\n uint256 data,\\n uint256 time\\n ) public {\\n challenges[id].leaderBoard.push(LeaderboardEntry(sender, data, time));\\n }\\n\\n function getWinner(uint256 challengeId) public view returns (address) {\\n require(block.timestamp >= challenges[challengeId].end);\\n return challenges[challengeId].first;\\n }\\n\\n function getAllChallenges() public view returns (Challenge[] memory) {\\n Challenge[] memory array = new Challenge[](counter);\\n for (uint256 i = 0; i < array.length; i++) {\\n array[i].id = challenges[i].id;\\n array[i].creator = challenges[i].creator;\\n array[i].title = challenges[i].title;\\n array[i].description = challenges[i].description;\\n array[i].start = challenges[i].start;\\n array[i].end = challenges[i].end;\\n array[i].participantsCount = challenges[i].participantsCount;\\n array[i].price = challenges[i].price;\\n array[i].first = challenges[i].first;\\n }\\n return array;\\n }\\n}\\n\"},\"/contracts/Evaluation.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.5.17 <0.9.0;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"./ChallengeManager.sol\\\";\\n\\ninterface Evaluation {\\n function evaluate(ChallengeManager.LeaderboardEntry[] calldata entry)\\n external\\n returns (uint256 id);\\n\\n function setRules(string calldata rules) external;\\n}\\n\"},\"/contracts/LockFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.17 <0.9.0;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"./interfaces/unlock/IPublicLock.sol\\\";\\nimport \\\"./interfaces/unlock/IUnlock.sol\\\";\\n\\ncontract LockFactory {\\n IUnlock internal unlock;\\n\\n mapping(uint256 => IPublicLock) lockToId;\\n\\n constructor() public {\\n unlock = IUnlock(0xD8C88BE5e8EB88E38E6ff5cE186d764676012B0b);\\n }\\n\\n function createNewLock(\\n uint256 id,\\n uint256 duration,\\n uint256 price,\\n uint256 numberOfKeys\\n ) internal {\\n IPublicLock lock = IPublicLock(\\n address(\\n uint160(\\n unlock.createLock(\\n duration,\\n address(0),\\n price,\\n numberOfKeys,\\n \\\"foo\\\",\\n bytes12(keccak256(abi.encodePacked(id)))\\n )\\n )\\n )\\n );\\n lockToId[id] = lock;\\n }\\n\\n function getKeyPrice(uint256 id) external view returns (uint256) {\\n return lockToId[id].keyPrice();\\n }\\n\\n function updateKeyPrice(uint256 id, uint256 keyPrice) external {\\n lockToId[id].updateKeyPricing(keyPrice, address(0));\\n }\\n\\n function getLock(uint256 id) public view returns (IPublicLock) {\\n return lockToId[id];\\n }\\n}\\n\"},\"/contracts/interfaces/unlock/IPublicLock.sol\":{\"content\":\"pragma solidity 0.5.17;\\n\\n/**\\n * @title The PublicLock Interface\\n * @author Nick Furfaro (unlock-protocol.com)\\n */\\n\\ncontract IPublicLock {\\n // See indentationissue description here:\\n // https://github.com/duaraghav8/Ethlint/issues/268\\n // solium-disable indentation\\n\\n /// Functions\\n\\n function initialize(\\n address _lockCreator,\\n uint256 _expirationDuration,\\n address _tokenAddress,\\n uint256 _keyPrice,\\n uint256 _maxNumberOfKeys,\\n string calldata _lockName\\n ) external;\\n\\n /**\\n * @notice Allow the contract to accept tips in ETH sent directly to the contract.\\n * @dev This is okay to use even if the lock is priced in ERC-20 tokens\\n */\\n function() external payable;\\n\\n /**\\n * @dev Never used directly\\n */\\n function initialize() external;\\n\\n /**\\n * @notice The version number of the current implementation on this network.\\n * @return The current version number.\\n */\\n function publicLockVersion() public pure returns (uint256);\\n\\n /**\\n * @notice Gets the current balance of the account provided.\\n * @param _tokenAddress The token type to retrieve the balance of.\\n * @param _account The account to get the balance of.\\n * @return The number of tokens of the given type for the given address, possibly 0.\\n */\\n function getBalance(address _tokenAddress, address _account)\\n external\\n view\\n returns (uint256);\\n\\n /**\\n * @notice Used to disable lock before migrating keys and/or destroying contract.\\n * @dev Throws if called by other than a lock manager.\\n * @dev Throws if lock contract has already been disabled.\\n */\\n function disableLock() external;\\n\\n /**\\n * @dev Called by a lock manager or beneficiary to withdraw all funds from the lock and send them to the `beneficiary`.\\n * @dev Throws if called by other than a lock manager or beneficiary\\n * @param _tokenAddress specifies the token address to withdraw or 0 for ETH. This is usually\\n * the same as `tokenAddress` in MixinFunds.\\n * @param _amount specifies the max amount to withdraw, which may be reduced when\\n * considering the available balance. Set to 0 or MAX_UINT to withdraw everything.\\n * -- however be wary of draining funds as it breaks the `cancelAndRefund` and `expireAndRefundFor`\\n * use cases.\\n */\\n function withdraw(address _tokenAddress, uint256 _amount) external;\\n\\n /**\\n * @notice An ERC-20 style approval, allowing the spender to transfer funds directly from this lock.\\n */\\n function approveBeneficiary(address _spender, uint256 _amount)\\n external\\n returns (bool);\\n\\n /**\\n * A function which lets a Lock manager of the lock to change the price for future purchases.\\n * @dev Throws if called by other than a Lock manager\\n * @dev Throws if lock has been disabled\\n * @dev Throws if _tokenAddress is not a valid token\\n * @param _keyPrice The new price to set for keys\\n * @param _tokenAddress The address of the erc20 token to use for pricing the keys,\\n * or 0 to use ETH\\n */\\n function updateKeyPricing(uint256 _keyPrice, address _tokenAddress)\\n external;\\n\\n /**\\n * A function which lets a Lock manager update the beneficiary account,\\n * which receives funds on withdrawal.\\n * @dev Throws if called by other than a Lock manager or beneficiary\\n * @dev Throws if _beneficiary is address(0)\\n * @param _beneficiary The new address to set as the beneficiary\\n */\\n function updateBeneficiary(address _beneficiary) external;\\n\\n /**\\n * Checks if the user has a non-expired key.\\n * @param _user The address of the key owner\\n */\\n function getHasValidKey(address _user) external view returns (bool);\\n\\n /**\\n * @notice Find the tokenId for a given user\\n * @return The tokenId of the NFT, else returns 0\\n * @param _account The address of the key owner\\n */\\n function getTokenIdFor(address _account) external view returns (uint256);\\n\\n /**\\n * A function which returns a subset of the keys for this Lock as an array\\n * @param _page the page of key owners requested when faceted by page size\\n * @param _pageSize the number of Key Owners requested per page\\n * @dev Throws if there are no key owners yet\\n */\\n function getOwnersByPage(uint256 _page, uint256 _pageSize)\\n external\\n view\\n returns (address[] memory);\\n\\n /**\\n * Checks if the given address owns the given tokenId.\\n * @param _tokenId The tokenId of the key to check\\n * @param _keyOwner The potential key owners address\\n */\\n function isKeyOwner(uint256 _tokenId, address _keyOwner)\\n external\\n view\\n returns (bool);\\n\\n /**\\n * @dev Returns the key's ExpirationTimestamp field for a given owner.\\n * @param _keyOwner address of the user for whom we search the key\\n * @dev Returns 0 if the owner has never owned a key for this lock\\n */\\n function keyExpirationTimestampFor(address _keyOwner)\\n external\\n view\\n returns (uint256 timestamp);\\n\\n /**\\n * Public function which returns the total number of unique owners (both expired\\n * and valid). This may be larger than totalSupply.\\n */\\n function numberOfOwners() external view returns (uint256);\\n\\n /**\\n * Allows a Lock manager to assign a descriptive name for this Lock.\\n * @param _lockName The new name for the lock\\n * @dev Throws if called by other than a Lock manager\\n */\\n function updateLockName(string calldata _lockName) external;\\n\\n /**\\n * Allows a Lock manager to assign a Symbol for this Lock.\\n * @param _lockSymbol The new Symbol for the lock\\n * @dev Throws if called by other than a Lock manager\\n */\\n function updateLockSymbol(string calldata _lockSymbol) external;\\n\\n /**\\n * @dev Gets the token symbol\\n * @return string representing the token symbol\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * Allows a Lock manager to update the baseTokenURI for this Lock.\\n * @dev Throws if called by other than a Lock manager\\n * @param _baseTokenURI String representing the base of the URI for this lock.\\n */\\n function setBaseTokenURI(string calldata _baseTokenURI) external;\\n\\n /** @notice A distinct Uniform Resource Identifier (URI) for a given asset.\\n * @dev Throws if `_tokenId` is not a valid NFT. URIs are defined in RFC\\n * 3986. The URI may point to a JSON file that conforms to the \\\"ERC721\\n * Metadata JSON Schema\\\".\\n * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md\\n * @param _tokenId The tokenID we're inquiring about\\n * @return String representing the URI for the requested token\\n */\\n function tokenURI(uint256 _tokenId) external view returns (string memory);\\n\\n /**\\n * @notice Allows a Lock manager to add or remove an event hook\\n */\\n function setEventHooks(address _onKeyPurchaseHook, address _onKeyCancelHook)\\n external;\\n\\n /**\\n * Allows a Lock manager to give a collection of users a key with no charge.\\n * Each key may be assigned a different expiration date.\\n * @dev Throws if called by other than a Lock manager\\n * @param _recipients An array of receiving addresses\\n * @param _expirationTimestamps An array of expiration Timestamps for the keys being granted\\n */\\n function grantKeys(\\n address[] calldata _recipients,\\n uint256[] calldata _expirationTimestamps,\\n address[] calldata _keyManagers\\n ) external;\\n\\n /**\\n * @dev Purchase function\\n * @param _value the number of tokens to pay for this purchase >= the current keyPrice - any applicable discount\\n * (_value is ignored when using ETH)\\n * @param _recipient address of the recipient of the purchased key\\n * @param _referrer address of the user making the referral\\n * @param _data arbitrary data populated by the front-end which initiated the sale\\n * @dev Throws if lock is disabled. Throws if lock is sold-out. Throws if _recipient == address(0).\\n * @dev Setting _value to keyPrice exactly doubles as a security feature. That way if a Lock manager increases the\\n * price while my transaction is pending I can't be charged more than I expected (only applicable to ERC-20 when more\\n * than keyPrice is approved for spending).\\n */\\n function purchase(\\n uint256 _value,\\n address _recipient,\\n address _referrer,\\n bytes calldata _data\\n ) external payable;\\n\\n /**\\n * @notice returns the minimum price paid for a purchase with these params.\\n * @dev this considers any discount from Unlock or the OnKeyPurchase hook.\\n */\\n function purchasePriceFor(\\n address _recipient,\\n address _referrer,\\n bytes calldata _data\\n ) external view returns (uint256);\\n\\n /**\\n * Allow a Lock manager to change the transfer fee.\\n * @dev Throws if called by other than a Lock manager\\n * @param _transferFeeBasisPoints The new transfer fee in basis-points(bps).\\n * Ex: 200 bps = 2%\\n */\\n function updateTransferFee(uint256 _transferFeeBasisPoints) external;\\n\\n /**\\n * Determines how much of a fee a key owner would need to pay in order to\\n * transfer the key to another account. This is pro-rated so the fee goes down\\n * overtime.\\n * @dev Throws if _keyOwner does not have a valid key\\n * @param _keyOwner The owner of the key check the transfer fee for.\\n * @param _time The amount of time to calculate the fee for.\\n * @return The transfer fee in seconds.\\n */\\n function getTransferFee(address _keyOwner, uint256 _time)\\n external\\n view\\n returns (uint256);\\n\\n /**\\n * @dev Invoked by a Lock manager to expire the user's key and perform a refund and cancellation of the key\\n * @param _keyOwner The key owner to whom we wish to send a refund to\\n * @param amount The amount to refund the key-owner\\n * @dev Throws if called by other than a Lock manager\\n * @dev Throws if _keyOwner does not have a valid key\\n */\\n function expireAndRefundFor(address _keyOwner, uint256 amount) external;\\n\\n /**\\n * @dev allows the key manager to expire a given tokenId\\n * and send a refund to the keyOwner based on the amount of time remaining.\\n * @param _tokenId The id of the key to cancel.\\n */\\n function cancelAndRefund(uint256 _tokenId) external;\\n\\n /**\\n * @dev Cancels a key managed by a different user and sends the funds to the keyOwner.\\n * @param _keyManager the key managed by this user will be canceled\\n * @param _v _r _s getCancelAndRefundApprovalHash signed by the _keyManager\\n * @param _tokenId The key to cancel\\n */\\n function cancelAndRefundFor(\\n address _keyManager,\\n uint8 _v,\\n bytes32 _r,\\n bytes32 _s,\\n uint256 _tokenId\\n ) external;\\n\\n /**\\n * @notice Sets the minimum nonce for a valid off-chain approval message from the\\n * senders account.\\n * @dev This can be used to invalidate a previously signed message.\\n */\\n function invalidateOffchainApproval(uint256 _nextAvailableNonce) external;\\n\\n /**\\n * Allow a Lock manager to change the refund penalty.\\n * @dev Throws if called by other than a Lock manager\\n * @param _freeTrialLength The new duration of free trials for this lock\\n * @param _refundPenaltyBasisPoints The new refund penaly in basis-points(bps)\\n */\\n function updateRefundPenalty(\\n uint256 _freeTrialLength,\\n uint256 _refundPenaltyBasisPoints\\n ) external;\\n\\n /**\\n * @dev Determines how much of a refund a key owner would receive if they issued\\n * @param _keyOwner The key owner to get the refund value for.\\n * a cancelAndRefund block.timestamp.\\n * Note that due to the time required to mine a tx, the actual refund amount will be lower\\n * than what the user reads from this call.\\n */\\n function getCancelAndRefundValueFor(address _keyOwner)\\n external\\n view\\n returns (uint256 refund);\\n\\n function keyManagerToNonce(address) external view returns (uint256);\\n\\n /**\\n * @notice returns the hash to sign in order to allow another user to cancel on your behalf.\\n * @dev this can be computed in JS instead of read from the contract.\\n * @param _keyManager The key manager's address (also the message signer)\\n * @param _txSender The address cancelling cancel on behalf of the keyOwner\\n * @return approvalHash The hash to sign\\n */\\n function getCancelAndRefundApprovalHash(\\n address _keyManager,\\n address _txSender\\n ) external view returns (bytes32 approvalHash);\\n\\n function addKeyGranter(address account) external;\\n\\n function addLockManager(address account) external;\\n\\n function isKeyGranter(address account) external view returns (bool);\\n\\n function isLockManager(address account) external view returns (bool);\\n\\n function onKeyPurchaseHook() external view returns (address);\\n\\n function onKeyCancelHook() external view returns (address);\\n\\n function revokeKeyGranter(address _granter) external;\\n\\n function renounceLockManager() external;\\n\\n ///===================================================================\\n /// Auto-generated getter functions from public state variables\\n\\n function beneficiary() external view returns (address);\\n\\n function expirationDuration() external view returns (uint256);\\n\\n function freeTrialLength() external view returns (uint256);\\n\\n function isAlive() external view returns (bool);\\n\\n function keyPrice() external view returns (uint256);\\n\\n function maxNumberOfKeys() external view returns (uint256);\\n\\n function owners(uint256) external view returns (address);\\n\\n function refundPenaltyBasisPoints() external view returns (uint256);\\n\\n function tokenAddress() external view returns (address);\\n\\n function transferFeeBasisPoints() external view returns (uint256);\\n\\n function unlockProtocol() external view returns (address);\\n\\n function keyManagerOf(uint256) external view returns (address);\\n\\n ///===================================================================\\n\\n /**\\n * @notice Allows the key owner to safely share their key (parent key) by\\n * transferring a portion of the remaining time to a new key (child key).\\n * @dev Throws if key is not valid.\\n * @dev Throws if `_to` is the zero address\\n * @param _to The recipient of the shared key\\n * @param _tokenId the key to share\\n * @param _timeShared The amount of time shared\\n * checks if `_to` is a smart contract (code size > 0). If so, it calls\\n * `onERC721Received` on `_to` and throws if the return value is not\\n * `bytes4(keccak256('onERC721Received(address,address,uint,bytes)'))`.\\n * @dev Emit Transfer event\\n */\\n function shareKey(\\n address _to,\\n uint256 _tokenId,\\n uint256 _timeShared\\n ) external;\\n\\n /**\\n * @notice Update transfer and cancel rights for a given key\\n * @param _tokenId The id of the key to assign rights for\\n * @param _keyManager The address to assign the rights to for the given key\\n */\\n function setKeyManagerOf(uint256 _tokenId, address _keyManager) external;\\n\\n /// @notice A descriptive name for a collection of NFTs in this contract\\n function name() external view returns (string memory _name);\\n\\n ///===================================================================\\n\\n /// From ERC165.sol\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n\\n ///===================================================================\\n\\n /// From ERC-721\\n /**\\n * @dev Returns the number of NFTs in `owner`'s account.\\n */\\n function balanceOf(address _owner) public view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the NFT specified by `tokenId`.\\n */\\n function ownerOf(uint256 tokenId) public view returns (address _owner);\\n\\n /**\\n * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to\\n * another (`to`).\\n *\\n *\\n *\\n * Requirements:\\n * - `from`, `to` cannot be zero.\\n * - `tokenId` must be owned by `from`.\\n * - If the caller is not `from`, it must be have been allowed to move this\\n * NFT by either {approve} or {setApprovalForAll}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) public;\\n\\n /**\\n * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to\\n * another (`to`).\\n *\\n * Requirements:\\n * - If the caller is not `from`, it must be approved to move this NFT by\\n * either {approve} or {setApprovalForAll}.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 tokenId\\n ) public;\\n\\n function approve(address to, uint256 tokenId) public;\\n\\n /**\\n * @notice Get the approved address for a single NFT\\n * @dev Throws if `_tokenId` is not a valid NFT.\\n * @param _tokenId The NFT to find the approved address for\\n * @return The approved address for this NFT, or the zero address if there is none\\n */\\n function getApproved(uint256 _tokenId)\\n public\\n view\\n returns (address operator);\\n\\n function setApprovalForAll(address operator, bool _approved) public;\\n\\n function isApprovedForAll(address _owner, address operator)\\n public\\n view\\n returns (bool);\\n\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) public;\\n\\n function totalSupply() public view returns (uint256);\\n\\n function tokenOfOwnerByIndex(address _owner, uint256 index)\\n public\\n view\\n returns (uint256 tokenId);\\n\\n function tokenByIndex(uint256 index) public view returns (uint256);\\n\\n /**\\n * @notice An ERC-20 style transfer.\\n * @param _value sends a token with _value * expirationDuration (the amount of time remaining on a standard purchase).\\n * @dev The typical use case would be to call this with _value 1, which is on par with calling `transferFrom`. If the user\\n * has more than `expirationDuration` time remaining this may use the `shareKey` function to send some but not all of the token.\\n */\\n function transfer(address _to, uint256 _value)\\n external\\n returns (bool success);\\n}\\n\"},\"/contracts/interfaces/unlock/IUnlock.sol\":{\"content\":\"pragma solidity 0.5.17;\\n\\n/**\\n * @title The Unlock Interface\\n * @author Nick Furfaro (unlock-protocol.com)\\n **/\\n\\ninterface IUnlock {\\n // Use initialize instead of a constructor to support proxies(for upgradeability via zos).\\n function initialize(address _unlockOwner) external;\\n\\n /**\\n * @dev Create lock\\n * This deploys a lock for a creator. It also keeps track of the deployed lock.\\n * @param _tokenAddress set to the ERC20 token address, or 0 for ETH.\\n * @param _salt an identifier for the Lock, which is unique for the user.\\n * This may be implemented as a sequence ID or with RNG. It's used with `create2`\\n * to know the lock's address before the transaction is mined.\\n */\\n function createLock(\\n uint256 _expirationDuration,\\n address _tokenAddress,\\n uint256 _keyPrice,\\n uint256 _maxNumberOfKeys,\\n string calldata _lockName,\\n bytes12 _salt\\n ) external returns (address);\\n\\n /**\\n * This function keeps track of the added GDP, as well as grants of discount tokens\\n * to the referrer, if applicable.\\n * The number of discount tokens granted is based on the value of the referal,\\n * the current growth rate and the lock's discount token distribution rate\\n * This function is invoked by a previously deployed lock only.\\n */\\n function recordKeyPurchase(\\n uint256 _value,\\n address _referrer // solhint-disable-line no-unused-vars\\n ) external;\\n\\n /**\\n * This function will keep track of consumed discounts by a given user.\\n * It will also grant discount tokens to the creator who is granting the discount based on the\\n * amount of discount and compensation rate.\\n * This function is invoked by a previously deployed lock only.\\n */\\n function recordConsumedDiscount(\\n uint256 _discount,\\n uint256 _tokens // solhint-disable-line no-unused-vars\\n ) external;\\n\\n /**\\n * This function returns the discount available for a user, when purchasing a\\n * a key from a lock.\\n * This does not modify the state. It returns both the discount and the number of tokens\\n * consumed to grant that discount.\\n */\\n function computeAvailableDiscountFor(\\n address _purchaser, // solhint-disable-line no-unused-vars\\n uint256 _keyPrice // solhint-disable-line no-unused-vars\\n ) external view returns (uint256 discount, uint256 tokens);\\n\\n // Function to read the globalTokenURI field.\\n function globalBaseTokenURI() external view returns (string memory);\\n\\n /**\\n * @dev Redundant with globalBaseTokenURI() for backwards compatibility with v3 & v4 locks.\\n */\\n function getGlobalBaseTokenURI() external view returns (string memory);\\n\\n // Function to read the globalTokenSymbol field.\\n function globalTokenSymbol() external view returns (string memory);\\n\\n // Function to read the chainId field.\\n function chainId() external view returns (uint256);\\n\\n /**\\n * @dev Redundant with globalTokenSymbol() for backwards compatibility with v3 & v4 locks.\\n */\\n function getGlobalTokenSymbol() external view returns (string memory);\\n\\n /**\\n * @notice Allows the owner to update configuration variables\\n */\\n function configUnlock(\\n address _udt,\\n address _weth,\\n uint256 _estimatedGasForPurchase,\\n string calldata _symbol,\\n string calldata _URI,\\n uint256 _chainId\\n ) external;\\n\\n /**\\n * @notice Upgrade the PublicLock template used for future calls to `createLock`.\\n * @dev This will initialize the template and revokeOwnership.\\n */\\n function setLockTemplate(address payable _publicLockAddress) external;\\n\\n // Allows the owner to change the value tracking variables as needed.\\n function resetTrackedValue(\\n uint256 _grossNetworkProduct,\\n uint256 _totalDiscountGranted\\n ) external;\\n\\n function grossNetworkProduct() external view returns (uint256);\\n\\n function totalDiscountGranted() external view returns (uint256);\\n\\n function locks(address)\\n external\\n view\\n returns (\\n bool deployed,\\n uint256 totalSales,\\n uint256 yieldedDiscountTokens\\n );\\n\\n // The address of the public lock template, used when `createLock` is called\\n function publicLockAddress() external view returns (address);\\n\\n // Map token address to exchange contract address if the token is supported\\n // Used for GDP calculations\\n function uniswapOracles(address) external view returns (address);\\n\\n // The WETH token address, used for value calculations\\n function weth() external view returns (address);\\n\\n // The UDT token address, used to mint tokens on referral\\n function udt() external view returns (address);\\n\\n // The approx amount of gas required to purchase a key\\n function estimatedGasForPurchase() external view returns (uint256);\\n\\n // The version number of the current Unlock implementation on this network\\n function unlockVersion() external pure returns (uint16);\\n\\n /**\\n * @notice allows the owner to set the oracle address to use for value conversions\\n * setting the _oracleAddress to address(0) removes support for the token\\n * @dev This will also call update to ensure at least one datapoint has been recorded.\\n */\\n function setOracle(address _tokenAddress, address _oracleAddress) external;\\n\\n /**\\n * @dev Returns true if the caller is the current owner.\\n */\\n function isOwner() external view returns (bool);\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() external view returns (address);\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() external;\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) external;\\n}\\n\"}},\"settings\":{\"remappings\":[],\"optimizer\":{\"enabled\":false,\"runs\":200},\"evmVersion\":\"istanbul\",\"libraries\":{}}}",
"codeformat": "solidity-standard-json-input",
"contractname": "/contracts/ChallengeManager.sol:ChallengeManager",
"compilerversion": "v0.5.17+commit.d19bba13",
"constructorArguements": ""
}
Contract source code already verified: https://rinkeby.etherscan.io/address/0x1Df6a238d6AF71Fc5e07ed1038dC328c44E7ef11#contracts
Failed to verify 1 contract(s): Challenger
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Error when trying to verify contract - Ethereum Stack Exchange
I got this error too and this worked: Delete artifacts and cache folders; run npx hardhat compile; then verify.
Read more >Error Verifying smart contract on EtherScan using Hardhat
When i try and verify it to submit the code to Etherscan I am getting the error below and I really don't know...
Read more >Unable to verify contracts with "import", and temporary solution
I have problems deployed to testnet such as polygon mumbai. No problem if the contract does not import others libraries/contracts.
Read more >Error verifying contract on FTMScan - OpenZeppelin Forum
Hello,. I'm using Hardhat + hardhat-etherscan and trying to verify the contract on FTMScan. My Hardhat config looks like this:
Read more >Contract Troubleshooting - Unable to Verify Contract Source
Contract Troubleshooting - Unable to Verify Contract Source · Copy and paste your contract source code while selecting the same options that you ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I tried it on the kovan network too. It’s still not working. Don’t know what to do.
Very strange. We’ll chalk it up to some oddity with an older version of Solidity. Happy you were able to resolve it in any case.