{"id":17246523,"url":"https://github.com/andreid/usd0x","last_synced_at":"2025-03-26T05:25:12.333Z","repository":{"id":46557638,"uuid":"515442621","full_name":"AndreiD/usd0x","owner":"AndreiD","description":"code for usd0x","archived":false,"fork":false,"pushed_at":"2023-01-24T14:40:54.000Z","size":375,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T07:14:11.357Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndreiD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-19T05:10:03.000Z","updated_at":"2022-07-19T05:49:59.000Z","dependencies_parsed_at":"2023-02-13T22:30:49.463Z","dependency_job_id":null,"html_url":"https://github.com/AndreiD/usd0x","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/AndreiD%2Fusd0x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreiD%2Fusd0x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreiD%2Fusd0x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreiD%2Fusd0x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndreiD","download_url":"https://codeload.github.com/AndreiD/usd0x/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245593820,"owners_count":20641139,"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":[],"created_at":"2024-10-15T06:34:15.683Z","updated_at":"2025-03-26T05:25:12.312Z","avatar_url":"https://github.com/AndreiD.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"usdx\n\n\nWe will explore the basics of creating a Hardhat project with a sample contract, tests of that contract, and a script to deploy it.\n\nTo create the sample project, run npx hardhat in your project folder:\n\n$ npx hardhat\n888    888                      888 888               888\n888    888                      888 888               888\n888    888                      888 888               888\n8888888888  8888b.  888d888 .d88888 88888b.   8888b.  888888\n888    888     \"88b 888P\"  d88\" 888 888 \"88b     \"88b 888\n888    888 .d888888 888    888  888 888  888 .d888888 888\n888    888 888  888 888    Y88b 888 888  888 888  888 Y88b.\n888    888 \"Y888888 888     \"Y88888 888  888 \"Y888888  \"Y888\n\n👷 Welcome to Hardhat v2.9.9 👷‍\n\n? What do you want to do? …\n❯ Create a JavaScript project\n  Create a TypeScript project\n  Create an empty hardhat.config.js\n  Quit\nLet’s create the JavaScript or TypeScript project and go through these steps to compile, test and deploy the sample contract. We recommend using TypeScript, but if you are not familiar with it just pick JavaScript.\n\n#Running tasks\nTo first get a quick sense of what's available and what's going on, run npx hardhat in your project folder:\n\n$ npx hardhat\nHardhat version 2.9.9\n\nUsage: hardhat [GLOBAL OPTIONS] \u003cTASK\u003e [TASK OPTIONS]\n\nGLOBAL OPTIONS:\n\n  --config              A Hardhat config file.\n  --emoji               Use emoji in messages.\n  --help                Shows this message, or a task's help if its name is provided\n  --max-memory          The maximum amount of memory that Hardhat can use.\n  --network             The network to connect to.\n  --show-stack-traces   Show stack traces.\n  --tsconfig            A TypeScript config file.\n  --verbose             Enables Hardhat verbose logging\n  --version             Shows hardhat's version.\n\n\nAVAILABLE TASKS:\n\n  check                 Check whatever you need\n  clean                 Clears the cache and deletes all artifacts\n  compile               Compiles the entire project, building all artifacts\n  console               Opens a hardhat console\n  coverage              Generates a code coverage report for tests\n  flatten               Flattens and prints contracts and their dependencies\n  help                  Prints this message\n  node                  Starts a JSON-RPC server on top of Hardhat Network\n  run                   Runs a user-defined script after compiling the project\n  test                  Runs mocha tests\n  typechain             Generate Typechain typings for compiled contracts\n  verify                Verifies contract on Etherscan\n\nTo get help for a specific task run: npx hardhat help [task]\nThe list of available tasks includes the built-in ones and also those that came with any installed plugins. npx hardhat is your starting point to find out what tasks are available to run.\n\n#Compiling your contracts\nNext, if you take a look in the contracts/ folder, you'll see Lock.sol:\n\n// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.9;\n\n// Import this file to use console.log\nimport \"hardhat/console.sol\";\n\ncontract Lock {\n    uint public unlockTime;\n    address payable public owner;\n\n    event Withdrawal(uint amount, uint when);\n\n    constructor(uint _unlockTime) payable {\n        require(\n            block.timestamp \u003c _unlockTime,\n            \"Unlock time should be in the future\"\n        );\n\n        unlockTime = _unlockTime;\n        owner = payable(msg.sender);\n    }\n\n    function withdraw() public {\n        // Uncomment this line to print a log in your terminal\n        // console.log(\"Unlock time is %o and block timestamp is %o\", unlockTime, block.timestamp);\n\n        require(block.timestamp \u003e= unlockTime, \"You can't withdraw yet\");\n        require(msg.sender == owner, \"You aren't the owner\");\n\n        emit Withdrawal(address(this).balance, block.timestamp);\n\n        owner.transfer(address(this).balance);\n    }\n}\n\nTo compile it, simply run:\n\nnpx hardhat compile\nIf you created a TypeScript project, this task will also generate TypeScript bindings using TypeChain.\n\n#Testing your contracts\nYour project comes with tests that use Mocha, Chai, and Ethers.js.\n\nIf you take a look in the test/ folder, you'll see a test file:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreid%2Fusd0x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreid%2Fusd0x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreid%2Fusd0x/lists"}