Update rules.md

Improved Readability: Clear variable names and consistent formatting.
Explicit Handling: Added an explicit return statement for cases that require manual review for enhanced clarity.
This commit is contained in:
E0nEch0 2024-05-12 21:07:51 +12:00 committed by GitHub
parent 44a50c9f96
commit af56feeed1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -214,14 +214,15 @@ function OnApprovedTx(resp) {
## Example 2: allow destination ## Example 2: allow destination
```js ```js
function ApproveTx(r) { function ApproveTx(request) {
if (r.transaction.from.toLowerCase() == "0x0000000000000000000000000000000000001337") { const sender = request.transaction.from.toLowerCase();
return "Approve" if (sender === "0x0000000000000000000000000000000000001337") {
} return "Approve";
if (r.transaction.from.toLowerCase() == "0x000000000000000000000000000000000000dead") { }
return "Reject" if (sender === "0x000000000000000000000000000000000000dead") {
} return "Reject";
// Otherwise goes to manual processing }
return "Manual Review"; // Explicit return for clarity
} }
``` ```