Discussions

Ask a Question

About "inline functions"

Hi there is a question that has been in my mind for some time. https://github.com/XRPL-Labs/xrpld-hooks/discussions/57 I ask the question again here, because I think it is an important one. about "C inline functions" and the compiler option to force compile "always inline". There is a possibility to enable this functionality? Inline functions, I know, can be an alternative to the awful macros. recursion is not possible with inline functions and the benefit could be a programming style very similar to javascript and solidity. thank you
ANSWERED

Can someone help with a simple EVM smart contract to Hook example?

Its difficult for me to understand the hooks because I have so little experience in C++. I think it would be great if we did a cross EVM / Hook example? Also, I noticed there ins't a lot of tutorials. Its just straight documentation. When I started with solidity and EVM, the medium articles really helped me. I could write one for more exposure maybe showing the example of a very simple smart contract? Also, I wanted to say thank you to those who already put in work. The C files really include good notes and it has helped me a lot in the beginning. Docker was a breeze. Now I'm just trying to understand state/slot and STO. YOU GUYS ROCK!!!
ANSWERED

Prevent deleting a hook

Is there anyway to prevent a hook from being deleted? my thought process: I don't want a user to be able to remove the hook... so if an account is compromised and the seed/keys land up in the hands of a malicious user. that malicious user should not be able to remove the hook... can a hook be programmed to check some state before being removed/overwritten and act upon that state? is there any sort of OnRemove(); BeforeRemove(); very broad question so im open round about ways. thanks,

Can I use AssemblyScript?

Hi team, Do you see any issue with using https://www.assemblyscript.org/ ? I tried to compile your simple `accept` hook with AssemblyScript but when I submit the transaction with ripple-lib I get an error message: ``` data: { resultCode: 'temMALFORMED', resultMessage: 'Malformed transaction.', engine_result: 'temMALFORMED', engine_result_code: -299, engine_result_message: 'Malformed transaction.', tx_blob: '12001622800000002400441FC5201B004565333010000000000000000068400000000000000C7321031707DDB63EB8B5447371F1EA5B83009475AE0981388BB7352403393F82230E1B74473045022100E4F443EE595F93F4F604117D215A21CE5AC81974364155AA45BE6286E3A3978002203487A9EA95C297CD82281089DBC0B09A87384C99866B2BC1EDAD00AA1BE1698D7BA50061736D0100000001130360017E017E60037F7F7E017E60027F7F017F021D0207636F6E74726F6C066163636570740001057574696C73025F67000203030200000503010000071803046362616B000204686F6F6B0003066D656D6F727902000A1B02040042000B140041004100420010001A4101410110011A42000B002610736F757263654D617070696E6755524C142E2F6F7074696D697A65642E7761736D2E6D61708114A9E75BEA9E40D24E411DC9E5B1E209C5F015BA10', tx_json: { Account: 'rGV4MXcjPTkdhVZLFrddVQPHz1WdXkvK6g', CreateCode: '0061736D0100000001130360017E017E60037F7F7E017E60027F7F017F021D0207636F6E74726F6C066163636570740001057574696C73025F67000203030200000503010000071803046362616B000204686F6F6B0003066D656D6F727902000A1B02040042000B140041004100420010001A4101410110011A42000B002610736F757263654D617070696E6755524C142E2F6F7074696D697A65642E7761736D2E6D6170', Fee: '12', Flags: 2147483648, HookOn: '0000000000000000', LastLedgerSequence: 4547891, Sequence: 4464581, SigningPubKey: '031707DDB63EB8B5447371F1EA5B83009475AE0981388BB7352403393F82230E1B', TransactionType: 'SetHook', TxnSignature: '3045022100E4F443EE595F93F4F604117D215A21CE5AC81974364155AA45BE6286E3A3978002203487A9EA95C297CD82281089DBC0B09A87384C99866B2BC1EDAD00AA1BE1698D', hash: 'BA20CC222EE7A87D8C969B732041C3E92FDA7D6E66B9550294C65B3ADB7EAA29' } } ``` Also in the rippled logs are showing: ``` 2021-Sep-27 10:55:29.827798400 UTC OpenLedger:TRC HookSet[rGV4MXcjPTkdhVZLFrddVQPHz1WdXkvK6g-BA20CC222EE7A87D8C969B732041C3E92FDA7D6E66B9550294C65B3ADB7EAA29]: Malformed transaction. Hook attempted to specify import module other than 'env' ``` Thank you

