eddy swap 交易
我在想一个个的做任务,其中eddy的最好做,只需要完成一笔交易即可。
现在我想直观交易可以代码执行吗?
因为我之前没有用代码交互过合约,我刚才用小狐狸测试下,就是想合约转账,输入金额和数据。
那么本质上还是一笔交易,这个代码貌似可以完成的。
这个就是交易的哈希。
其中eddy swap zeta合约的地址是:
1 | 0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe |
如果我想要用ZETA交易BNB,那么数据就是(0.01ZETA):
1 | 0x7ff36ab500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f40a98b91512040c9e640e94bb90ae6df0e663a800000000000000000000000000000000000000000000000000000000656c00e300000000000000000000000000000000000000000000000000000000000000020000000000000000000000005f0b1a82749cb4e2278ec87f8bf6b618dc71a8bf0000000000000000000000002cdd7ff997df5e5e769e06d2766cc7235b9fbcd1 |
当然,你可以随意输入要兑换的ZETA,这个是兑换为BNB,你也可以尝试兑换其他的。
这是还是带有发送到目的钱包的字符串。
这就需要用到分割字符串的方法,这并不难,只要处理好就可以了。
为了使用方便,我存放在资源目录zeta/eddy/bnb.txt里面了,并且分两行(把钱包去除掉后),最后子啊代码里面再进行拼接即可。
1 | String filePath = "src/main/resources/zeta/eddy/bnb.txt"; |
那么,写循环就能解决问题。
根据下面的mint 完成ETH代币后,用ETH对比交易ZETA,这个操作貌似可以赚点手续费。
1 | 0x18cbafe500000000000000000000000000000000000000000000000006ccd46763f10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000 |
1 | 0x18cbafe500000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000 |
合约地址还是上面那个。
艹,交易代币前要先授权,我忘记了。因为之前交易的都是GAS代币ZETA,所以可以不用授权。
授权交易数据:
1 | 0x095ea7b30000000000000000000000002ca7d64a7efe2d62a725e2b35cf7230d6677ffeeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff |
授权ETH的合约地址:
1 | 0x9cEC89Ce7686b1FE4Ea7cA708a38D835563dF6BF |
淦,经常把授权地址搞错了。
授权地址集合:
1 | // ETH |
eddy mint 代币
我发现了可以mint代币,只需要调用合约即可(下面ETH)。
1 | 0x40c10f19000000000000000000000000 |
一目了然,这个还是包含了钱包地址。
mint代币的合约地址:
1 | 0x9cEC89Ce7686b1FE4Ea7cA708a38D835563dF6BF |
我尝试一下其他的mint,看看又什么区别。
这是BNB的调用。
1 | 0x40c10f190000000000000000000000002f4e5935baf4ad6ebf3da8d596c95abe8b5934ec00000000000000000000000000000000000000000000000006f05b59d3b20000 |
我们明白了,内容是不变的。
合约地址变了。
1 | 0x2cdD7fF997dF5e5e769E06D2766cC7235B9fbCd1 |
下面是整理的合集:
1 | // ETH |
所以,思路就是,先去mint代币,然后用mint的代币交易。
xdao 创建dao
合约地址:
1 | 0x72cc6E4DE47f673062c41C67505188144a0a3D84 |
数据:
1 | 0x55a569d700000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000330000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000014100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000141000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000 |
别人的:
1 | 0x55a569d700000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000033000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000007616d696c657461000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007414d494c455441000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000 |
再看一个:
1 | 0x55a569d700000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000330000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000056f7269766500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000054f524956450000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000 |
继续创建一个:
1 | 0x55a569d700000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000330000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000345544800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000 |