10 2024 档案

摘要:在 Go 编程中,切片是一种非常常用的数据结构。理解如何正确地修改切片中的元素非常重要,特别是当我们需要更改这些元素的值时。在这篇文章中,我们将探讨在切片中修改元素的不同方法,并讨论何时使用值切片和指针切片。 1. 使用值切片 在 Go 中,使用值切片(例如 []wmsModel.OrderProd 阅读全文
posted @ 2024-10-31 11:18 若-飞 阅读(12) 评论(0) 推荐(0) 编辑
摘要:js发起交易代码: async function sendTransaction(item, queryId) { // return false; // console.log('sendTransaction', item, address); const { beginCell, toNano 阅读全文
posted @ 2024-10-24 10:45 若-飞 阅读(63) 评论(0) 推荐(0) 编辑
摘要:tact代码: import "@stdlib/deploy"; import "@stdlib/ownable"; struct RoundInfo { orders: map<Int as uint32, BuyInfo>; sum: Int as uint16; arrLength: Int 阅读全文
posted @ 2024-10-19 17:20 若-飞 阅读(12) 评论(0) 推荐(0) 编辑
摘要:package tonapiservice import ( "fmt" "testing" "github.com/tonkeeper/tongo/boc" "github.com/tonkeeper/tongo/tlb" ) func TestHashmapE(t *testing.T) { / 阅读全文
posted @ 2024-10-19 17:00 若-飞 阅读(6) 评论(0) 推荐(0) 编辑
摘要:receive(msg: BatchSyncOrderMsg) { self.requireOwner(); // Ensure the caller is the contract owner let roundInfo: RoundInfo = self.rounds.get(msg.round 阅读全文
posted @ 2024-10-19 16:47 若-飞 阅读(4) 评论(0) 推荐(0) 编辑
摘要:发现一个问题,tact合约如果代码都没有更改的情况下,不论怎么编译,合约地址都是同一个。 然后发现只要初始化的参数不一样就可以简单的生成不同的合约: contract StudyContract with Deployable { msg: String = "123"; // Constructo 阅读全文
posted @ 2024-10-17 16:03 若-飞 阅读(19) 评论(0) 推荐(0) 编辑
摘要:tact合约是这样: import "@stdlib/deploy"; import "@stdlib/ownable"; contract StudyContract with Deployable { msg: String = "123"; // Constructor init(){ sel 阅读全文
posted @ 2024-10-17 15:45 若-飞 阅读(30) 评论(0) 推荐(0) 编辑
摘要:先把正常的记录下来: // Send Msg let maxCellData = generate1023BitHex() console.log("maxCellData:",maxCellData); let msg = beginCell() .storeBuffer(Buffer.from( 阅读全文
posted @ 2024-10-17 14:41 若-飞 阅读(5) 评论(0) 推荐(0) 编辑
摘要:tact中的map结构: struct RoundInfo { // Purchase records quotient: map<Int as uint32, BuyInfo>; // key is sequence number // Order anti-duplication records 阅读全文
posted @ 2024-10-17 13:50 若-飞 阅读(17) 评论(0) 推荐(0) 编辑
摘要:// Send Msg let msg = beginCell() .storeBuffer(Buffer.from("c5341626", "hex")) // 发送结构体 .storeStringRefTail("2") // storeStringTail 会报错不支持? .endCell() 阅读全文
posted @ 2024-10-13 23:50 若-飞 阅读(29) 评论(0) 推荐(0) 编辑
摘要:如果不设置gasfee,ton就不会处理的: // Send Msg let msg = beginCell() .storeBuffer(Buffer.from("c5341626", "hex")) // 发送结构体 .storeStringTail("1") .endCell() let se 阅读全文
posted @ 2024-10-12 19:02 若-飞 阅读(21) 评论(0) 推荐(0) 编辑
摘要:在开发TON合约时,消息的发送格式非常关键。特别是在使用TypeScript与TON合约交互时,我们会遇到这样的代码片段: async send(provider: ContractProvider, via: Sender, args: { value: bigint, bounce?: bool 阅读全文
posted @ 2024-10-12 18:12 若-飞 阅读(39) 评论(0) 推荐(0) 编辑
摘要:在区块链中,“Roll Up”是一种扩展解决方案,它通过将多个交易打包(或“卷起”)到一个单一的交易中,从而减少链上数据的处理量。Roll Up 的主要优点是提高交易吞吐量和降低手续费,同时仍然保持安全性和去中心化。 Roll Up 分为两种主要类型: ZK-Rollup:使用零知识证明来验证交易的 阅读全文
posted @ 2024-10-11 10:47 若-飞 阅读(85) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示