-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add verification submission comment #2588
Conversation
Pull Request Test Coverage Report for Build 1ad0234c-aadd-42a8-b27d-1c19a3fd5308
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ayrat555 does the feature check that submission comment was not added previously?
@vbaranov we don't save the comment to the DB so the contract will have only one comment |
@ayrat555 user can copy source code from another verified contract in Blockscout. In this case there will be doubled submission comments. Isn’t it? |
@vbaranov I added handling of all 4 cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check on stg all cases.
/address/0xb4bba71e32c3628f0896639da4c5364519a8ca08/contracts
Internal server error
** (exit) an exception was raised:
** (FunctionClauseError) no function clause matching in List.replace_at/3
(elixir) lib/list.ex:637: List.replace_at(["/**\r", " *Submitted for verification at Etherscan.io on 2017-10-17\r", "*/\r", "\r", "pragma solidity ^0.4.11;\r", "/**\r", " * @title ERC20Basic\r", " * @dev Simpler version of ERC20 interface\r", " * @dev see https://github.com/ethereum/EIPs/issues/179\r", " */\r", "contract ERC20Basic {\r", " uint256 public totalSupply;\r", " function balanceOf(address who) public constant returns (uint256);\r", " function transfer(address to, uint256 value) public returns (bool);\r", " event Transfer(address indexed from, address indexed to, uint256 value);\r", "}\r", "/**\r", " * @title Ownable\r", " * @dev The Ownable contract has an owner address, and provides basic authorization control\r", " * functions, this simplifies the implementation of \"user permissions\".\r", " */\r", "contract Ownable {\r", " address public owner;\r", " event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r", " /**\r", " * @dev The Ownable constructor sets the original `owner` of the contract to the sender\r", " * account.\r", " */\r", " function Ownable() {\r", " owner = msg.sender;\r", " }\r", " /**\r", " * @dev Throws if called by any account other than the owner.\r", " */\r", " modifier onlyOwner() {\r", " require(msg.sender == owner);\r", " _;\r", " }\r", " /**\r", " * @dev Allows the current owner to transfer control of the contract to a newOwner.\r", " * @param newOwner The address to transfer ownership to.\r", " */\r", " function transferOwnership(address newOwner) onlyOwner public {\r", " require(newOwner != address(0));\r", " OwnershipTransferred(owner, newOwner);\r", " owner = newOwner;\r", " }\r", "}\r", "/**\r", " * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net\r", ...], " *Submitted for verification at Etherscan.io on 2017-10-17\r", "* Submitted for verification at blockscout.com on 2019-07-09 11:45:55.418058Z")
(block_scout_web) lib/block_scout_web/views/address_contract_view.ex:70: BlockScoutWeb.AddressContractView.contract_lines_with_index/2
(block_scout_web) lib/block_scout_web/templates/address_contract/index.html.eex:69: BlockScoutWeb.AddressContractView."index.html"/1
(block_scout_web) lib/block_scout_web/templates/layout/app.html.eex:50: BlockScoutWeb.LayoutView."app.html"/1
(phoenix) lib/phoenix/view.ex:399: Phoenix.View.render_to_iodata/3
(phoenix) lib/phoenix/controller.ex:729: Phoenix.Controller.__put_render__/5
(block_scout_web) lib/block_scout_web/endpoint.ex:1: BlockScoutWeb.Endpoint.instrument/4
(phoenix) lib/phoenix/controller.ex:746: Phoenix.Controller.instrument_render_and_send/4
@vbaranov I fixed it |
@vbaranov It loads successfully with |
resolves #2575
Motivation
Changelog