{"id":15926945,"url":"https://github.com/pcaversaccio/startfeld-token-contract","last_synced_at":"2026-05-09T10:03:49.009Z","repository":{"id":105100597,"uuid":"382377666","full_name":"pcaversaccio/startfeld-token-contract","owner":"pcaversaccio","description":"This is Startfeld's ERC-20 smart contract, whose tokens are used as vouchers in their ecosystem.","archived":false,"fork":false,"pushed_at":"2023-01-01T11:26:27.000Z","size":369,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-09T02:32:16.887Z","etag":null,"topics":["blockchain","erc20","ethereum","openzeppelin","smart-contracts","solidity"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pcaversaccio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2021-07-02T14:50:17.000Z","updated_at":"2023-03-11T04:33:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad5dcde0-1ffd-43ce-9ae8-3b08ed26b5fe","html_url":"https://github.com/pcaversaccio/startfeld-token-contract","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/pcaversaccio%2Fstartfeld-token-contract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcaversaccio%2Fstartfeld-token-contract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcaversaccio%2Fstartfeld-token-contract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcaversaccio%2Fstartfeld-token-contract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pcaversaccio","download_url":"https://codeload.github.com/pcaversaccio/startfeld-token-contract/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247010270,"owners_count":20868679,"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":["blockchain","erc20","ethereum","openzeppelin","smart-contracts","solidity"],"created_at":"2024-10-06T23:00:28.587Z","updated_at":"2026-05-09T10:03:48.920Z","avatar_url":"https://github.com/pcaversaccio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Startfeld's ERC-20 Smart Contract\nThis is Startfelds's [ERC-20](https://docs.openzeppelin.com/contracts/4.x/api/token/erc20) smart contract, whose tokens are used as vouchers in their ecosystem.\n\n## Changelog\nSee the created [`CHANGELOG`](https://gitlab.appswithlove.net/startfeld/startfeld-token-contract/-/blob/main/CHANGELOG.md) file in this repository.\n\n## Installation\n### 1. Install the Truffle Framework\nWe use the Truffle framework for the compilation, testing, and deployment. Please follow their [guide](https://www.trufflesuite.com/truffle) to install the framework on your computer.\n\n### 2. Getting Started\nRun `npm i` in order to install the necessary [OpenZeppelin node modules](https://www.npmjs.com/package/@openzeppelin/contracts) as well as further required dependencies.\n\n## Compilation\nTo compile the contract, it is important that you have installed the project correctly, as we use external dependencies and contracts. Use the following command to compile the contracts: \n```\ntruffle compile\n```\n\n## Unit Tests\nSince we build the [ERC-20](https://docs.openzeppelin.com/contracts/4.x/api/token/erc20) smart contract on top of the audited [OpenZeppelin node modules](https://www.npmjs.com/package/@openzeppelin/contracts), there is no further requirement to write dedicated tests for these modules. Nonetheless, due to the fact that we integrate the non-standard [`permit`](https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#ERC20Permit-permit-address-address-uint256-uint256-uint8-bytes32-bytes32-) method, unit tests have been written for this specific extension.\n\nYou can run the tests with \n```\nnpx hardhat test\n```\n\nFurthermore, if you need to test the [`permit`](https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#ERC20Permit-permit-address-address-uint256-uint256-uint8-bytes32-bytes32-) method on one of the live test networks, run the following command to generate the function parameters (assuming [Node.js](https://nodejs.org/en) is installed):\n```\nnode .\\scripts\\sign-data.js\n```\n\n## Deployment\n### Local Deployment With Ganache\nTo deploy the contract on your local Ganache blockchain, you must first install the software on your computer. Follow the installation [guide](https://www.trufflesuite.com/ganache).\n\nOnce you installed the local blockchain, you can create a workspace. This is described [here](https://www.trufflesuite.com/docs/ganache/workspaces/creating-workspaces).\n\u003e **Note:** We have observed that Truffle and Ganache do not use the same default RPC configuration. The easiest way to align is to adjust Ganache's server hostname, port, and network ID with Truffle's configurations (check the file [`truffle-config.js`](https://gitlab.appswithlove.net/startfeld/startfeld-token-contract/-/blob/main/truffle-config.js)).\n\nOnce you are setup, just run: \n```\ntruffle migrate --network development\n```\n\n### Rinkeby\nTo deploy the smart contract to [Rinkeby](https://rinkeby.etherscan.io), you need to preconfigure first some things:\n1. Create a `secrets.json` file.\n2. Create a [MetaMask Wallet](https://metamask.io) and paste the respective seedphrase into `secrets.json`. Make sure you got some ETH. You can get some [here](https://faucet.rinkeby.io).\n3. Create a new [Infura project](https://infura.io) and copy the project key into `secrets.json`.\n4. Create a [Etherscan](https://etherscan.io) account and copy the API key to `secrets.json`.\nThe file will look like the following (make sure to always [`.gitignore`](https://gitlab.appswithlove.net/startfeld/startfeld-token-contract/-/blob/main/.gitignore) it!):\n```json\n{\n    \"seedPhrase\": \"drip voice crush ...\",\n    \"privateKey\": \"0c7342ea3cdcc0...\",\n    \"owner\": \"0x3854Ca47Abc6...\",\n    \"projectId\": \"a657e3934de84d...\",\n    \"etherscanKey\": \"RQFAFV4DE1H75P...\"\n}\n```\n\nNow run the following command:\n```\ntruffle migrate --network rinkeby\n```\n\nIf the deployment was successful, you will get the final deployment result:\n\n![Deployment Result](/assets/RinkebyDeploymentResult.png)\n\nCopy the contract address and verify the contract right away so that you can interact with it. Run the following command:\n```\ntruffle run verify Startfeld@\u003cCONTRACTADDRESS\u003e --network rinkeby\n```\n\nIf the verification was successful, you will see a similar result as follows:\n```bash\nVerifying Startfeld@0xF89BDCC76C4757C8C036bdC49cF4acE6977D6e41\nPass - Verified: https://rinkeby.etherscan.io/address/0xF89BDCC76C4757C8C036bdC49cF4acE6977D6e41#contracts\nSuccessfully verified 1 contract(s).\n```\n\nFor more information, see [here](https://github.com/rkalis/truffle-plugin-verify).\n\u003e **Note 1:** The smart contract [`Startfeld.sol`](https://gitlab.appswithlove.net/startfeld/startfeld-token-contract/-/blob/main/contracts/Startfeld.sol) does include a `premint` functionality in the constructor that creates an initial amount of 80'000 tokens for the deployer (no need anymore to separately call `mint` after the deployment).\n\n\u003e **Note 2:** The smart contract [`Startfeld.sol`](https://gitlab.appswithlove.net/startfeld/startfeld-token-contract/-/blob/main/contracts/Startfeld.sol) does include the [`permit`](https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#ERC20Permit-permit-address-address-uint256-uint256-uint8-bytes32-bytes32-) method, which can be used to change an account's ERC20 allowance (see [`IERC20.allowance`](https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#IERC20-allowance-address-address-)) by presenting a message signed by the account. By not relying on [`IERC20.approve`](https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#IERC20-approve-address-uint256-), the token holder account doesn't need to send a transaction, and thus is not required to hold Ether at all.\n\n## Interaction\nIf you deployed the smart contract succefully, you are now able to interact with it.\n\n### Local Interaction With the Truffle CLI\nTo start the Truffle JavaScript console, please run:\n```\ntruffle develop\n```\n\nIn the console, you can create an instance of the provided contract by typing:\n```javascript\nlet i = await Startfeld.deployed()\n```\n\nYou can use the instance variable to call functions like symbol:\n```javascript\ni.symbol()\n```\n\n### Rinkeby\nGo to the corresponding Etherscan link, e.g. https://rinkeby.etherscan.io/address/CONTRACTADDRESS#code. You are able to invoke READ and WRITE functions on the contract.\n\n## Test Deployments\nThe smart contract [`Startfeld.sol`](https://gitlab.appswithlove.net/startfeld/startfeld-token-contract/-/blob/main/contracts/Startfeld.sol) has been deployed across all the major test networks:\n### Version 1 (Without `permit` Functionality)\n- **Rinkeby:** [0x5c8ef4edbcae9cdd7f1b7cfef1c5848c480e347c](https://rinkeby.etherscan.io/address/0x5c8ef4edbcae9cdd7f1b7cfef1c5848c480e347c)\n- **Ropsten:** N/A\n- **Kovan:** [0x8239Dc2efeB262189e11f98cA5246eEd5AA88D4E](https://kovan.etherscan.io/address/0x8239dc2efeb262189e11f98ca5246eed5aa88d4e)\n- **Goerli:** N/A\n\n### Version 2 (With `permit` Functionality)\n- **Rinkeby:** [0xF89BDCC76C4757C8C036bdC49cF4acE6977D6e41](https://rinkeby.etherscan.io/address/0xF89BDCC76C4757C8C036bdC49cF4acE6977D6e41)\n- **Ropsten:** [0x64e9465B3B965e10f8C093729c9280aF9f1D9648](https://ropsten.etherscan.io/address/0x64e9465B3B965e10f8C093729c9280aF9f1D9648)\n- **Kovan:** [0x6B956f1f061d43721453fb8F13D34ddb2419c0fC](https://kovan.etherscan.io/address/0x6B956f1f061d43721453fb8F13D34ddb2419c0fC)\n- **Goerli:** [0xB9A82CCf8840c8DD9C082bA7b80cf6226B371477](https://goerli.etherscan.io/address/0xB9A82CCf8840c8DD9C082bA7b80cf6226B371477)\n\n## Production Deployments on SwissDLT\nThe smart contract [`Startfeld.sol`](https://gitlab.appswithlove.net/startfeld/startfeld-token-contract/-/blob/main/contracts/Startfeld.sol) has been deployed to the SwissDLT network with [Remix\u003csup\u003e*\u003c/sup\u003e ](http://remix.ethereum.org) and signed with the Startfeld hardware wallet (Ledger Nano S):\n### Version 1 (Without `permit` Functionality)\n- [SwissDLT Block Explorer](https://swissdlt.appswithlove.net)\n- Contract creation transaction hash: [0xbb15196471fdf5349bfcbe24a057f10387a8d5fcb5396c0910f581a3a531a1b9](https://swissdlt.appswithlove.net/tx/0xbb15196471fdf5349bfcbe24a057f10387a8d5fcb5396c0910f581a3a531a1b9)\n- **Contract address:** [0xfc9ad717cc2781c837024f6bb2634381007fb6c1](https://swissdlt.appswithlove.net/address/0xfc9ad717cc2781c837024f6bb2634381007fb6c1)\n- **Contract admin:** [0xa4d7a3cbfe2923b57dc68dead6692c3410c5605b](https://swissdlt.appswithlove.net/address/0xa4d7a3cbfe2923b57dc68dead6692c3410c5605b)\n- Contract Application Binary Interface (ABI): Can be downloaded from the [snippet](https://gitlab.appswithlove.net/startfeld/startfeld-token-contract/-/snippets/15). This file was copied from Remix after compilation.\n\n### Version 2 (With `permit` Functionality)\n- [SwissDLT Block Explorer](https://swissdlt.appswithlove.net)\n- Contract creation transaction hash: [0x69d97aee3231c9ce7781108265c9db1ae01b9b38058a1bb5845d8d5e692daf80](https://swissdlt.appswithlove.net/tx/0x69d97aee3231c9ce7781108265c9db1ae01b9b38058a1bb5845d8d5e692daf80)\n- **Contract address:** [0xc6ffB8032eebe96338B54757e8960aBd426fD43B](https://swissdlt.appswithlove.net/address/0xc6ffB8032eebe96338B54757e8960aBd426fD43B)\n- **Contract admin:** [0xa4d7a3cBFe2923b57Dc68DeAd6692C3410c5605b](https://swissdlt.appswithlove.net/address/0xa4d7a3cBFe2923b57Dc68DeAd6692C3410c5605b)\n- Contract Application Binary Interface (ABI): Can be downloaded from the [snippet](https://gitlab.appswithlove.net/startfeld/startfeld-token-contract/-/snippets/14). This file was copied from Remix after compilation.\n\u003e **Note 1:** Make sure that you always copy the full smart contract ABI and not just one of the inherited interfaces!\n\n\u003e **Note 2:** Remix uses checksummed addresses for the `At Address` button and if it's invalid the button is disabled. Always use checksummed addresses with Remix! One way to handle this is by using [EthSum](https://ethsum.netlify.app). The checksum algorithm is laid out in full detail [here](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md). \n\n\u003csup\u003e*\u003c/sup\u003e Remix deployment configuration:\n- **Version 1 (Without `permit` Functionality)**\n  - Compiler: `0.6.7+commit.b8d736ae`;\n  - Language: `Solidity`;\n  - EVM Version: `compiler default`;\n  - Enable optimization: `200`;\n  - Only the smart contract [`Startfeld.sol`](https://gitlab.appswithlove.net/startfeld/startfeld-token-contract/-/blob/main/contracts/Startfeld.sol) was used for compilation and deployment. Remix imported the dependencies successfully (see [here](https://remix-ide.readthedocs.io/en/latest/import.html) how this works in the background with the `.deps` folder);\n- **Version 2 (With `permit` Functionality)**\n  - Compiler: `0.8.6+commit.11564f7e`;\n  - Language: `Solidity`;\n  - EVM Version: `compiler default`;\n  - Enable optimization: `200`;\n  - Only the smart contract [`Startfeld.sol`](https://gitlab.appswithlove.net/startfeld/startfeld-token-contract/-/blob/main/contracts/Startfeld.sol) was used for compilation and deployment. Remix imported the dependencies successfully (see [here](https://remix-ide.readthedocs.io/en/latest/import.html) how this works in the background with the `.deps` folder);\n\n## Further References\n[1] https://docs.openzeppelin.com/contracts/4.x/erc20\n\n[2] https://github.com/rkalis/truffle-plugin-verify\n\n[3] https://www.trufflesuite.com/ganache\n\n[4] https://www.trufflesuite.com/truffle\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcaversaccio%2Fstartfeld-token-contract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpcaversaccio%2Fstartfeld-token-contract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcaversaccio%2Fstartfeld-token-contract/lists"}