These are chat archives for Nethereum/Nethereum

16th
Jan 2018
Juan Blanco
@juanfranblanco
Jan 16 2018 09:22
@ttichy Quick Sample
 var filterInput=  eventX.CreateFilterInput(new object[]{"address"}, new BlockParameter(1000), new BlockParameter(1500));

  eventX.GetAllChanges<EventObject>(filterInput);
Art1987
@Art1987
Jan 16 2018 11:33
Hi guys , I have successfully deployed and signed multi sig smart , but however money did not transfer. FYI, following code returns true
destination.call.value(value)(data)
any thoughts?
@juanfranblanco do you have any idea? also, multisig contract wallet has 1 ether balance
Juan Blanco
@juanfranblanco
Jan 16 2018 11:34
ah that was my thought you have not funded the contract
well done btw ;)
Art1987
@Art1987
Jan 16 2018 11:34
:D
whenever I successfully finish transfer I am going to share it - how to sign multisig contract and make transfer
Juan Blanco
@juanfranblanco
Jan 16 2018 11:36
nice :) but i think there is a need to have hands on knowledge of what is happening
Art1987
@Art1987
Jan 16 2018 11:37
agree
so, do you have any idea why transfer is not working?
Juan Blanco
@juanfranblanco
Jan 16 2018 11:38
if not you are in the risk of getting locked out of funds
let me check
Art1987
@Art1987
Jan 16 2018 11:38
thx
Juan Blanco
@juanfranblanco
Jan 16 2018 11:44
if you are transfering to an address
probably better to do something like
destination.send(value)
Art1987
@Art1987
Jan 16 2018 11:44
I have tried, it does not work, also, I have tried transfer as well, but let me check again
Juan Blanco
@juanfranblanco
Jan 16 2018 11:49
oh i have just realised
you have not funded the contract
you need a payeable function to send funds to the contract
and then you can send amounts
Juan Blanco
@juanfranblanco
Jan 16 2018 11:51
ah yes you have ether
Art1987
@Art1987
Jan 16 2018 11:51
please check smart contract code's 47 line which is function () payable {}
Juan Blanco
@juanfranblanco
Jan 16 2018 11:52
i think you posted christians
not yours
Art1987
@Art1987
Jan 16 2018 11:53
mine is similar, mine returns result of destination.call.value(value)(data)
which is true
Juan Blanco
@juanfranblanco
Jan 16 2018 11:53
ok
but mainly i could not see the payeable ;)
so have you after funding do the multisignature
Art1987
@Art1987
Jan 16 2018 11:54
I can directly post solidity code here if it can help
yes
Juan Blanco
@juanfranblanco
Jan 16 2018 11:55
sure
Art1987
@Art1987
Jan 16 2018 11:55
contract MultiSigSafe {

    // INITIALIZING OWNERS
    address constant public owner0 = 0x317F0f72beD926cE138665F3952194e1167c2492;
    address constant public owner1 = 0x36052Ac5f3b8528cD6245C28ba4A159e314a0721;
    address constant public owner2 = 0x3a939dA853145dca1a08de0599d58C079E6110A0;

    // INITIALIZING GLOBAL PUBLIC VARIABLES
    uint8 constant public threshold = 2;            // Number of valid signatures for executing Tx
    uint256 constant public limit = 1000*10**18;    // Limit of one Tx; modify at deploy time if needed
    uint256 public nonce;                           // to prevent multiple Tx executions

    function execute(uint8[] sigV, bytes32[] sigR, bytes32[] sigS, address destination, uint256 value, bytes data) 
    public 
    returns (bool)  
    {

        // VALIDATE INPUTS
        require(value <= limit);                    // check value below limits
        require(sigV.length == 3 && sigR.length == 3 && sigS.length == 3);

        // VERIFYING OWNERS
        // Follows ERC191 signature scheme: https://github.com/ethereum/EIPs/issues/191
        // calculate hash
        bytes32 txHash = keccak256(byte(0x19), byte(0), this, destination, value, data, nonce);

        // count recovered if signature of owner0 is valid         
        uint8 recovered = 0;
        if (owner0 == ecrecover(txHash, sigV[0], sigR[0], sigS[0])) 
            recovered = recovered + 1; 
        if (owner1 == ecrecover(txHash, sigV[1], sigR[1], sigS[1])) 
            recovered = recovered + 1;
        if (owner2 == ecrecover(txHash, sigV[2], sigR[2], sigS[2])) 
            recovered = recovered + 1;


        // VALIDATE CONFIGURATION
        require(recovered >= threshold);            // validate configuration

        // NONCE
        nonce = nonce + 1;                          // count nonce to avoid multiple Tx executions

        //return recovered;
        // SENDING Tx
        //require(destination.call.value(value)(data));  // send Tx, throws if not successfull

        return destination.send(value);

    }

    function recoverWithPrefix(bytes32 hash, uint8 v, bytes32 r, bytes32 s) constant returns(address) {

        bytes memory prefix = "\x19Ethereum Signed Message:\n32";
        bytes32 prefixedHash = keccak256(prefix, hash);
        return ecrecover(prefixedHash, v, r, s);
    }
    function () public payable {}     
}
I have called execute method
this one also returns true, but it does not transfer money
Juan Blanco
@juanfranblanco
Jan 16 2018 11:58
returns true?
are you sending a transaction?
or it is your way to check the call
Art1987
@Art1987
Jan 16 2018 11:59
I just sign and call execute method
Juan Blanco
@juanfranblanco
Jan 16 2018 11:59
not a transaction
SendTransaction
Art1987
@Art1987
Jan 16 2018 11:59
I should call sendTransaction after signing and calling execute
did I get you right?
Juan Blanco
@juanfranblanco
Jan 16 2018 12:00
you send a transaction instead of doing a call
so you will have something like
var functionExectute = contract.GetFunction("execute")
functionExecute.SendTransactionAndWaitForReceiptAsync(params)
Art1987
@Art1987
Jan 16 2018 12:01
sure, let me try
Art1987
@Art1987
Jan 16 2018 12:14
works, I did not that I should use it
thanks a lot
Juan Blanco
@juanfranblanco
Jan 16 2018 12:14
cool :)
i was refreshing ropsten
Art1987
@Art1987
Jan 16 2018 12:19
I will clear my code and smart contract and will share with you
Juan Blanco
@juanfranblanco
Jan 16 2018 13:49
:) :+1: