UNPKG

@gnosis.pm/conditional-tokens-market-makers

Version:
1 lines 3.37 kB
{"contractName":"SignedSafeMath","abi":[],"metadata":"{\"compiler\":{\"version\":\"0.5.10+commit.5a6ea5b1\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Math operations with safety checks that throw on error\",\"methods\":{},\"title\":\"SignedSafeMath\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"@gnosis.pm/util-contracts/contracts/SignedSafeMath.sol\":\"SignedSafeMath\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/util-contracts/contracts/SignedSafeMath.sol\":{\"keccak256\":\"0xf96e8d30ae216bdded12e0330bd43258ff91d7f2e197ba51cd0bebe662b2abbb\",\"urls\":[\"bzzr://7693c86096ea689f6cf2a2a5a5e7247e1bb7bc3d6573e1d3044a94f6c8082544\",\"dweb:/ipfs/QmbDxe1eTT69qjLHwYWhxUU9nnE7ACZHLbWJCW8unoP7ET\"]}},\"version\":1}","bytecode":"0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723058204fbf1d27ddb02fc018e0f2fdeebc30f2ecf19a9a226cdeba090d0ba0a1eab60c64736f6c634300050a0032","deployedBytecode":"0x73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723058204fbf1d27ddb02fc018e0f2fdeebc30f2ecf19a9a226cdeba090d0ba0a1eab60c64736f6c634300050a0032","sourceMap":"131:1343:18:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24","deployedSourceMap":"131:1343:18:-;;;;;;;;","source":"pragma solidity >=0.4.24 ^0.5.1;\n\n\n/**\n * @title SignedSafeMath\n * @dev Math operations with safety checks that throw on error\n */\nlibrary SignedSafeMath {\n int256 constant INT256_MIN = int256((uint256(1) << 255));\n\n /**\n * @dev Multiplies two signed integers, throws on overflow.\n */\n function mul(int256 a, int256 b) internal pure returns (int256 c) {\n // Gas optimization: this is cheaper than asserting 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n c = a * b;\n assert((a != -1 || b != INT256_MIN) && c / a == b);\n }\n\n /**\n * @dev Integer division of two signed integers, truncating the quotient.\n */\n function div(int256 a, int256 b) internal pure returns (int256) {\n // assert(b != 0); // Solidity automatically throws when dividing by 0\n // Overflow only happens when the smallest negative int is multiplied by -1.\n assert(a != INT256_MIN || b != -1);\n return a / b;\n }\n\n /**\n * @dev Subtracts two signed integers, throws on overflow.\n */\n function sub(int256 a, int256 b) internal pure returns (int256 c) {\n c = a - b;\n assert((b >= 0 && c <= a) || (b < 0 && c > a));\n }\n\n /**\n * @dev Adds two signed integers, throws on overflow.\n */\n function add(int256 a, int256 b) internal pure returns (int256 c) {\n c = a + b;\n assert((b >= 0 && c >= a) || (b < 0 && c < a));\n }\n}","compiler":{"name":"solc","version":"0.5.10+commit.5a6ea5b1.Emscripten.clang"},"networks":{},"schemaVersion":"3.0.16","updatedAt":"2020-03-16T19:03:53.192Z","devdoc":{"details":"Math operations with safety checks that throw on error","methods":{},"title":"SignedSafeMath"},"userdoc":{"methods":{}}}