{"id":21142038,"url":"https://github.com/0xcompute/rubysol.starter","last_synced_at":"2026-01-25T22:26:15.125Z","repository":{"id":23150537,"uuid":"26505911","full_name":"0xCompute/rubysol.starter","owner":"0xCompute","description":"rubysol quick starter - run rubysol contracts (with 100%-solidity compatible data types \u0026 abis) in your own home for fun \u0026 profit (for free)","archived":false,"fork":false,"pushed_at":"2023-11-16T11:45:43.000Z","size":39,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T17:47:50.928Z","etag":null,"topics":["blockchain","contracts","ethereum","rubidity","rubysol","solidity"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xCompute.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-11-11T21:37:23.000Z","updated_at":"2024-01-30T11:33:00.000Z","dependencies_parsed_at":"2023-11-16T12:46:13.602Z","dependency_job_id":null,"html_url":"https://github.com/0xCompute/rubysol.starter","commit_stats":null,"previous_names":["s6ruby/rubysol.starter","0xcompute/rubysol.starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0xCompute/rubysol.starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xCompute%2Frubysol.starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xCompute%2Frubysol.starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xCompute%2Frubysol.starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xCompute%2Frubysol.starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xCompute","download_url":"https://codeload.github.com/0xCompute/rubysol.starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xCompute%2Frubysol.starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28760644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T20:56:06.009Z","status":"ssl_error","status_checked_at":"2026-01-25T20:54:48.203Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["blockchain","contracts","ethereum","rubidity","rubysol","solidity"],"created_at":"2024-11-20T07:40:45.781Z","updated_at":"2026-01-25T22:26:15.103Z","avatar_url":"https://github.com/0xCompute.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rubysol quick starter - run rubysol contracts (with 100%-solidity compatible data types \u0026 abis) in your own home for fun \u0026 profit (for free)\n\n\n## What's Solidity?! What's Rubidity?! What's Rubysol?!\n\nSee [**Solidity - Contract Application Binary Interface (ABI) Specification** »](https://docs.soliditylang.org/en/latest/abi-spec.html)\n\nSee [**Rubidity - Ruby for Layer 1 (L1) Contracts / Protocols with \"Off-Chain\" Indexer**  »](https://github.com/s6ruby/rubidity)\n\nSee [**Rubysol - Ruby for Layer 1 (L1) Contracts / Protocols with \"Off-Chain\" Indexer**  »](https://github.com/s6ruby/rubidity/tree/master/rubysol)\n\n\n## Step 0 - Install Rubysol (Ruby Package)\n\n``` ruby\ngem install rubysol\n```\n\n\n\n##  Usage \n\n### Step 1 - Try Out Some Contracts\n\nLet's try the PublicMintER20 Contract...\n\n[contracts/public_mint_erc20.rb](/contracts/public_mint_erc20.rb):\n\n``` ruby\nclass PublicMintERC20 \u003c ERC20\n  \n  storage maxSupply:    UInt,\n          perMintLimit: UInt \n  \n  sig [String, String, UInt, UInt, UInt]\n  def constructor(\n    name:,\n    symbol:,\n    maxSupply:,\n    perMintLimit:,\n    decimals:\n  ) \n    super( name: name, \n           symbol: symbol, \n           decimals: decimals)\n \n    @maxSupply    = maxSupply\n    @perMintLimit = perMintLimit\n  end\n \n\n  sig  [UInt]\n  def mint( amount: )\n    assert(amount \u003e 0, 'Amount must be positive')\n    assert(amount \u003c= @perMintLimit, 'Exceeded mint limit')\n    \n    assert( @totalSupply + amount \u003c= @maxSupply, 'Exceeded max supply')\n    \n    _mint(to: msg.sender, amount: amount)\n  end\n  \n  sig [Address, UInt]\n  def airdrop( to:, amount: ) \n    assert(amount \u003e 0, 'Amount must be positive')\n    assert(amount \u003c= @perMintLimit, 'Exceeded mint limit')\n    \n    assert(@totalSupply + amount \u003c= @maxSupply, 'Exceeded max supply')\n    \n    _mint(to: to, amount: amount)\n  end\nend\n```\n\nthat builds on the ERC20 (base) contract.\n\n[contracts/erc20.rb](lib/rubidity/contracts/erc20.rb):\n\n``` ruby\nclass PublicMintERC20 \u003c ERC20\n  \n  storage maxSupply:    UInt,\n          perMintLimit: UInt \n  \n  sig [String, String, UInt, UInt, UInt]\n  def constructor(\n    name:,\n    symbol:,\n    maxSupply:,\n    perMintLimit:,\n    decimals:\n  ) \n    super( name: name, \n           symbol: symbol, \n           decimals: decimals)\n    \n    @maxSupply    = maxSupply\n    @perMintLimit = perMintLimit\n  end\n \n\n  sig  [UInt]\n  def mint( amount: )\n    assert(amount \u003e 0, 'Amount must be positive')\n    assert(amount \u003c= @perMintLimit, 'Exceeded mint limit')\n    \n    assert( @totalSupply + amount \u003c= @maxSupply, 'Exceeded max supply')\n    \n    _mint(to: msg.sender, amount: amount)\n  end\n  \n  sig [Address, UInt]\n  def airdrop( to:, amount: ) \n    assert(amount \u003e 0, 'Amount must be positive')\n    assert(amount \u003c= @perMintLimit, 'Exceeded mint limit')\n    \n    assert(@totalSupply + amount \u003c= @maxSupply, 'Exceeded max supply')\n    \n    _mint(to: to, amount: amount)\n  end\nend\n```\n\n\nLet's go.\n\n``` ruby\nrequire 'rubysol'\n\nrequire_relative 'erc20'\nrequire_relative 'public_mint_erc20'\n\n\ncontract = PublicMintERC20.new\n\ncontract.constructor(\n    name: 'My Fun Token', # String,\n    symbol: 'FUN',        # String,\n    maxSupply:  21000000,  #  UInt,\n    perMintLimit: 1000,    #  UInt,\n    decimals:     18,      #  UInt\n  ) \n\n\ncontract.serialize\n# {:name=\u003e\"My Fun Token\",\n#   :symbol=\u003e\"FUN\",\n#   :decimals=\u003e18,\n#   :totalSupply=\u003e0,\n#   :balanceOf=\u003e{},\n#   :allowance=\u003e{},\n#   :maxSupply=\u003e21000000,\n# :perMintLimit=\u003e1000}\n\nalice   = '0x'+'a'*40 # e.g. '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'\nbob     = '0x'+'b'*40 # e.g. '0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'\ncharlie = '0x'+'c'*40 # e.g. '0xcccccccccccccccccccccccccccccccccccccccc'\n\n\n#  sig [UInt]\n#  def mint( amount: )\n contract.msg.sender = alice\n\ncontract.mint( 100 )\ncontract.mint( 200 )\n\ncontract.msg.sender = bob\n\ncontract.mint( 300 )\ncontract.mint( 400 )\n\n#  sig [Address, UInt]\n#  def airdrop( to:, amount: ) \ncontract.airdrop( alice, 500 )\ncontract.airdrop( charlie, 600  )\n\ncontract.serialize\n# {:name=\u003e\"My Fun Token\",\n#  :symbol=\u003e\"FUN\",\n#  :decimals=\u003e18,\n#  :totalSupply=\u003e2100,\n#  :balanceOf=\u003e\n#  {\"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"=\u003e800,\n#   \"0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"=\u003e700,\n#   \"0xcccccccccccccccccccccccccccccccccccccccc\"=\u003e600},\n# :allowance=\u003e{},\n# :maxSupply=\u003e21000000,\n# :perMintLimit=\u003e1000}\n\n\n#  sig [Address, UInt],  returns: Bool\n#  def transfer( to:, amount: )\ncontract.transfer( alice, 1  )\ncontract.transfer( charlie, 2  )\n\n#  sig [Address, UInt], returns: Bool\n#  def approve( spender:, amount: ) \ncontract.approve( alice, 11 )\ncontract.approve( charlie, 22 )\n\n\n# sig [Address, Address, UInt], returns: Bool\n# def transferFrom( from:, to:, amount:)\ncontract.msg.sender = alice\n\ncontract.approve( bob, 33 )\n\ncontract.transferFrom( bob, charlie, 3 )\ncontract.transferFrom( bob, alice, 4 )\n\ncontract.serialize\n# {:name=\u003e\"My Fun Token\",\n#  :symbol=\u003e\"FUN\",\n#  :decimals=\u003e18,\n#  :totalSupply=\u003e2100,\n#  :balanceOf=\u003e \n#  {\"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"=\u003e805,\n#   \"0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"=\u003e690,\n#   \"0xcccccccccccccccccccccccccccccccccccccccc\"=\u003e605},\n#  :allowance=\u003e\n#  {\"0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"=\u003e {\n#      \"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"=\u003e4, \n#      \"0xcccccccccccccccccccccccccccccccccccccccc\"=\u003e22},\n#   \"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"=\u003e {\n#      \"0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"=\u003e33}},\n# :maxSupply=\u003e21000000,\n# :perMintLimit=\u003e1000}\n```\n\nAnd so on. That's it for now.\n\n\n\n\n\n\n## Bonus - More Blockchain (Crypto) Tools, Libraries \u0026 Scripts In Ruby\n\nSee [**/blockchain**](https://github.com/rubycocos/blockchain) \nat the ruby code commons (rubycocos) org.\n\n\n## Questions? Comments?\n\nJoin us in the [Rubidity \u0026 Rubysol (community) discord (chat server)](https://discord.gg/3JRnDUap6y). Yes you can.\nYour questions and commentary welcome.\n\nOr post them over at the [Help \u0026 Support](https://github.com/geraldb/help) page. Thanks.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xcompute%2Frubysol.starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xcompute%2Frubysol.starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xcompute%2Frubysol.starter/lists"}