Comments (3)
假设我有一个代币合约,其中有一个用来转移代币的 transfer 方法,它接受两个参数(接收方地址,代币数量)
transfer(address to, uint256 amount);
先添加合约:
$client->contracts
->add(
// 为该合约自定义的别名
'MyToken',
// 合约地址
'0x98a50658e10679147e92e58371788586b67f896f',
// ABI
'[...略...{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},...略...]'
);
然后调用 MyToken 的 transfer 方法向 0x971de58a3b6661aea148e66d806c22399436dd09 转移 1000 个代币:
$transactionHash = $client->contracts->MyToken->call('transfer', '0x971de58a3b6661aea148e66d806c22399436dd09', 1000);
from ethereum-php.
方便加你个人联系方式吗
from ethereum-php.
Q:100110282
from ethereum-php.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ethereum-php.