{"id":26877034,"url":"https://github.com/cardano-forge/simple-contract","last_synced_at":"2025-03-31T11:18:01.664Z","repository":{"id":279288487,"uuid":"932943758","full_name":"Cardano-Forge/simple-contract","owner":"Cardano-Forge","description":"Aiken Simple Contract - Time-locked minting with authorized signer","archived":false,"fork":false,"pushed_at":"2025-02-24T19:46:05.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-24T20:26:56.631Z","etag":null,"topics":["aiken","smart-contracts"],"latest_commit_sha":null,"homepage":"https://ada-anvil.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cardano-Forge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-14T20:11:40.000Z","updated_at":"2025-02-24T19:46:09.000Z","dependencies_parsed_at":"2025-02-24T20:37:43.611Z","dependency_job_id":null,"html_url":"https://github.com/Cardano-Forge/simple-contract","commit_stats":null,"previous_names":["cardano-forge/simple-contract"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardano-Forge%2Fsimple-contract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardano-Forge%2Fsimple-contract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardano-Forge%2Fsimple-contract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardano-Forge%2Fsimple-contract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cardano-Forge","download_url":"https://codeload.github.com/Cardano-Forge/simple-contract/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246457999,"owners_count":20780679,"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":["aiken","smart-contracts"],"created_at":"2025-03-31T11:18:01.167Z","updated_at":"2025-03-31T11:18:01.659Z","avatar_url":"https://github.com/Cardano-Forge.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Script\n\nSimple Script is a Cardano smart contract written in Aiken that enforces time-locked minting with an authorized signer.\n\n## Features\n- **Time Lock**: Minting is restricted to transactions before a predefined expiration timestamp.\n- **Authorized Signer**: Only transactions signed by a specific key can mint tokens.\n\n## Project Structure\n- **`validators/`**: Contains smart contract logic in Aiken (`.ak` files).\n- **`lib/`**: Utility functions supporting contract logic.\n- **`env/`**: Environment-based configuration files.\n\n## Example Validator\n```aiken\nuse aiken/collection/list\nuse cardano/assets.{PolicyId}\nuse cardano/transaction.{Transaction}\nuse time.{must_be_before_lower_bound}\n\n/// Simple script simulator to mock the basic time-locked policy\nvalidator simple_script {\n  mint(_redeemer: Data, _policy_id: PolicyId, self: Transaction) {\n    // Until what POSIX time you can mint\n    let expiration_time = 0\n\n    // Keyhash that needs to sign the transaction\n    let signer = #\"\"\n\n    // Check that the signer is present in the extra_signatories\n    let is_signed = list.has(self.extra_signatories, signer)\n\n    // Check that the tx is before the expiration time\n    let is_not_expired =\n      must_be_before_lower_bound(self.validity_range, expiration_time)\n\n    and {\n      is_signed?,\n      is_not_expired?,\n    }\n  }\n\n  else(_) {\n    False\n  }\n}\n```\n\n## Installation\nEnsure you have Aiken installed. If not, install it using:\n```sh\ncurl -sSL https://get.aiken-lang.org | bash\n```\n\n## Building\nCompile the contract with:\n```sh\naiken build\n```\n\n## Configuration\nEdit **`aiken.toml`** to set network parameters:\n```toml\n[config.default]\nnetwork_id = 41\n```\n\nAlternatively, use conditional environment modules in the `env/` directory.\n\n## Testing\nAiken allows writing tests using the `test` keyword. Example:\n```aiken\ntest simple_script_mint() {\n  config.network_id + 1 == 42\n}\n```\nRun all tests:\n```sh\naiken check\n```\nRun specific tests:\n```sh\naiken check -m simple_script_mint\n```\n\n## Documentation\nGenerate project documentation:\n```sh\naiken docs\n```\n\n## Resources\n- [Aiken User Manual](https://aiken-lang.org)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardano-forge%2Fsimple-contract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcardano-forge%2Fsimple-contract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardano-forge%2Fsimple-contract/lists"}