{"id":18016662,"url":"https://github.com/l1h3r/scarab","last_synced_at":"2025-03-26T18:32:29.326Z","repository":{"id":57666324,"uuid":"345428292","full_name":"l1h3r/scarab","owner":"l1h3r","description":"Tools for working with IOTA Smart Contracts","archived":false,"fork":false,"pushed_at":"2021-04-07T05:11:38.000Z","size":111,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-22T07:23:04.612Z","etag":null,"topics":["iota","smart-contract","smartcontracts","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/l1h3r.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-07T18:58:49.000Z","updated_at":"2025-02-22T09:02:00.000Z","dependencies_parsed_at":"2022-09-26T20:31:45.295Z","dependency_job_id":null,"html_url":"https://github.com/l1h3r/scarab","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l1h3r%2Fscarab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l1h3r%2Fscarab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l1h3r%2Fscarab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l1h3r%2Fscarab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/l1h3r","download_url":"https://codeload.github.com/l1h3r/scarab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245713121,"owners_count":20660346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["iota","smart-contract","smartcontracts","webassembly"],"created_at":"2024-10-30T04:18:55.581Z","updated_at":"2025-03-26T18:32:28.921Z","avatar_url":"https://github.com/l1h3r.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scarab\n\n**Tools for working with IOTA Smart Contracts**\n\n---\n\n## Usage\n\n```rust\nfn init(ctx: \u0026ScFuncContext) {\n  let owner: ScAgentId = ctx.get_required_param(\"ownerParam\");\n  let token: ScHash = ctx.get_required_param(\"tokenParam\");\n\n  // ...\n}\n\nfn my_func(ctx: \u0026ScFuncContext) {\n  let data: ScHash = ctx.get_required_param(\"data\");\n  let time: i64 = ctx.timestamp();\n\n  ctx.state().set(\"$time\", \u0026time);\n  ctx.state().set(\"$data\", \u0026data);\n\n  ctx.result(\"data\", data);\n  ctx.result(\"time\", time);\n\n  // ...\n}\n\nfn my_view(ctx: \u0026ScViewContext) {\n  let data: ScHash = ctx.state().get_value(\"$data\");\n\n  ctx.result(\"data\", data);\n\n  // ...\n}\n\n#[no_mangle]\nfn on_load() {\n  let exports = ScExports::new();\n  exports.add_func(\"init\", init);\n  exports.add_func(\"myFunc\", my_func);\n  exports.add_view(\"myView\", my_view);\n}\n```\n\n## References\n\n* [Wasp](https://github.com/iotaledger/wasp)\n* [WasmLib](https://github.com/iotaledger/wasp/tree/master/contracts/rust/wasmlib)\n\n\u003cbr\u003e\n\n#### License\n\n\u003csup\u003e\nLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache License, Version\n2.0\u003c/a\u003e or \u003ca href=\"LICENSE-MIT\"\u003eMIT license\u003c/a\u003e at your option.\n\u003c/sup\u003e\n\n\u003cbr\u003e\n\n\u003csub\u003e\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\u003c/sub\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl1h3r%2Fscarab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fl1h3r%2Fscarab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl1h3r%2Fscarab/lists"}