{"id":21347175,"url":"https://github.com/kybernetwork/ieo-smart-contracts","last_synced_at":"2025-10-16T11:16:37.967Z","repository":{"id":92548216,"uuid":"130553257","full_name":"KyberNetwork/ieo-smart-contracts","owner":"KyberNetwork","description":"smart contracts for ieo platform","archived":false,"fork":false,"pushed_at":"2018-07-11T11:48:11.000Z","size":171,"stargazers_count":10,"open_issues_count":0,"forks_count":159,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-12T17:43:36.884Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KyberNetwork.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-04-22T09:29:45.000Z","updated_at":"2024-01-05T01:36:50.000Z","dependencies_parsed_at":"2023-03-07T02:15:49.145Z","dependency_job_id":null,"html_url":"https://github.com/KyberNetwork/ieo-smart-contracts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KyberNetwork/ieo-smart-contracts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyberNetwork%2Fieo-smart-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyberNetwork%2Fieo-smart-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyberNetwork%2Fieo-smart-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyberNetwork%2Fieo-smart-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KyberNetwork","download_url":"https://codeload.github.com/KyberNetwork/ieo-smart-contracts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyberNetwork%2Fieo-smart-contracts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279182665,"owners_count":26121229,"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","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-22T02:12:56.445Z","updated_at":"2025-10-16T11:16:37.962Z","avatar_url":"https://github.com/KyberNetwork.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kyber Initial Exchange Offering\nIn this document, we describe the initial exchange offering specification and implementation,\nand give an overview over the smart contracts structure.\n\n## Informal Specification\nAn initial exchange offering (IEO) is very similar to initial coin offering (ICO), however,\nas oppose to standard token generation event (TGE, aka ICO), the tokens are generated before the IEO, and portion of them is transfered to the IEO contract, where user can exchange (buy) them in return to Ether.\nIt should be noted that in parallel these tokens could also be offered for sale (exchange) in other venues or platforms. Allocation for specific individuals and entities like advisors or pre-sale contributors is not done in the scope of the IEO.\n\nThe IEO is open only for registered users.\nThe list of registered users is not visible to the contract. Instead a dedicated server (that holds a dedicated private key) signs special data to prove to the contract the user has done the registeration process.\n\nThe IEO process takes place in two stages.\nIn the first stage, user ETH contribution is limited by a global per user cap.\nIn the second stage, (registered) users can make any size of contribution, until token supply is depleted.\nIt should be noted that the first or the second stage could be of 0 time. I.e., it is possible to execute a sell('exchange') that has only stage one or only stage two.\n\nThere is no ETH hard cap on the amount of contributions, however the limited supply of tokens dictates hard cap on number of sold tokens.\n\nAs an auxiliary feature, we also implemented a wrapper that allows user to contribute to the IEO with tokens that are tradable at kyber network exchange.\nNamely, user can contribute with OMG tokens and receive tokens that are for sale in the IEO.\n\n## Detailed description\n\n### Overview of flow\nDenote by T the start time of the IEO.\n\n0. The contract `KyberIEOWrapper.sol` is deployed once and can be used across all of our IEOs.\n\n1. On T - 1 month, users can register in kyber.network website.\n\n1. On T - 5 days, we deploy `KyberIEO.sol` and ask the token project to transfer tokens to that contract.\nTwo special addresses are set. The first is the `kyberIEO` operator which signs user messages to prove they registered. The second one is the `IEORate` operator which can set token to ETH conversion rate at any time (if the rate is supposed to be fixed along the IEO, the operator can be set to a dummy adddress).\n\n2. On T, the sale starts. At this point users can buy tokens according to the global per user cap.\nIt is possible to buy several times, as long as cap is not exceeded.\nIn order to participate in the sale they have to log-in into our website. A dedicated server will sign their contribution address, IEO id, and a user id, and will transmit their contribution transaction to the contract.\n\n4. On T+X, the open sale starts. At this point registered users can buy tokens with any amount.\n\n5. On T+X+Y, the sale ends. Unsold tokens are extracted from the contract.\n\n### Per module description\nThe system has 3 modules, namely, IEO, Rate and Wrapper.\n\n#### IEO\nImplemented in `KyberIEO.sol`.\nThe module takes care of the token sale process and manages user cap accounting.\nIn addition, it deploys `IEORate.sol` contract which can set the conversion rate.\n\nThree accounts play special role in this contract, namely, admin, operator and alerter (optional).\nThe admin account in controlled by a cold wallet (or a multisig) and can extract tokens from the contract. In addition it can assign operators and alerters.\nThe operator can sign registered user contribution. It will typically be in a hot wallet (server), though it need not hold any funds.\nThe alerter can only halt the IEO process in case it detects something wrong. \nIn this case, only the admin account can resume the IEO.\nMultiple alerters and operators can be defined.\n\n#### Rate\nImplemented in `IEORate.sol`.\nCan set token to ETH conversion rate.\nThe main role of the admin is to assign operator(s). In addition it can extract any funds (tokens) that were accidentally sent over to the contract.\nThe operator account can set the rate.\n\n#### Wrapper\nImplemented in `KyberIEOWrapper`.\nWrapper is an auxiliary layer that can convert user tokens to ETH and direct the ETH to the IEO contract and make a contribution on behalf of the `msg.sender` (all in one tx).\nThis contract is planned to be deployed only once.\nThe concrete addresses of the IEO and kyber network contracts are given as input parameters in every function call.\nIn this contract, admin role is only to extract tokens that were sent to this contract by mistake.\n\n### Use of zeppelin code\nWe use open-zeppling code for `SafeMath`.\n\n\n# Known Issues\n## Rate can be adjusted during the token sale\nAllowing operator to change rate during the token sale period could lead to front running, where operator set higher (worse) rate after user sent the contribution transaction.\nHowever, in initial token sale is a process that by definition requires a certain degree of trust in the issuing company. Hence, this issue can be mitigated by clearly conveying the rate update policy.\n\nAnother potential issue is potnentially giving privilage to a server (hot wallet) to set rates, or invalid rates set by fat finger.\nFor this purpose, projects who wish to eliminate this option, could set operator to an invalid address no one controls.\n\n# Deployment script\nSee `deployment_script` directory.\nFor regression test run:\n1. `npm install`\n2. `testrpc`\n3. `./node_modules/.bin/truffle test`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkybernetwork%2Fieo-smart-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkybernetwork%2Fieo-smart-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkybernetwork%2Fieo-smart-contracts/lists"}