Skip to content

EXECUTE CONTRACT button disabled #22

Open

Description

@arsen3d

screen shot 2018-10-27 at 12 22 14 pm

Activity

  1. davedispatch commented on Nov 12, 2018

    @davedispatch
    Contributor

    I'm unable to replicate this issue. Could you please provide replication steps, if possible?

  2. arsen3d commented on Nov 13, 2018

    @arsen3d
    Author

    It may have to do with older version of solidity. 0.4.19 specifically
    Try it with this contract

    pragma solidity 0.4.19;
    
    
    contract TrademarkRegistration {
        struct TradeMark {
            string phrase;
            string authorName;
            uint256 timestamp;
            bytes32 proof;
        }
    
        mapping (bytes32 => bool) private trademarkLookup;
        mapping (bytes32 => TradeMark) public trademarkRegistry;
        
        function checkTradeMark(string phrase) constant returns (bool) {
            bytes32 proof = phraseProof(phrase);
            return trademarkLookup[proof];
        }
    
        function registerTradeMark(string document, string author) returns (bool){
            if (checkTradeMark(document) == false) {
                bytes32 proofHash = phraseProof(document);
                TradeMark memory trademark = TradeMark({
                    phrase: document,
                    authorName: author,
                    timestamp: now,
                    proof: proofHash
                });
                trademarkLookup[proofHash] = true;
                trademarkRegistry[proofHash] = trademark;
                return true;
            }
            return false;
        }
    
        function phraseProof(string phrase) constant returns (bytes32) {
            return sha256(phrase);
        }
    
        function getTradeMarkData(string phrase) 
            constant returns 
            (string document, 
             string authorName, 
             uint256 timestamp, 
             bytes32 proof) {
            TradeMark memory t = trademarkRegistry[phraseProof(phrase)];
            return (t.phrase, t.authorName, t.timestamp, t.proof);
        }
    }
    
  3. ZaneWithSpoon commented on Dec 18, 2018

    @ZaneWithSpoon
    Member

    The issue is replicable on methods that require a parameter. I'm working on a fix today!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions