Skip to content

Instantly share code, notes, and snippets.

@nikitaeverywhere
Last active May 4, 2018 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikitaeverywhere/a93a339c04ee87fb665ba1217e8af6ee to your computer and use it in GitHub Desktop.
Save nikitaeverywhere/a93a339c04ee87fb665ba1217e8af6ee to your computer and use it in GitHub Desktop.
Can't be verified at Etherscan https://ropsten.etherscan.io/address/0x746612a6d4dcadbff55619bedeba403c0c252361#code (optimization with runs = 200 were used, both in Truffle 0.4.23 and remix with compiler version 0.4.23+commit.124ca40d.Emscripten.clang). [SOLVED] https://ethereum.stackexchange.com/a/47572/22038
pragma solidity 0.4.23;
contract TEST {
string public someVal;
string public someVal2;
bytes32 public signature1 = keccak256(
"address TEST TEST TEST TEST",
"address TEST TEST TEST TEST TEST TEST",
"address TEST TEST TEST TEST TEST TEST",
"uint256 TEST TEST TEST TEST TEST TEST TEST TEST",
"bytes TEST TEST TEST TEST",
"uint256 TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST",
"uint256 TEST TEST TEST TEST TEST TEST TEST TEST"
);
bytes32 public signature2 = keccak256(
"address TEST TEST TEST TEST",
"address TEST TEST TEST TEST TEST TEST",
"address TEST TEST TEST TEST TEST TEST",
"uint256 TEST TEST TEST TEST TEST TEST TEST TEST",
"bytes TEST TEST TEST TEST",
"uint256 TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST",
"uint256 TEST TEST TEST TEST TEST TEST TEST TEST"
);
bytes32 public signature3 = keccak256(
"address TEST TEST TEST TEST",
"address TEST TEST TEST TEST TEST TEST",
"address TEST TEST TEST TEST TEST TEST",
"uint256 TEST TEST TEST TEST TEST TEST TEST TEST",
"bytes TEST TEST TEST TEST",
"uint256 TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST",
"uint256 TEST TEST TEST TEST TEST TEST TEST TEST",
"uint256 TEST TEST TEST TEST"
);
constructor (string val, string val2) public {
someVal = val;
someVal2 = val2;
}
}
@nikitaeverywhere
Copy link
Author

nikitaeverywhere commented May 4, 2018

You can try to compile and deploy this contract to the network with optimization enabled (runs = 200). Etherscan's Verify Contract Code (version 2.0) doesn't help either.

Some of my attempts (from many!) (constructor arguments used: "Duck", "DUCK"):
https://ropsten.etherscan.io/tx/0x85a957707459abe7e69f6ea9e9fbc75a5b7ea478bab00393de9c784c685a0fa4
https://ropsten.etherscan.io/tx/0x9872d74f6bd67a28adbc6408e55ecd528d85622c1ea6e1f3d5c1f4cf348d0a66

While this slightly different code is verified successfully (with optimization enabled):
https://ropsten.etherscan.io/address/0x9ab757e10c3a32cbdcbf67e083f65213f3f91804#code

pragma solidity ^0.4.23;

contract TEST {

    string public someVal;
    string public someVal2;

    bytes32 public sigDestinationTransfer = keccak256(
        "address Token Contract Address",
        "address Sender's Address",
        "address Recipient's Address",
        "uint256 Amount to Transfer (last six digits are decimals)",
        "uint256 Fee in Tokens Paid to Executor (last six digits are decimals)",
        "uint256 Signature Expiration Timestamp (unix timestamp)",
        "uint256 Signature ID"
    ); // `transferViaSignature`: keccak256(address(this), from, to, value, fee, deadline, sigId)
    bytes32 public sigDestinationTransferFrom = keccak256(
        "address Token Contract Address",
        "address Address Approved for Withdraw",
        "address Account to Withdraw From",
        "address Withdrawal Recipient Address",
        "uint256 Amount to Transfer (last six digits are decimals)",
        "uint256 Fee in Tokens Paid to Executor (last six digits are decimals)",
        "uint256 Signature Expiration Timestamp (unix timestamp)",
        "uint256 Signature ID"
    ); // `transferFromViaSignature`: keccak256(address(this), signer, from, to, value, fee, deadline, sigId)
    bytes32 public sigDestinationApprove = keccak256(
        "address Token Contract Address",
        "address Withdrawal Approval Address",
        "address Withdrawal Recipient Address",
        "uint256 Amount to Transfer (last six digits are decimals)",
        "uint256 Fee in Tokens Paid to Executor (last six digits are decimals)",
        "uint256 Signature Expiration Timestamp (unix timestamp)",
        "uint256 Signature ID"
    ); // `approveViaSignature`: keccak256(address(this), from, spender, value, fee, deadline, sigId)

    constructor (string val, string val2) public {
        someVal = val;
        someVal2 = val2;
    }

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment