Latest Blog Post
Latest Ethereum News
- Web3 Design Principles – A framework of UX rules for Blockchain based Distributed Applications (part 1) 1 Apr
- Contract Storage and Upgrade in Augur and Colony 1 Apr
- The State of Ethereum Scaling, March 2018 1 Apr
- ScalingNOW! — Scaling Solution Summit Summary 1 Apr
- All videos from EthCC ’18 in Paris 1 Apr
Latest Other News
- Keep an Eye on Hangzhou: A Growing Hub for Blockchain Development 2 May
- Blockchain Lets This Startup Trade Gold That’s Still in the Ground 28 Apr
- Why All Central Banks’ E-Currencies Will Fail Horribly 28 Apr
- Bitmain Can Remotely Shut Down Your Antminer (and Everyone Else’s) 27 Apr
- The Ether Review #63 — Meet DAD, the Digital Aussie Dollar 27 Apr
Tags
- Anonymity
- Anti-Money Laundering
- Attack
- Bitcoin
- Blockchain
- Central Bank
- Consortium
- Crowdfunding
- Cryptocurrency
- Decentralisation
- Digital Currency
- Distributed Ledger
- Energy
- Enterprise
- Ethereum
- Ethereum Classic
- Exchange
- Financial Instruments
- Financial Services
- Fintech
- Golem
- Hack
- Hard Fork
- Hyperledger
- Identity
- Initial Coin Offering
- Insurance
- Internet-of-Things
- Know-Your-Client
- Monero
- Payments
- Peer-to-peer
- Physical Assets
- Privacy
- Regulation
- Scalability
- Security
- Settlements
- Smart Contract
- Source Code
- Synereo
- The DAO
- Tokens
- Wallet
- Zcash
Archives
- September 2018 (2)
- August 2018 (1)
- July 2018 (1)
- June 2018 (1)
- May 2018 (3)
- April 2018 (7)
- March 2018 (1)
- January 2018 (1)
- December 2017 (3)
- November 2017 (9)
- October 2017 (9)
- September 2017 (5)
- August 2017 (7)
- July 2017 (8)
- June 2017 (15)
- May 2017 (27)
- April 2017 (55)
- March 2017 (94)
- February 2017 (131)
- January 2017 (167)
- December 2016 (129)
- November 2016 (179)
- October 2016 (266)
- September 2016 (309)
- August 2016 (156)
- July 2016 (4)
- June 2016 (9)
- May 2016 (11)
- April 2016 (63)
Meta
Tag Archives: Source Code
BokkyPooBah’s Gas-Efficient Solidity DateTime Library v1.00 Released
GitHub BokkyPooBah’s Solidity Gas-Efficient DateTime Library. Medium article BokkyPooBah’s Gas-Efficient Solidity DateTime Library.
A Quick Look At Parity’s Token Registry Smart Contract
Created Mar 14 2017, last updated Mar 31 2018. Address: 0x5F0281910Af44bFb5fC7e86A404d0304B0e042F1
A Quick Look At Parity’s Signature Registry Contract
Created Mar 14 2017, last updated Aug 1 2017. Address: 0x44691B39d1a75dC4E0A0346CBB15E310e6ED1E86
20 ETH (And More) Bug Bounty On The ConsenSys Multisig
Update Sep 22 2017 – Remove WhitelistedMultisig from this bug bounty as it is not being used There was a vulnerability that allowed hackers to steal USD 30 million from the Parity multisig wallets last week. I work with clients … Continue reading
Posted in Blog
Tagged Bug Bounty, Ethereum, Security Audit, Smart Contract, Source Code
Leave a comment
Development, Testing And Security Audit Of The CustomerDepositFactory Smart Contract
See Customer Deposit Factory and Security Audit Of The CustomerDepositFactory Smart Contract.
BetterAuction Smart Contract – Testing, Security Audit, And Assisting With The Development
See BetterAuction and Security Audit Of The BetterAuction Smart Contract.
The Sikoba Presale Smart Contract Security Audit
(Created Mar 08 2017. Updated with test results Mar 14 2017. Updated with multisig wallet contribution test results Mar 23 2017.) I was asked to review the Sikoba presale smart contracts before the upcoming Sikoba presale crowdfunding event. This page … Continue reading
The Incent Coffee Token Smart Contract Security Audit
The Incent Coffee smart contract is currently being used to test out the Waves <-> Ethereum block swapper at https://blockswap.incentloyalty.com/. A version of the contract has been deployed to 0x2c875e5ea4706b1978a41b59edf2d3af31d60e70. This contract was written by Bok Consulting Pty Ltd in … Continue reading
A Quick Look At Melonport’s ICO Contract
Melonport ICO is over after 13 minutes and 17 seconds as the funding goal of 227,000 ETH was reached. Note that MLN tokens are ERC20-compliant but cannot be transferred before endTime = 1489575600 or Mar 15 2017 @ 11:00am (UTC), … Continue reading
Decentralized Capital’s Tokenised Fiat Currency. A Quick Look At The Smart Contracts
Here is Decentralized Capital’s website, their FAQ, and their Token Contracts page. Unfortunately you need to be verified to use this decentralised exchange. Here is their IDEX decentralised exchange screen: Here is their USD.DC verified smart contract deployed at 0x01a7018e6d1fde8a68d12f59b6532fb523b6259d: … Continue reading
Decentralized Capital’s IDEX Is Live on the Mainnet! And A Quick Look At The Smart Contract Code
IDEX Is Live on the Mainnet!. Following is the verified source code from 0x63091244180ae240c87d1f528f5f269134cb07b3:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
pragma solidity ^0.4.6; contract Token { bytes32 public standard; bytes32 public name; bytes32 public symbol; uint256 public totalSupply; uint8 public decimals; bool public allowTransactions; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; function transfer(address _to, uint256 _value) returns (bool success); function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); } contract DVIP { function feeFor(address from, address to, uint256 amount) constant external returns (uint256 value); } contract Assertive { function assert(bool assertion) { if (!assertion) throw; } } contract Owned is Assertive { address internal owner; event SetOwner(address indexed previousOwner, address indexed newOwner); function Owned () { owner = msg.sender; } modifier onlyOwner { assert(msg.sender == owner); _; } function setOwner(address newOwner) onlyOwner { SetOwner(owner, newOwner); owner = newOwner; } function getOwner() returns (address out) { return owner; } } contract Math is Assertive { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); return c; } } contract ExchangeWhitelist is Math, Owned { mapping (address => mapping (address => uint256)) public tokens; //mapping of token addresses to mapping of account balances struct Account { bool authorized; uint256 tier; uint256 resetWithdrawal; uint256 withdrawn; } mapping (address => Account) public accounts; mapping (address => bool) public whitelistAdmins; mapping (address => bool) public admins; //ether balances are held in the token=0 account mapping (bytes32 => uint256) public orderFills; address public feeAccount; address public dvipAddress; address public feeMakeExporter; address public feeTakeExporter; event Order(address tokenBuy, uint256 amountBuy, address tokenSell, uint256 amountSell, uint256 expires, uint256 nonce, address user, uint8 v, bytes32 r, bytes32 s); event Cancel(address tokenBuy, uint256 amountBuy, address tokenSell, uint256 amountSell, uint256 expires, uint256 nonce, address user, uint8 v, bytes32 r, bytes32 s); event Trade(address tokenBuy, uint256 amountBuy, address tokenSell, uint256 amountSell, address get, address give, bytes32 hash); event Deposit(address token, address user, uint256 amount, uint256 balance); event Withdraw(address token, address user, uint256 amount, uint256 balance); function ExchangeWhitelist(address feeAccount_, address dvipAddress_) { feeAccount = feeAccount_; dvipAddress = dvipAddress_; feeMakeExporter = 0x00000000000000000000000000000000000000f7; feeTakeExporter = 0x00000000000000000000000000000000000000f8; } function setFeeAccount(address feeAccount_) onlyOwner { feeAccount = feeAccount_; } function setDVIP(address dvipAddress_) onlyOwner { dvipAddress = dvipAddress_; } function setAdmin(address admin, bool isAdmin) onlyOwner { admins[admin] = isAdmin; } function setWhitelister(address whitelister, bool isWhitelister) onlyOwner { whitelistAdmins[whitelister] = isWhitelister; } modifier onlyWhitelister { if (!whitelistAdmins[msg.sender]) throw; _; } modifier onlyAdmin { if (msg.sender != owner && !admins[msg.sender]) throw; _; } function setWhitelisted(address target, bool isWhitelisted) onlyWhitelister { accounts[target].authorized = isWhitelisted; } modifier onlyWhitelisted { if (!accounts[msg.sender].authorized) throw; _; } function() { throw; } function deposit(address token, uint256 amount) payable { if (token == address(0)) { tokens[address(0)][msg.sender] = safeAdd(tokens[address(0)][msg.sender], msg.value); } else { if (msg.value != 0) throw; tokens[token][msg.sender] = safeAdd(tokens[token][msg.sender], amount); if (!Token(token).transferFrom(msg.sender, this, amount)) throw; } Deposit(token, msg.sender, amount, tokens[token][msg.sender]); } function withdraw(address token, uint256 amount) { if (tokens[token][msg.sender] < amount) throw; tokens[token][msg.sender] = safeSub(tokens[token][msg.sender], amount); if (token == address(0)) { if (!msg.sender.send(amount)) throw; } else { if (!Token(token).transfer(msg.sender, amount)) throw; } Withdraw(token, msg.sender, amount, tokens[token][msg.sender]); } function balanceOf(address token, address user) constant returns (uint256) { return tokens[token][user]; } uint256 internal feeTake; uint256 internal feeMake; uint256 internal feeTerm; function trade(address tokenBuy, uint256 amountBuy, address tokenSell, uint256 amountSell, uint256 expires, uint256 nonce, address user, uint8 v, bytes32 r, bytes32 s, uint256 amount) onlyWhitelisted { //amount is in amountBuy terms bytes32 hash = sha3(tokenBuy, amountBuy, tokenSell, amountSell, expires, nonce, user); if (!( ecrecover(hash,v,r,s) == user && block.number <= expires && safeAdd(orderFills[hash], amount) <= amountBuy && tokens[tokenBuy][msg.sender] >= amount && tokens[tokenSell][user] >= safeMul(amountSell, amount) / amountBuy )) throw; feeMake = DVIP(dvipAddress).feeFor(feeMakeExporter, msg.sender, 1 ether); feeTake = DVIP(dvipAddress).feeFor(feeTakeExporter, user, 1 ether); tokens[tokenBuy][msg.sender] = safeSub(tokens[tokenBuy][msg.sender], amount); feeTerm = safeMul(amount, ((1 ether) - feeMake)) / (1 ether); tokens[tokenBuy][user] = safeAdd(tokens[tokenBuy][user], feeTerm); feeTerm = safeMul(amount, feeMake) / (1 ether); tokens[tokenBuy][feeAccount] = safeAdd(tokens[tokenBuy][feeAccount], feeTerm); feeTerm = safeMul(amountSell, amount) / amountBuy; tokens[tokenSell][user] = safeSub(tokens[tokenSell][user], feeTerm); feeTerm = safeMul(safeMul(((1 ether) - feeTake), amountSell), amount) / amountBuy / (1 ether); tokens[tokenSell][msg.sender] = safeAdd(tokens[tokenSell][msg.sender], feeTerm); feeTerm = safeMul(safeMul(feeTake, amountSell), amount) / amountBuy / (1 ether); tokens[tokenSell][feeAccount] = safeAdd(tokens[tokenSell][feeAccount], feeTerm); orderFills[hash] = safeAdd(orderFills[hash], amount); Trade(tokenBuy, amount, tokenSell, amountSell * amount / amountBuy, user, msg.sender, hash); } bytes32 internal testHash; uint256 internal amountSelln; function testTrade(address tokenBuy, uint256 amountBuy, address tokenSell, uint256 amountSell, uint256 expires, uint256 nonce, address user, uint8 v, bytes32 r, bytes32 s, uint256 amount, address sender) constant returns (uint8 code) { testHash = sha3(tokenBuy, amountBuy, tokenSell, amountSell, expires, nonce, user); if (tokens[tokenBuy][sender] < amount) return 1; if (!accounts[sender].authorized) return 2; if (!accounts[user].authorized) return 3; if (ecrecover(testHash, v, r, s) != user) return 4; amountSelln = safeMul(amountSell, amount) / amountBuy; if (tokens[tokenSell][user] < amountSelln) return 5; if (block.number > expires) return 6; if (safeAdd(orderFills[testHash], amount) > amountBuy) return 7; return 0; } function cancelOrder(address tokenBuy, uint256 amountBuy, address tokenSell, uint256 amountSell, uint256 expires, uint256 nonce, uint8 v, bytes32 r, bytes32 s, address user) { bytes32 hash = sha3(tokenBuy, amountBuy, tokenSell, amountSell, expires, nonce, user); if (ecrecover(hash,v,r,s) != msg.sender) throw; orderFills[hash] = amountBuy; Cancel(tokenBuy, amountBuy, tokenSell, amountSell, expires, nonce, msg.sender, v, r, s); } } |
Ethereum at a Crossroad as Corporate Interest Grows
Ethereum at a Crossroad as Corporate Interest Grows
Hyperledger Project reflects on blockchain politics
Hyperledger Project reflects on blockchain politics
The Vault Contract: Open Sourced by Giveth
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
pragma solidity ^0.4.6; /* Copyright 2016, Jordi Baylina This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /// @title Vault Contract /// @author Jordi Baylina /// @notice This contract holds funds for Campaigns and automates payments. For /// this iteration the funds will come straight from the Giveth Multisig as a /// safety precaution, but once fully tested and optimized this contract will /// be a safe place to store funds equipped with optional variable time delays /// to allow for an optional escape hatch /// @dev `Owned` is a base level contract that assigns an `owner` that can be /// later changed contract Owned { /// @dev `owner` is the only address that can call a function with this /// modifier modifier onlyOwner { if (msg.sender != owner) throw; _; } address public owner; /// @notice The Constructor assigns the message sender to be `owner` function Owned() { owner = msg.sender;} /// @notice `owner` can step down and assign some other address to this role /// @param _newOwner The address of the new owner. 0x0 can be used to create /// an unowned neutral vault, however that cannot be undone function changeOwner(address _newOwner) onlyOwner { owner = _newOwner; } } /// @dev `Escapable` is a base level contract built off of the `Owned` /// contract that creates an escape hatch function to send its ether to /// `escapeDestination` when called by the `escapeCaller` in the case that /// something unexpected happens contract Escapable is Owned { address public escapeCaller; address public escapeDestination; /// @notice The Constructor assigns the `escapeDestination` and the /// `escapeCaller` /// @param _escapeDestination The address of a safe location (usu a /// Multisig) to send the ether held in this contract /// @param _escapeCaller The address of a trusted account or contract to /// call `escapeHatch()` to send the ether in this contract to the /// `escapeDestination` it would be ideal that `escapeCaller` cannot move /// funds out of `escapeDestination` function Escapable(address _escapeCaller, address _escapeDestination) { escapeDestination = _escapeDestination; escapeCaller = _escapeCaller; } /// @dev The addresses preassigned the `escapeCaller` role /// is the only addresses that can call a function with this modifier modifier onlyEscapeCallerOrOwner { if ((msg.sender != escapeCaller)&&(msg.sender != owner)) throw; _; } /// @notice The `escapeHatch()` should only be called as a last resort if a /// security issue is uncovered or something unexpected happened function escapeHatch() onlyEscapeCallerOrOwner { uint total = this.balance; // Send the total balance of this contract to the `escapeDestination` if (!escapeDestination.send(total)) { throw; } EscapeCalled(total); } /// @notice Changes the address assigned to call `escapeHatch()` /// @param _newEscapeCaller The address of a trusted account or contract to /// call `escapeHatch()` to send the ether in this contract to the /// `escapeDestination` it would be ideal that `escapeCaller` cannot /// move funds out of `escapeDestination` function changeEscapeCaller(address _newEscapeCaller) onlyEscapeCallerOrOwner { escapeCaller = _newEscapeCaller; } event EscapeCalled(uint amount); } /// @dev `Vault` is a higher level contract built off of the `Escapable` /// contract that holds funds for Campaigns and automates payments. contract Vault is Escapable { /// @dev `Payment` is a public structure that describes the details of /// each payment making it easy to track the movement of funds /// transparently struct Payment { string description; // What is the purpose of this payment address spender; // Who is sending the funds uint earliestPayTime; // The earliest a payment can be made (Unix Time) bool canceled; // If True then the payment has been canceled bool paid; // If True then the payment has been paid address recipient; // Who is receiving the funds uint amount; // The amount of wei sent in the payment uint securityGuardDelay;// The seconds `securityGuard` can delay payment } Payment[] public authorizedPayments; address public securityGuard; uint public absoluteMinTimeLock; uint public timeLock; uint public maxSecurityGuardDelay; /// @dev The white list of approved addresses allowed to set up && receive /// payments from this vault mapping (address => bool) public allowedSpenders; /// @dev The address assigned the role of `securityGuard` is the only /// addresses that can call a function with this modifier modifier onlySecurityGuard { if (msg.sender != securityGuard) throw; _; } // @dev Events to make the payment movements easy to find on the blockchain event PaymentAuthorized(uint idPayment, address recipient, uint amount); event PaymentExecuted(uint idPayment, address recipient, uint amount); event PaymentCanceled(uint idPayment); event EtherReceived(address from, uint amount); event SpenderAuthorization(address spender, bool authorized); ///////// // Constuctor ///////// /// @notice The Constructor creates the Vault on the blockchain /// @param _escapeCaller The address of a trusted account or contract to /// call `escapeHatch()` to send the ether in this contract to the /// `escapeDestination` it would be ideal if `escapeCaller` cannot move /// funds out of `escapeDestination` /// @param _escapeDestination The address of a safe location (usu a /// Multisig) to send the ether held in this contract in an emergency /// @param _absoluteMinTimeLock The minimum number of seconds `timelock` can /// be set to, if set to 0 the `owner` can remove the `timeLock` completely /// @param _timeLock Initial number of seconds that payments are delayed /// after they are authorized (a security precaution) /// @param _securityGuard Address that will be able to delay the payments /// beyond the initial timelock requirements; can be set to 0x0 to remove /// the `securityGuard` functionality /// @param _maxSecurityGuardDelay The maximum number of seconds in total /// that `securityGuard` can delay a payment so that the owner can cancel /// the payment if needed function Vault( address _escapeCaller, address _escapeDestination, uint _absoluteMinTimeLock, uint _timeLock, address _securityGuard, uint _maxSecurityGuardDelay) Escapable(_escapeCaller, _escapeDestination) { securityGuard = _securityGuard; timeLock = _timeLock; absoluteMinTimeLock = _absoluteMinTimeLock; maxSecurityGuardDelay = _maxSecurityGuardDelay; } ///////// // Helper functions ///////// /// @notice States the total number of authorized payments in this contract /// @return The number of payments ever authorized even if they were canceled function numberOfAuthorizedPayments() constant returns (uint) { return authorizedPayments.length; } ////// // Receive Ether ////// /// @notice Called anytime ether is sent to the contract && creates an event /// to more easily track the incoming transactions function receiveEther() payable { EtherReceived(msg.sender, msg.value); } /// @notice The fall back function is called whenever ether is sent to this /// contract function () payable { receiveEther(); } //////// // Spender Interface //////// /// @notice only `allowedSpenders[]` Creates a new `Payment` /// @param _description Brief description of the payment that is authorized /// @param _recipient Destination of the payment /// @param _amount Amount to be paid in wei /// @param _paymentDelay Number of seconds the payment is to be delayed, if /// this value is below `timeLock` then the `timeLock` determines the delay /// @return The Payment ID number for the new authorized payment function authorizePayment( string _description, address _recipient, uint _amount, uint _paymentDelay ) returns(uint) { // Fail if you arent on the `allowedSpenders` white list if (!allowedSpenders[msg.sender] ) throw; uint idPayment = authorizedPayments.length; // Unique Payment ID authorizedPayments.length++; // The following lines fill out the payment struct Payment p = authorizedPayments[idPayment]; p.spender = msg.sender; // Determines the earliest the recipient can receive payment (Unix time) p.earliestPayTime = _paymentDelay >= timeLock ? now + _paymentDelay : now + timeLock; p.recipient = _recipient; p.amount = _amount; p.description = _description; PaymentAuthorized(idPayment, p.recipient, p.amount); return idPayment; } /// @notice only `allowedSpenders[]` The recipient of a payment calls this /// function to send themselves the ether after the `earliestPayTime` has /// expired /// @param _idPayment The payment ID to be executed function collectAuthorizedPayment(uint _idPayment) { // Check that the `_idPayment` has been added to the payments struct if (_idPayment >= authorizedPayments.length) throw; Payment p = authorizedPayments[_idPayment]; // Checking for reasons not to execute the payment if (msg.sender != p.recipient) throw; if (!allowedSpenders[p.spender]) throw; if (now < p.earliestPayTime) throw; if (p.canceled) throw; if (p.paid) throw; if (this.balance < p.amount) throw; p.paid = true; // Set the payment to being paid if (!p.recipient.send(p.amount)) { // Make the payment throw; } PaymentExecuted(_idPayment, p.recipient, p.amount); } ///////// // SecurityGuard Interface ///////// /// @notice `onlySecurityGuard` Delays a payment for a set number of seconds /// @param _idPayment ID of the payment to be delayed /// @param _delay The number of seconds to delay the payment function delayPayment(uint _idPayment, uint _delay) onlySecurityGuard { if (_idPayment >= authorizedPayments.length) throw; Payment p = authorizedPayments[_idPayment]; if ((p.securityGuardDelay + _delay > maxSecurityGuardDelay) || (p.paid) || (p.canceled)) throw; p.securityGuardDelay += _delay; p.earliestPayTime += _delay; } //////// // Owner Interface /////// /// @notice `onlyOwner` Cancel a payment all together /// @param _idPayment ID of the payment to be canceled. function cancelPayment(uint _idPayment) onlyOwner { if (_idPayment >= authorizedPayments.length) throw; Payment p = authorizedPayments[_idPayment]; if (p.canceled) throw; if (p.paid) throw; p.canceled = true; PaymentCanceled(_idPayment); } /// @notice `onlyOwner` Adds a spender to the `allowedSpenders[]` white list /// @param _spender The address of the contract being authorized/unauthorized /// @param _authorize `true` if authorizing and `false` if unauthorizing function authorizeSpender(address _spender, bool _authorize) onlyOwner { allowedSpenders[_spender] = _authorize; SpenderAuthorization(_spender, _authorize); } /// @notice `onlyOwner` Sets the address of `securityGuard` /// @param _newSecurityGuard Address of the new security guard function setSecurityGuard(address _newSecurityGuard) onlyOwner { securityGuard = _newSecurityGuard; } /// @notice `onlyOwner` Changes `timeLock`; the new `timeLock` cannot be /// lower than `absoluteMinTimeLock` /// @param _newTimeLock Sets the new minimum default `timeLock` in seconds; /// pending payments maintain their `earliestPayTime` function setTimelock(uint _newTimeLock) onlyOwner { if (_newTimeLock < absoluteMinTimeLock) throw; timeLock = _newTimeLock; } /// @notice `onlyOwner` Changes the maximum number of seconds /// `securityGuard` can delay a payment /// @param _maxSecurityGuardDelay The new maximum delay in seconds that /// `securityGuard` can delay the payment's execution in total function setMaxSecurityGuardDelay(uint _maxSecurityGuardDelay) onlyOwner { maxSecurityGuardDelay = _maxSecurityGuardDelay; } } |
The Vault Contract: Open Sourced by Giveth. And the source code from https://github.com/Giveth/vaultcontract/blob/master/Vault.sol:
Ether.Camp’s Hacker Gold HKG Source Code, Concerns About The USD 50 million Cap, A Significant Bug And A New Bug Fixed Contract!
Originally posted Oct 18 2016; updated 14:05 Oct 22 2016 UTC with live contract details; updated Jan 7 2017 with significant bug; updated Jan 12 2017 with newly deployed contract with the bug fix. This is not investment advise as … Continue reading
The Million Dollar Homepage
The following was written by the author of the million dollar homepage (not me). I added the contract source code below. This is not a recommendation to spend your precious ethers on the page of pixels, just a look at … Continue reading
Gnosis Prediction Market Platform Crowdfunding Contract Security Audited Source Code
Originally posted Dec 13 2016, updated Dec 16 2016 with bug bounty details. This is not advise as to whether the Gnosis prediction market platform is a good investment or not. This is just a quick look at the source … Continue reading
Posted in Blog
Tagged Crowdfunding, Ethereum, Gnosis, Smart Contract, Source Code, Tokens
Leave a comment
A Quick Look At EtherDelta’s Smart Contract
Here is EtherDelta’s screen running in the Ethereum Wallet application, executed to operate as Mist by using the command line parameter –mode mist, and then navigating to the URL https://etherdelta.github.io/#GNTW-ETH. EtherDelta is produced by https://etherboost.github.io/. Following is the source code … Continue reading
Posted in Blog
Tagged Decentralisation, Ethereum, Exchange, Smart Contract, Source Code
Leave a comment
The Original Augur REP TokenTraderFactory Contract (Work In Progress. Note that there is a bug in this contract)
NOTE Dec 14 2016: I’ve found a bug in the original REP TokenTraderFactory that could potentially lead to a loss in $$$. I’m working with the original author to fix this. Do not use this contract anymore. A new contract … Continue reading
R3 Releases Code for Distributed Ledger Tech Corda
R3 Releases Code for Distributed Ledger Tech Corda
The Golem Network Token Wrapped (GNTW) Contract
The Golem Network Token (GNT) is not a fully ERC20-compliant token. The ERC20 standard requires the following methods and events to be implemented for full compliance:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
contract ERCTokenInterface { // Methods function totalSupply() constant returns (uint256 totalSupply); function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); // Events event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } |
Check out the Golem Network Token source code at Golem Crowdfunding Funded To … Continue reading
Trustless Golem Network Token (GNT) Selling Contract
Some individuals missed out on purchasing the Golem Network Token (GNT) in the Golem Crowdfunding Funded To 820,000 ETH Cap, as the sale was over within ~ half an hour. The tokens were sold a 1 ether (ETH) = 1,000 … Continue reading
Golem Crowdfunding Funded To 820,000 ETH Cap
Original post Oct 24 2016. Updated Nov 12 2016 with deployed contract and source code, and crowdfunding statistics. This is not advise as to whether Golem is a good investment or not. This is just a quick look at what … Continue reading
Ethereum Slot Machine Source Code
I don’t like to promote gambling, but here is the source code for your perusal. From Ethereum based slot machine. Website http://www.etherslots.win/.
Gnosis Prediction Market Platform And Crowdfunding Contract Source Code
This is not advise as to whether the Gnosis prediction market platform is a good investment or not. This is just a quick look at the source code behind what Gnosis is offering. Reference Gnosis contracts published – bug bounty … Continue reading
Posted in Blog
Tagged Crowdfunding, Ethereum, Gnosis, Smart Contract, Source Code, Tokens
Leave a comment
Decentralised Gambling Game vDice Announces Crowdsale
Originally post Oct 16 2016. Updated Oct 31 with audit report. This is not investment advise as to whether vDice is a good investment or not. This is just a quick look at the smart contract behind vDice. Sponsored story … Continue reading
Arcade City’s Upcoming Crowdfunding
Originally posted Oct 24 2016. Updated Nov 1 2016. This is not advise as to whether Arcade City is a good investment or not. This is just a quick look at what Arcade City is offering and how they are … Continue reading
EtherDelta – Concern Over Whether USD 12K in Ethers Can Be Withdrawn After The Gas Reprice Hard Fork
The Ethereum blockchain will be hard-forked this coming Tuesday on block 2463000 with the main changes being the gas repricing of opcodes (EIP 150 version 1c). A concerned redditor asked There is over $12,000 USD in this contract! Please can … Continue reading
Decentralized Capital Open Sources Their Asset Contract Code
From Decentralized Capital Open Sources Their Asset Contract Code: We’ve open sourced our contract code for community review, third party scrutiny is much appreciated! We’ve got a few other projects under development and will be open sourcing those too once … Continue reading
SingularDTV Crowdsale Completed Within Fifteen Minutes
SingularDTV Crowdsale Completed Within Fifteen Minutes and SingularDTV Raises $7.5M to Incentivize Creative Output. Website – https://singulardtv.com/. Reddit – https://www.reddit.com/r/SingularDTV.