1. 链一财经首页
  2. 资讯

Quantstamp——智能合约安全性审查的系统协议

基本介绍

Quantstamp 是一个针对智能合约安全性审查的系统协议。他们利用科技扩充了以太坊来确保所有智能合约的安全性。他们的团队非常坚强,尤其针对软体测试/软体确校。他们发表的论文超过500次的引用。

什么是Quantstamp

Quantstamp是智能合约的安全协议。我们专注于安全化Ethereum的应用层

Quantstamp能做什么

Quantstamp让Ethereum安全化。我们用独特的套件让智能合约更安全:

去中心化的网络,用验证节点是达成共识并验证交易

Solidity安全库

为Ethereum实现Quantstamp API

可适配,模块化,平台无关的设计

区块链网络是相当安全;但是智能合约不是。在2016年六月,一个网路骇客从DAO偷走了$5500万美金因为一个智能合约上的失误;在2017年七月,另一个网路骇客从Parity 多重签名钱包中找到了一个小错误而偷走了超过$3000万美金。安全性的考量在未来会越来越庞大!

审计网络
Quantstamp是一个专门的网络,它将开发人员、投资者和用户联系在一个透明的、可伸缩的审核过程中。
通过对智能合同漏洞进行自动检查,并自动奖励识别bug的验证者,网络充当了透明的关键部分。
Quantstamp令牌允许平台以可伸缩和完全分散的方式运行,向验证器节点交付计算费用,并为查找漏洞提供了bounties。

Quantstamp——智能合约安全性审查的系统协议

Github上的智能合同

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

// Quantstamp Technologies Inc. ([email protected])

pragma solidity ^0.4.15;

import ‘./token/StandardToken.sol’;
import ‘./token/BurnableToken.sol’;
import ‘./ownership/Ownable.sol’;
import ‘./math/SafeMath.sol’;

/**
* The Quantstamp token (QSP) has a fixed supply and restricts the ability
* to transfer tokens until the owner has called the enableTransfer()
* function.
*
* The owner can associate the token with a token sale contract. In that
* case, the token balance is moved to the token sale contract, which
* in turn can transfer its tokens to contributors to the sale.
*/
contract QuantstampToken is StandardToken, BurnableToken, Ownable {

// Constants
string  public constant name = “Quantstamp Token”;
string  public constant symbol = “QSP”;
uint8   public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals));
uint256 public constant CROWDSALE_ALLOWANCE = 650000000 * (10 ** uint256(decimals));
uint256 public constant ADMIN_ALLOWANCE = 350000000 * (10 ** uint256(decimals));

// Properties
uint256 public crowdSaleAllowance; // the number of tokens available for crowdsales
uint256 public adminAllowance; // the number of tokens available for the administrator
address public crowdSaleAddr; // the address of a crowdsale currently selling this token
address public adminAddr; // the address of a crowdsale currently selling this token
bool    public transferEnabled = false; // indicates if transferring tokens is enabled or not

// Modifiers
modifier onlyWhenTransferEnabled() {
if (!transferEnabled) {
require(msg.sender == adminAddr || msg.sender == crowdSaleAddr);
}
_;
}

modifier validDestination(address _to) {
require(_to != address(0x0));
require(_to != address(this) );
_;
}

/**
* Constructor – instantiates token supply and allocates balanace of
* to the owner (msg.sender).
*/
function QuantstampToken(address _admin) {
totalSupply = INITIAL_SUPPLY;
crowdSaleAllowance = CROWDSALE_ALLOWANCE;
adminAllowance = ADMIN_ALLOWANCE;

// mint all tokens
balances[msg.sender] = totalSupply;
Transfer(address(0x0), msg.sender, totalSupply);

adminAddr = _admin;
approve(adminAddr, adminAllowance);
}

/**
* Associates this token with a current crowdsale, giving the crowdsale
* an allowance of tokens from the crowdsale supply. This gives the
* crowdsale the ability to call transferFrom to transfer tokens to
* whomever has purchased them.
*
* Note that if _amountForSale is 0, then it is assumed that the full
* remaining crowdsale supply is made available to the crowdsale.
*
* @param _crowdSaleAddr The address of a crowdsale contract that will sell this token
* @param _amountForSale The supply of tokens provided to the crowdsale
*/
function setCrowdsale(address _crowdSaleAddr, uint256 _amountForSale) external onlyOwner {
require(!transferEnabled);
require(_amountForSale <= crowdSaleAllowance);

// if 0, then full available crowdsale supply is assumed
uint amount = (_amountForSale == 0) ? crowdSaleAllowance : _amountForSale;

// Clear allowance of old, and set allowance of new
approve(crowdSaleAddr, 0);
approve(_crowdSaleAddr, amount);

crowdSaleAddr = _crowdSaleAddr;
}

/**
* Enables the ability of anyone to transfer their tokens. This can
* only be called by the token owner. Once enabled, it is not
* possible to disable transfers.
*/
function enableTransfer() external onlyOwner {
transferEnabled = true;
crowdSaleAllowance = 0;
adminAllowance = 0;
}

/**
* Overrides ERC20 transfer function with modifier that prevents the
* ability to transfer tokens until after transfers have been enabled.
*/
function transfer(address _to, uint256 _value) public onlyWhenTransferEnabled validDestination(_to) returns (bool) {
return super.transfer(_to, _value);
}

/**
* Overrides ERC20 transferFrom function with modifier that prevents the
* ability to transfer tokens until after transfers have been enabled.
*/
function transferFrom(address _from, address _to, uint256 _value) public onlyWhenTransferEnabled validDestination(_to) returns (bool) {
bool result = super.transferFrom(_from, _to, _value);
if (result) {
if (msg.sender == crowdSaleAddr)
crowdSaleAllowance = crowdSaleAllowance.sub(_value);
if (msg.sender == adminAddr)
adminAllowance = adminAllowance.sub(_value);
}
return result;
}

/**
* Overrides the transferOwnership function so that the balance of
* tokens of the old owner can be transferred to the new owner.
*
* @param newOwner  The new owner of the token balance
*/
function transferOwnership(address newOwner) onlyOwner public {
super.transferOwnership(newOwner);
}

/**
* Overrides the burn function so that it cannot be called until after
* transfers have been enabled.
*
* @param _value    The amount of tokens to burn in mini-QSP
*/
function burn(uint256 _value) public onlyWhenTransferEnabled {
super.burn(_value);
Transfer(msg.sender, address(0x0), _value);
}
}

Quantstamp——智能合约安全性审查的系统协议

关于更多Quantstamp信息:https://quantstamp.com/

风险提示:区块链投资具有极大的风险,项目披露可能不完整或有欺骗。请在尝试投资前确定自己承受以上风险的能力。本网站只做项目介绍,项目真假和价值并未做任何审核。

根据国家《关于防范代币发行融资风险的公告》,大家应警惕代币发行融资与交易的风险隐患。

本文来自LIANYI转载,不代表链一财经立场,转载请联系原作者。

发表评论

登录后才能评论

联系我们

微信:kkyves

邮件:kefu@lianyi.com

时间:7x24,节假日bu休息

QR code