hooks languages?

"typically hooks are written in c" I see all the examples and docs are in c. You prefer people to write in c? How do the examples compare/port over to other languages for hooks?
ANSWERED

Progress on Hooks?

Hey, I was just wondering if the Hooks amendments is being delayed or everything is going as planned? When do you guys think the Hooks Amendment is being published on the mainnet, any guesstimate? Thank you.
ANSWERED

No RPC endpoint?

I noticed there is no RPC endpoint on the hooknet. Is this your subtle way of telling me to migrate to web sockets in all my api calls to the XRPL? :) I realize I could open up one on my own, I just had some tests running that use RPC so I was curious.

How to store private information on a Hook?

I'm still new to Hooks and C in general but how can a Hooks developer store personal and confidential information on a Hook (e.x: Full Name, Age, ID) without it being publicly available. I'm planning to code a Hook that only accepts KYC/AML enabled accounts' transactions to avoid unwanted transactions to the receiving account. Any centralized or decentralized structures are accepted. Thank you.
ANSWERED

install on v2 fails 2

txhash: 06A1985A7466547795C0049ABA17DE9CC2CC298E742AC2E542C7F0F0CDEE692D this is my first attempt on v2, I need help for this case I get a generic temMALFORMED response using accept.wasm hex string {"Hooks":[{"Hook":{"CreateCode":"0061736D01000000011F0560057F7F7F7F7F017E60037F7F7E017E60027F7F017F60000060017E017E02230303656E76057472616365000003656E7606616363657074000103656E76025F6700020304030304040405017001010105030100020621057F0141B088040B7F0041A6080B7F004180080B7F0041B088040B7F004180080B076608066D656D6F72790200115F5F7761736D5F63616C6C5F63746F727300030A5F5F646174615F656E6403010D5F5F676C6F62616C5F6261736503020B5F5F686561705F6261736503030C5F5F64736F5F68616E646C650304046362616B000404686F6F6B00050ABB010302000B2702037F017E238080808000210141102102200120026B2103420021042003200037030820040F0B8D0103037F017E087F238080808000210141102102200120026B2103200324808080800042002104410121054100210641808880800021074114210841948880800021094112210A20032000370308200720082009200A20061080808080001A2006200620041081808080001A200520051082808080001A4110210B2003200B6A210C200C24808080800020040F0B0B2D01004180080B26224163636570742E633A2043616C6C65642E22004163636570742E633A2043616C6C65642E00003A046E616D6501330600057472616365010661636365707402025F6703115F5F7761736D5F63616C6C5F63746F727304046362616B0504686F6F6B00750970726F647563657273010C70726F6365737365642D62790105636C616E6755392E302E30202868747470733A2F2F6769746875622E636F6D2F6C6C766D2F6C6C766D2D70726F6A656374203033393964356139363832623363656637316336353333373365333838393063363363346333363529","HookApiVersion":0,"HookNamespace":"C125D0397B605657BC89340953F5F2897A7E00A9B7D3474FA53720C8CCBBB3E3","HookOn":"0000000000000000"}}],"TransactionType":"SetHook","Account":"rLnT5MeahSnbR8j7dRXa39iD3Wpd9b8E2F","Sequence":1797094,"LastLedgerSequence":2091835,"Fee":"10000000","Flags":0}

EmitGeneration field value looks wrong

Hi In 3 chained transactions test, where the 1st ordinary payment txn triggers the 2nd emitted, and the 2nd triggers the 3rd, I see that the 2 emitted transactions have the EmitGeneration field = 2(the 2nd) and 4(the 3rd) 1st txn https://hooks-testnet-v2-explorer.xrpl-labs.com/tx/D8868FF6761DACA9A704A98D9CD3225BC82E914B507364ECA4D273F919C4712B 2nd emitted txn triggered by the 1st https://hooks-testnet-v2-explorer.xrpl-labs.com/tx/47CDEC6EBA4AAEA9E640643C4A6ACAFF09E63DBE093138F10847EA407509ACE7 3rd emitted txn triggered by the 2nd https://hooks-testnet-v2-explorer.xrpl-labs.com/tx/AF372886C4A3297A0137B43D6C3C823180A69779F060228D27C33F5DE015906F But, according to the documentation, I should see values of 1 and 2 https://xrpl-hooks.readme.io/docs/emitted-transactions#emitdetails-block fields are filled by etxn_details() etxn_reserve always = 1 EmitBurden always = "1" seems correct