Back to HomePart of The Piper Merriam CollectionDeployer Piper Merriam(0xd3cda9...293601) Deployment Block 2,634,539 Deployment Date Nov 16, 2016, 12:42 AM Code Size 522.0 B
Contract 0x9e475f8b49be...fc9bfdbcf505
Deployed November 16, 2016 (9 years ago)Block 2,634,539
This contract is not yet documented
Know something about this contract? Switch to the History tab and suggest an edit to help preserve Ethereum history.
Tangerine Whistle EraVerified Source
Key Facts
Tangerine Whistle Era
Emergency fork to address DoS attacks. Repriced IO-heavy opcodes.
Block span: 2,463,000 — 2,674,999
October 18, 2016 — November 22, 2016
Bytecode Overview
Opcodes522
Unique Opcodes71
Jump Instructions24
Storage Operations7
Verified Source Available
This contract has verified source code on Etherscan.
Show source code (Solidity)
{
"language": "Solidity",
"sources": {
"ECVerifyLib.sol": {
"content": "pragma solidity ^0.4.0;\r\n\r\n\r\nlibrary ECVerifyLib {\r\n // From: https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d\r\n // Duplicate Solidity's ecrecover, but catching the CALL return value\r\n function safer_ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal returns (bool, address) {\r\n // We do our own memory management here. Solidity uses memory offset\r\n // 0x40 to store the current end of memory. We write past it (as\r\n // writes are memory extensions), but don't update the offset so\r\n // Solidity will reuse it. The memory used here is only needed for\r\n // this context.\r\n\r\n // FIXME: inline assembly can't access return values\r\n bool ret;\r\n address addr;\r\n\r\n assembly {\r\n let size := mload(0x40)\r\n mstore(size, hash)\r\n mstore(add(size, 32), v)\r\n mstore(add(size, 64), r)\r\n mstore(add(size, 96), s)\r\n\r\n // NOTE: we can reuse the request memory because we deal with\r\n // the return code\r\n ret := call(3000, 1, 0, size, 128, size, 32)\r\n addr := mload(size)\r\n }\r\n\r\n return (ret, addr);\r\n }\r\n\r\n function ecrecovery(bytes32 hash, bytes sig) returns (bool, address) {\r\n bytes32 r;\r\n bytes32 s;\r\n uint8 v;\r\n\r\n if (sig.length != 65)\r\n return (false, 0);\r\n\r\n // The signature format is a compact form of:\r\n // {bytes32 r}{bytes32 s}{uint8 v}\r\n // Compact means, uint8 is not padded to 32 bytes.\r\n assembly {\r\n r := mload(add(sig, 32))\r\n s := mload(add(sig, 64))\r\n\r\n // Here we are loading the last 32 bytes. We exploit the fact that\r\n // 'mload' will pad with zeroes if we overread.\r\n // There is no 'mload8' to do this, but that would be nicer.\r\n v := byte(0, mload(add(sig, 96)))\r\n\r\n // Alternative solution:\r\n // 'byte' is not working due to the Solidity parser, so lets\r\n // use the second best option, 'and'\r\n // v := and(mload(add(sig, 65)), 255)\r\n }\r\n\r\n // albeit non-transactional signatures are not specified by the YP, one would expect it\r\n // to match the YP range of [27, 28]\r\n //\r\n // geth uses [0, 1] and some clients have followed. This might change, see:\r\n // https://github.com/ethereum/go-ethereum/issues/2053\r\n if (v < 27)\r\n v += 27;\r\n\r\n if (v != 27 && v != 28)\r\n return (false, 0);\r\n\r\n return safer_ecrecover(hash, v, r, s);\r\n }\r\n\r\n function ecverify(bytes32 hash, bytes sig, address signer) returns (bool) {\r\n bool ret;\r\n address addr;\r\n (ret, addr) = ecrecovery(hash, sig);\r\n return ret == true && addr == signer;\r\n }\r\n}"
}
},
"settings": {
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"compilationTarget": {
"ECVerifyLib.sol": "ECVerifyLib"
}
}
}