EO bugs
定价两次-同一事件在确认前再次发生
pragma solidity ^0.4.;
contract TransactionOrdering {
uint256 price;
address owner;
event Purchase(address _buyer, uint256 _price);
event PriceChange(address _owner, uint256 _price);
modifier ownerOnly() {
require(msg.sender == owner);
_;
}
function TransactionOrdering() {
// constructor
owner = msg.sender;
price = ;
}
function buy() returns (uint256) {
Purchase(msg.sender, price);
return price;
}
function setPrice(uint256 _price) ownerOnly() {
price = _price;
PriceChange(owner, price);
}
}
改价失败-同一事件再次发生前就完成了流程
contract IOU{
// Approves the transfer of tokens
function approve(address _spender, uint256 _val) {
allowed[msg.sender][_spender] = _val;
return true;
}
// Transfers tokens
function transferFrom(address _from, address _to, uint256 _val) {
require(
allowed[_from][msg.sender] >= _val
&& balances[_from] >= _val
&& _val > 0);
balances[_from] -= _val;
balances[_to] += _val;
allowed [_from][msg.sender] -= _val;
return true;
}
}
多人支付,总量不足-异步调用的问题,没能区别总成交量=目前已经完成的成交量+已经允许,但还没有callback的成交量,忽视了后面这一部分(Improper Check on Ether)
contract Casino{
function bet() payable {
// make sure we can pay out the player
if (address(this).balance < msg.value * ) throw;
bytes32 oid = oraclize_query(...); // random
bets[oid] = msg.value;
players[oid] = msg.sender;
}
function __callback(bytes32 myid, string result)
onlyOraclize onlyIfNotProcessed(myid) {
if (parseInt(result) % == )
players[myid].send( bets[myid] * );
}
}
没有在异步调用时区别身份-异步调用的返回可能是打乱顺序的
contract CasinoAltered{
function bet() payable {
// make sure we can pay out the player
if (address(this).balance < msg.value * ) throw;
bytes32 oid = oraclize_query(...); // random
bets[oid] = msg.value;
players[oid] = msg.sender;
}
function __callback(bytes32 myid, string result)
onlyOraclize onlyIfNotProcessed(myid) {
if (parseInt(result) % == )
players[myid].send( bets[bets.size() -] * );
}
}
EO bugs的更多相关文章
- Common Bugs in C Programming
There are some Common Bugs in C Programming. Most of the contents are directly from or modified from ...
- POJ2096 Collecting Bugs
Time Limit: 10000MS Memory Limit: 64000K Total Submissions: 5090 Accepted: 2529 Case Time Limit: ...
- 【poj2096】Collecting Bugs
题目描述 Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other materia ...
- 与你相遇好幸运,Mongodb客户端&BUGS
> Robomongo https://robomongo.org > 日常使用频率最高的客户端 存在BUG: 在 db.getCollection('xzq').find({" ...
- OAF 中的EO 和VO
EO :oracle.apps.fnd.framework.server.OAEntityImpl VO:oracle.apps.fnd.framework.server.OAViewRowImpl ...
- PL/SQL EO 设计与开发
1.INSERT 调用PL/SQL 去insert的时候,没有使用super(),此时应当自己创建callable statement: 调用checkErrors()方法在执行 callable s ...
- 【月末轻松篇】--- 那些奇葩的Bugs
不能说所有的bug都是纸老虎,但往往那种看似很奇葩的bug,导致的原因确实很简单,烦了你一段时间,找到真相又让你忍不住一笑.什么是奇葩的bug呢.我的定义是:代码逻辑都一样,但在A处是好的,到了B处就 ...
- 【POJ2096】Collecting Bugs 期望
[POJ2096]Collecting Bugs Description Ivan is fond of collecting. Unlike other people who collect pos ...
- CSS Bugs 解决方案
说明:本文档兼容性测试基础环境为:windows系统:IE6-IE10, Firefox6.0, Chrome13.0, Safari5.1, Opera11.51 Bugs及解决方案列表(以下实例默 ...
随机推荐
- QSettings 类
一 .QSettings介绍: 用户通常希望应用程序记住其设置.在windows中,这些设置保存在注册表中,ios在属性文件列表中,而unix,在缺乏标准的情况下,其存储在ini文本中.QSettin ...
- PHP代码-数据爬取(a标签和a标签所对应的内容)
public function export(){ set_time_limit(1000); // header("Content-type: text/html; charset=utf ...
- phpstrom 快速定位到当前编辑文件
方法1(手动定位): 打开所要查找的文件,然后点击上图中红框中的按钮即可快速定位. 方法二(自动定位): Project面板右上角有个准星类的图标,点击后勾选上Autoscorll from Sour ...
- List、Set、Map的区别
(图一) 1.面试题:你说说collection里面有什么子类. (其实面试的时候听到这个问题的时候,你要知道,面试官是想考察List,Set) 正如图一,list和set是实现了collection ...
- time模块和os模块,json模块
import time # def month(n): # time.local() # struct_time=time.strptime("%Y-%m-1","%Y- ...
- 题解 CF934A 【A Compatible Pair】 ——贪心
题意: 给定两个数列 \(A\) . \(B\) ,元素个数分别为 \(n\) , \(m\) \((2 \le n,m \le 50)\) .数列中所有元素大小均在 \(-10^{9}\) 到 \( ...
- CentOS设置服务开机启动的两种方法
一.通过服务的方式设置自启动 1. 在/etc/init.d 下建立相关程序的启动脚本 2. chkconfig --add mysqld(添加服务到chkconfig列表中) chkconfig ...
- 二、Python数据类型(一)
一.Python的基本输入与输出语句 (一)输出语句 print() 示例: print('你好,Python') print(4+5) a = 10 print(a) 输出的内容可以是字符串,变量, ...
- Java 中的系统时间
currentTimeMillis()System.currentTimeMillis返回的是从1970.1.1 UTC 零点开始到现在的时间,精确到毫秒,平时我们可以根据System.current ...
- Asp.net core Identity + identity server + angular 学习笔记 (第二篇)
先纠正一下第一篇的的错误. 在 Login.cshtml 和 Login.cshtml.cs 里, 本来应该是 Register 我却写成 Login . cshtml 修改部分 <form a ...