uport.org.md
1 ### Format 2 ``` 3 { 4 uint8 sigV, 5 bytes32 sigR, 6 bytes32 sigS, 7 address destination, 8 bytes data, 9 address listOwner 10 } 11 ``` 12 13 ### Rx 14 ``` 15 { 16 Coming Soon 17 } 18 ``` 19 20 ### Tx 21 ``` 22 { 23 // only allow senders from the whitelist specified by the user, 24 // 0x0 means no whitelist. 25 require(listOwner == 0x0 || whitelist[listOwner][msg.sender]); 26 27 address claimedSender = getAddress(data); 28 // use EIP 191 29 // 0x19 :: version :: relay :: whitelistOwner :: nonce :: destination :: data 30 bytes32 h = keccak256(byte(0x19), byte(0), this, listOwner, nonce[claimedSender], destination, data); 31 address addressFromSig = ecrecover(h, sigV, sigR, sigS); 32 33 require(claimedSender == addressFromSig); 34 35 nonce[claimedSender]++; //if we are going to do tx, update nonce 36 37 require(destination.call(data)); 38 } 39 ```