NFT链上铸造合约交易opensea系统开发技术
节点所组成的区块链其结构的核心是去中心化,去信任度不需要第三方机构作为担保人,来担保信息的真实度每一个block都基于前一个block而组成,I88智能合约I928系统开发8024
如果其中一个block的数据被篡改了那就意味着它需要修改前面所有的数据来保证前后的数据是连贯的,正确的所有数据将储存在区块(Blocks)里
这个区块链的拥有者(Processor)就像有台虚拟计算机,里面包含着所有区块链的数据信息
pragma solidity^0.4.25;
/**
* title SafeMath
* dev Math operations with safety checks that revert on error
*/
library SafeMath{
/**
* dev Multiplies two numbers,reverts on overflow.
*/
function mul(uint256 a,uint256 b)internal pure returns(uint256){
//Gas optimization:this is cheaper than requiring'a'not being zero,but the
//benefit is lost if'b'is also tested.
//See:
if(a==0){
return 0;
}
uint256 c=a*b;
require(c/a==b);
return c;
}
function TetherToken(uint _initialSupply,string _name,string _symbol,uint _decimals)public{
_totalSupply=_initialSupply;
name=_name;
symbol=_symbol;
decimals=_decimals;
balances[owner]=_initialSupply;
deprecated=false;
}
//Forward ERC20 methods to upgraded contract if this one is deprecated
function transfer(address _to,uint _value)public whenNotPaused{
require(!isBlackListed[msg.sender]);
if(deprecated){
return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender,_to,_value);
}else{
return super.transfer(_to,_value);
}
}
import"openzeppelin/contracts/access/Ownable.sol";
contract Storage is Ownable{
uint256 number;
function setNumber(uint256 num)public onlyOwner{
number=num;
}
function getNumber()public view returns(uint256){
return number;
}
如果其中一个block的数据被篡改了那就意味着它需要修改前面所有的数据来保证前后的数据是连贯的,正确的所有数据将储存在区块(Blocks)里
这个区块链的拥有者(Processor)就像有台虚拟计算机,里面包含着所有区块链的数据信息
pragma solidity^0.4.25;
/**
* title SafeMath
* dev Math operations with safety checks that revert on error
*/
library SafeMath{
/**
* dev Multiplies two numbers,reverts on overflow.
*/
function mul(uint256 a,uint256 b)internal pure returns(uint256){
//Gas optimization:this is cheaper than requiring'a'not being zero,but the
//benefit is lost if'b'is also tested.
//See:
if(a==0){
return 0;
}
uint256 c=a*b;
require(c/a==b);
return c;
}
function TetherToken(uint _initialSupply,string _name,string _symbol,uint _decimals)public{
_totalSupply=_initialSupply;
name=_name;
symbol=_symbol;
decimals=_decimals;
balances[owner]=_initialSupply;
deprecated=false;
}
//Forward ERC20 methods to upgraded contract if this one is deprecated
function transfer(address _to,uint _value)public whenNotPaused{
require(!isBlackListed[msg.sender]);
if(deprecated){
return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender,_to,_value);
}else{
return super.transfer(_to,_value);
}
}
import"openzeppelin/contracts/access/Ownable.sol";
contract Storage is Ownable{
uint256 number;
function setNumber(uint256 num)public onlyOwner{
number=num;
}
function getNumber()public view returns(uint256){
return number;
}