首页 > 区块链 > 区块链 > 关于TRX波场DAPP模式系统开发技术方案(程序逻辑)
智能合约与区块链的结合形成了智能合约法规自动执行系统,该系统有三个重要的原则:
首先,智能合约数据来源于链上。这是指智能合约的输入是从区块链的 数据库里面出来的。这些数据是由区块链保证的,具有真实难以篡改的特征。
其次,智能合约的执行在链上。这是指智能合约是在多个节点上面执行,而所执行的结果必须是相同,智能合约所出的结果一定要被共识才能被接受。
再者,智能合约输出在链上。这是指智能合约的输出结果必须存在区块链上面,这样保证结果的真实与可追溯性,并且为其他相衔接的智能合约提供输入数据的准确性保障。
File 1 of 4: OwnedUpgradeabilityProxy.sol
pragma solidity ^0.4.24;
import './UpgradeabilityProxy.sol';
/**
*/ contract OwnedUpgradeabilityProxy is UpgradeabilityProxy { /**
*/ event ProxyOwnershipTransferred(address previousOwner, address newOwner);
// Storage position of the owner of the contract bytes32 private constant proxyOwnerPosition = keccak256("org.zeppelinos.proxy.owner");
/**
*/ constructor() public {
setUpgradeabilityOwner(msg.sender);复制
}
/**
*/ modifier onlyProxyOwner() {
require(msg.sender == proxyOwner());_;复制
}
/**
*/ function proxyOwner() public view returns (address owner) {
bytes32 position = proxyOwnerPosition;assembly {
owner := sload(position)}复制}
/**
*/ function setUpgradeabilityOwner(address newProxyOwner) internal {
bytes32 position = proxyOwnerPosition;assembly {
sstore(position, newProxyOwner)}复制}
/**
*/ function transferProxyOwnership(address newOwner) public onlyProxyOwner {
require(newOwner != address(0));emit ProxyOwnershipTransferred(proxyOwner(), newOwner);setUpgradeabilityOwner(newOwner);复制
}
/**
*/ function upgradeTo(address implementation) public onlyProxyOwner {
_upgradeTo(implementation);复制
}
/**
*/ function upgradeToAndCall(address implementation, bytes data) payable public onlyProxyOwner {
upgradeTo(implementation);require(implementation.delegatecall(data));复制
}
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70016646/viewspace-2936349/ ,如需转载,请注明出处,否则将追究法律责任。