我的dapp将从客户端获取一些数据并将其发送给合同。我想避免欺骗它。
答案 0 :(得分:2)
pragma solidity ^0.4.0;
contract MyContract {
address mAdmin;
modifier adminOnly {
if (msg.sender == mAdmin) _;
}
function MyContract() {
mAdmin = msg.sender;
}
function doSomething() adminOnly {
...
}
}