Skip to content
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

Merged
merged 12 commits into from
Sep 5, 2019

Conversation

ayrat555
Copy link
Contributor

@ayrat555 ayrat555 commented Aug 16, 2019

resolves #2575

Motivation

img

Changelog

  • add verification submission comment

@coveralls
Copy link

coveralls commented Aug 16, 2019

Pull Request Test Coverage Report for Build 1ad0234c-aadd-42a8-b27d-1c19a3fd5308

  • 1 of 25 (4.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 78.362%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/explorer/lib/explorer/chain.ex 0 8 0.0%
apps/explorer/lib/explorer/chain/smart_contract.ex 0 16 0.0%
Totals Coverage Status
Change from base Build c4335717-4c12-4c44-923d-4543a849ca4c: -0.3%
Covered Lines: 5146
Relevant Lines: 6567

💛 - Coveralls

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@vbaranov vbaranov left a 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?

@ayrat555
Copy link
Contributor Author

@vbaranov we don't save the comment to the DB so the contract will have only one comment

@vbaranov
Copy link
Member

@ayrat555 user can copy source code from another verified contract in Blockscout. In this case there will be doubled submission comments. Isn’t it?

@ayrat555
Copy link
Contributor Author

ayrat555 commented Sep 2, 2019

@vbaranov vbaranov self-requested a review September 3, 2019 09:42
Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ayrat555

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

@ayrat555
Copy link
Contributor Author

ayrat555 commented Sep 3, 2019

@vbaranov I fixed it

@vbaranov
Copy link
Member

vbaranov commented Sep 5, 2019

@vbaranov I fixed it

@ayrat555 it still causes internal server error. You can check with the address I previously posted. Please check logs of stg application.

@ayrat555
Copy link
Contributor Author

ayrat555 commented Sep 5, 2019

@vbaranov It loads successfully with staging-mainnet-stg branch
img

@vbaranov vbaranov self-requested a review September 5, 2019 16:00
@vbaranov vbaranov merged commit e3987aa into master Sep 5, 2019
@vbaranov vbaranov deleted the ab-add-verification-submission-comment branch September 5, 2019 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a comment with verification timestamp to verified smart contracts
5 participants