先来一段合约代码:
// MetaCoin.sol 用于账户转账的智能合约应用
contract MetaCoin {
mapping (address => uint) balances;
function MetaCoin() {
balances[tx.origin] = 10000;
}
function sendCoin(address receiver, uint amount) returns(bool sufficient) {
if (balances[msg.sender] < amount) return false;
balances[msg.sender] -= amount;
balances[receiver] += amount;
return true;
}
function getBalance(address addr) returns(uint) {
return balances[addr];
}
}
- 大小: 224.3 KB
分享到:
相关推荐
Mastering Ethereum: Building Smart Contracts and DApps (EPUB)
Plasma is a proposed framework for incentivized and enforced execution of smart contracts which is scalable to a significant amount of state updates per second (poten- tially billions) enabling the ...
【智能合约漏洞检测】是区块链领域中的一个重要议题,特别是对于基于以太坊(Ethereum)等平台部署的智能合约... ContractFuzzer: Fuzzing Smart Contracts for Vulnerability Detection. (此处省略会议或期刊名称及页码)
Building Games with Ethereum Smart Contracts Intermediate Projects for Solidity Developers 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源...
During this workshop, we will demonstrate how smart contracts work on the CasperLabs Blockchain.
Beginning Ethereum Smart Contracts Programming is your fastest and most efficient means of getting started if you are unsure where to begin and how to connect to the Ethereum Blockchain. The book ...
本文研究了在类似于加密货币的开放分布式网络中运行Ethereum智能合约的安全性。我们引入了几个新的安全问题,在这些问题中,对手可以通过巧妙地执行合约来获取利润。这些bug表明,在理解底层平台的分布式语义方面...
【代码评估概述】 Liquidations 2.0智能合约的代码评估是针对Maker基金会的清算系统进行的一次专业分析。这份报告旨在揭示评估过程中发现的安全性和正确性问题,并概述了处理这些问题的方法和流程。...
ZetaChain consists of a Proof-of-Stake blockchain and observers and signers for external blockchains. The observers scan external chains for relevant events, transactions, and states at a point in ...
Hyperledger Fabric 是一个开源区块链实现,开发环境建立在 VirtualBox 虚拟机上,部署环境可以自建网络,也可以直接部署在 BlueMix 上,部署方式可传统可 Docker 化,共识达成算法插件化,支持用 Go 和 JavaScript ...
【标题】:“AI安全”指的是人工智能领域的安全性问题,特别是针对智能合约开发中的安全SDLC(Secure Software Development Lifecycle)实践。SDLC是软件开发过程的一种管理方法,旨在确保从设计到部署的每个阶段都...
With the rapid development of cryptocurrency and its underlying blockchain technologies, platforms such as Ethereum and Hyperledger began to support various types of smart contracts. Smart contracts ...
Ethereum is a blockchain-based, decentralized computing platform that allows running smart contracts. This book provides a basic overview of how Ethereum works, its ecosystem, mining process, and the ...
•Write Ethereum smart contracts in Solidity •Connect Ethereum smart contracts to your HTML/CSS/JavaScript web applications •Deploy your own dapp, coin, and blockchain •Work with basic and ...
What can help with Smart Contracts Security Web vs Smart Contracts How to "buidl" a secure smart contract? SDLC Practices 1.Threat Assessment 2.Security Requirements 3.Developer Education 4.PrivateKey...
Chapter 3, Writing Smart Contracts, shows how to write smart contracts and use geth's interactive console to deploy and broadcast transactions using web3.js. Chapter 4, Getting Started with web3.js, ...
Chapter 3, Writing Smart Contracts, shows how to write smart contracts and use geth's interactive console to deploy and broadcast transactions using web3.js. Chapter 4, Getting Started with web3.js, ...
“This book is dedicated to novice programmers, solution architects, and blockchain enthusiasts who want to build powerful, robust, and optimized smart contracts using solidity from scratch and in ...