├── .env.example ├── .gitignore ├── LICENSE ├── README.md ├── config-overrides.js ├── contracts ├── .gitignore ├── README.md ├── contracts │ ├── DeprecatedStormSender.sol │ ├── EternalStorage.sol │ ├── EternalStorageProxyForStormMultisender.sol │ ├── Migrations.sol │ ├── OwnedUpgradeabilityProxy.sol │ ├── OwnedUpgradeabilityStorage.sol │ ├── Proxy.sol │ ├── SafeMath.sol │ ├── UpgradeabilityOwnerStorage.sol │ ├── UpgradeabilityProxy.sol │ ├── UpgradeabilityStorage.sol │ └── multisender │ │ ├── Claimable.sol │ │ ├── Ownable.sol │ │ └── UpgradebleStormSender.sol ├── flats │ ├── EternalStorageProxyForStormMultisender_flat.sol │ └── UpgradebleStormSender_flat.sol ├── migrations │ └── 1_initial_migration.js ├── package-lock.json ├── package.json ├── truffle-config.js └── truffle.js ├── demo.gif ├── package-lock.json ├── package.json ├── public ├── favicon │ ├── android-chrome-192x192.png │ ├── android-chrome-256x256.png │ ├── apple-touch-icon.png │ ├── browserconfig.xml │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon.ico │ ├── mstile-150x150.png │ └── site.webmanifest ├── fb.png ├── illustration.png ├── index.html └── manifest.json ├── src ├── App.js ├── abis │ ├── ERC20ABI.json │ └── StormMultisender.json ├── assets │ ├── images │ │ ├── .gitkeep │ │ ├── illustration.png │ │ ├── illustration@2x.png │ │ ├── light@2x.png │ │ ├── logo.png │ │ ├── logo@2x.png │ │ ├── socials.png │ │ └── socials@2x.png │ └── stylesheets │ │ ├── application.css │ │ ├── application.scss │ │ ├── application │ │ ├── base.scss │ │ ├── controls.scss │ │ ├── fonts.scss │ │ ├── header.scss │ │ ├── send-info.scss │ │ ├── socials.scss │ │ ├── table.scss │ │ └── transactions.scss │ │ ├── helpers │ │ ├── mixins.scss │ │ ├── placeholders.scss │ │ └── variables.scss │ │ └── react-select.min.css ├── components │ ├── 1.js │ ├── 2.js │ ├── 3.js │ ├── 4.js │ ├── 5.js │ ├── Header.js │ ├── Retry.js │ ├── Welcome.js │ ├── example.csv │ ├── example.json │ └── index.js ├── generateElement.js ├── getToken.js ├── getWeb3.js ├── index.js └── stores │ ├── UiStore.js │ ├── autosave.js │ ├── gasPriceStore.js │ ├── tokenStore.js │ ├── txStore.js │ └── web3Store.js ├── tsconfig.json └── yarn.lock /.env.example: -------------------------------------------------------------------------------- 1 | REACT_APP_PROXY_MULTISENDER=0x -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | build -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Demo](demo.gif) 2 | # Problem: 3 | Previously in Ethereum Network, additional tools were required in order to transfer many ERC20 tokens at once. 4 | Many people still do this manually, one transaction at a time. This process is time consuming and prone to an error. 5 | 6 | # Solution: 7 | This Dapp allows a user to send thousands of token transfers in a very effecient way by batching them in groups of 145 token transfers per Ethereum transaction. This automation saves time by automatically generating transactions to MetaMask. Finally, this tool allows a user to maintain security of their account by delegating the trust of their private keys to a secure MetaMask wallet. 8 | 9 | # How to use: 10 | 1. Install [Metamask](https://metamask.io). 11 | 2. Make sure you have an account in MetaMask which has a token balance. 12 | 3. Make sure your MetaMask is pointed to the network that you would like to use. 13 | 4. Make sure your MetaMask account is unlocked. 14 | 5. Go to https://rstormsf.github.io/multisender/#/ 15 | 6. Wait for the full page to load. 16 | 7. Select a token from the dropdown that you would like to send. 17 | 8. Provide either JSON or CSV text in the textarea (see example below). 18 | 9. Click next. 19 | 10. If everything looks good, click next once again. 20 | 11. Wait for MetaMask to generate an approval transaction. 21 | 12. Once the approval transaction is mined, MetaMask will generate as many transactions as needed for your token transfers (145 addresses per tx). 22 | 13. Done! 23 | 24 | You can test this tool on any test network, if you want to make sure that 25 | everything will work as expected. 26 | 27 | Contracts deployed: 28 | Mainnet, Rinkeby, Kovan, Ropsten, Sokol, CORE-POA: 29 | ProxyStorage: 0xa5025faba6e70b84f74e9b1113e5f7f4e7f4859f 30 | 31 | Example JSON: 32 | ```json 33 | 34 | [ 35 | {"0xCBA5018De6b2b6F89d84A1F5A68953f07554765e":"12"}, 36 | {"0xa6Bf70bd230867c870eF13631D7EFf1AE8Ab85c9":"1123.45645"}, 37 | {"0x00b5F428905DEA1a67940093fFeaCeee58cA91Ae":"1.049"}, 38 | {"0x00fC79F38bAf0dE21E1fee5AC4648Bc885c1d774":"14546"} 39 | ] 40 | ``` 41 | Example CSV: 42 | ```csv 43 | 0xCBA5018De6b2b6F89d84A1F5A68953f07554765e,12 44 | 0xa6Bf70bd230867c870eF13631D7EFf1AE8Ab85c9,1123.45645 45 | 0x00b5F428905DEA1a67940093fFeaCeee58cA91Ae,1.049 46 | 0x00fC79F38bAf0dE21E1fee5AC4648Bc885c1d774,14546 47 | ``` 48 | ``` 49 | Proof of work: 50 | https://etherscan.io/tx/0x2fd09c03609f3f34a326983f1c685ea1bcb87dfcaabc12932dbe38d2c453f2c8 51 | https://kovan.etherscan.io/tx/0x755b84a8a61fd82c1410f6bbbb452c94ddf12fac5b1daaa1496671bcd6e21882 52 | 53 | ``` 54 | 55 | # How to setup dev environment 56 | 57 | 1. git clone git@github.com:rstormsf/multisender.git 58 | 2. cd contracts 59 | 3. I used `node -v v9.7.1` 60 | 4. npm install 61 | 5. deploy MultiSender contract OR use existing deployed version: 0xa5025faba6e70b84f74e9b1113e5f7f4e7f4859f 62 | currenty deployed on Kovan, Rinkeby, Ropsten, POA-network, POA-Sokol, Mainnet 63 | Instructions on how to deploy it is listed below. 64 | 6. cd .. 65 | 7. npm install 66 | 8. cp .env.example .env 67 | 9. open .env file and provide an address of multisender contract 68 | 10. npm run start 69 | 70 | # Contract Deployment 71 | 72 | There are 2 ways to deploy the contracts: Upgradable and non-upgradable way. 73 | Non-upgrdable: 74 | - cd contracts 75 | - npm run flatten 76 | - take `flats/UpgradebleStormSender_flat.sol` and deploy it using https://remix.ethereum.org/ 77 | - select solidity 0.4.23 version in settings 78 | - once deployed, call `initialize` function with parameter address of owner's contract 79 | 80 | # Disclaimer 81 | This tool is not affiliated with https://poa.network 82 | This is a personal project of Roman Storm. 83 | 84 | He is not responsible for any loss from transactions derived by MultiSender. Some of the underlying JavaScript libraries and Ethereum tools that were used are under active development. The website and smart contract has been thoroughly tested, there is always the possibility something unexpected happens resulting in losses of Ethereum and/or tokens. 85 | 86 | Any ERC20 tokens you transfer to the Multisender will be sent out to the addresses that you provided. 87 | 88 | The smart contract source code can be audited by anyone in this repository. 89 | 90 | I encourage you to assess its security before using the Mutlisender Dapp. 91 | -------------------------------------------------------------------------------- /config-overrides.js: -------------------------------------------------------------------------------- 1 | const rewireMobX = require('react-app-rewire-mobx'); 2 | // const rewirePreact = require('react-app-rewire-preact'); 3 | // const {injectBabelPlugin} = require('react-app-rewired'); 4 | 5 | /* config-overrides.js */ 6 | module.exports = function override(config, env) { 7 | // add a plugin 8 | // config = injectBabelPlugin('emotion/babel',config) 9 | 10 | // use the Preact rewire 11 | if (env === "production") { 12 | console.log("⚡ Production build with Preact"); 13 | // config = rewirePreact(config, env); 14 | } 15 | 16 | // use the MobX rewire 17 | config = rewireMobX(config,env); 18 | 19 | return config; 20 | } -------------------------------------------------------------------------------- /contracts/.gitignore: -------------------------------------------------------------------------------- 1 | build -------------------------------------------------------------------------------- /contracts/README.md: -------------------------------------------------------------------------------- 1 | To flatten: 2 | 1. 3 | ``` 4 | npm install 5 | ``` 6 | 2. 7 | ``` 8 | ./node_modules/.bin/truffle-flattener contracts/EternalStorageProxyForStormMultisender.sol > flats/EternalStorageProxyForStormMultisender_flat.sol 9 | ./node_modules/.bin/truffle-flattener contracts/multisender/UpgradebleStormSender.sol > flats/UpgradebleStormSender_flat.sol 10 | ``` -------------------------------------------------------------------------------- /contracts/contracts/DeprecatedStormSender.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity 0.4.23; 4 | 5 | 6 | /** 7 | * @title ERC20Basic 8 | * @dev Simpler version of ERC20 interface 9 | * @dev see https://github.com/ethereum/EIPs/issues/179 10 | */ 11 | contract ERC20Basic { 12 | function totalSupply() public view returns (uint256); 13 | function balanceOf(address who) public view returns (uint256); 14 | function transfer(address to, uint256 value) public returns (bool); 15 | event Transfer(address indexed from, address indexed to, uint256 value); 16 | } 17 | 18 | 19 | contract ERC20 is ERC20Basic { 20 | function allowance(address owner, address spender) public view returns (uint256); 21 | function transferFrom(address from, address to, uint256 value) public returns (bool); 22 | function approve(address spender, uint256 value) public returns (bool); 23 | event Approval(address indexed owner, address indexed spender, uint256 value); 24 | } 25 | 26 | 27 | contract MultiSender { 28 | mapping(address => uint256) public txCount; 29 | address public owner; 30 | address public pendingOwner; 31 | uint16 public arrayLimit = 150; 32 | uint256 public discountStep = 0.00005 ether; 33 | uint256 public fee = 0.05 ether; 34 | 35 | event Multisended(uint256 total, address tokenAddress); 36 | event ClaimedTokens(address token, address owner, uint256 balance); 37 | 38 | modifier onlyOwner() { 39 | assert(msg.sender == owner); 40 | _; 41 | } 42 | 43 | modifier hasFee() { 44 | require(msg.value >= fee - discountRate(msg.sender)); 45 | _; 46 | } 47 | 48 | function MultiSender(address _owner, address _pendingOwner) public { 49 | owner = _owner; 50 | pendingOwner = _pendingOwner; 51 | } 52 | 53 | function() public payable {} 54 | 55 | function discountRate(address _customer) public view returns(uint256) { 56 | uint256 count = txCount[_customer]; 57 | return count * discountStep; 58 | } 59 | 60 | function currentFee(address _customer) public view returns(uint256) { 61 | return fee - discountRate(_customer); 62 | } 63 | 64 | function claimOwner(address _newPendingOwner) public { 65 | require(msg.sender == pendingOwner); 66 | owner = pendingOwner; 67 | pendingOwner = _newPendingOwner; 68 | } 69 | 70 | function changeTreshold(uint16 _newLimit) public onlyOwner { 71 | arrayLimit = _newLimit; 72 | } 73 | 74 | function changeFee(uint256 _newFee) public onlyOwner { 75 | fee = _newFee; 76 | } 77 | 78 | function changeDiscountStep(uint256 _newStep) public onlyOwner { 79 | discountStep = _newStep; 80 | } 81 | 82 | function multisendToken(address token, address[] _contributors, uint256[] _balances) public hasFee payable { 83 | uint256 total = 0; 84 | require(_contributors.length <= arrayLimit); 85 | ERC20 erc20token = ERC20(token); 86 | uint8 i = 0; 87 | require(erc20token.allowance(msg.sender, this) > 0); 88 | for (i; i < _contributors.length; i++) { 89 | erc20token.transferFrom(msg.sender, _contributors[i], _balances[i]); 90 | total += _balances[i]; 91 | } 92 | txCount[msg.sender]++; 93 | Multisended(total, token); 94 | } 95 | 96 | function multisendEther(address[] _contributors, uint256[] _balances) public hasFee payable { 97 | // this function is always free, however if there is anything left over, I will keep it. 98 | uint256 total = 0; 99 | require(_contributors.length <= arrayLimit); 100 | uint8 i = 0; 101 | for (i; i < _contributors.length; i++) { 102 | _contributors[i].transfer(_balances[i]); 103 | total += _balances[i]; 104 | } 105 | txCount[msg.sender]++; 106 | Multisended(total, address(0)); 107 | } 108 | 109 | function claimTokens(address _token) public onlyOwner { 110 | if (_token == 0x0) { 111 | owner.transfer(this.balance); 112 | return; 113 | } 114 | ERC20 erc20token = ERC20(_token); 115 | uint256 balance = erc20token.balanceOf(this); 116 | erc20token.transfer(owner, balance); 117 | ClaimedTokens(_token, owner, balance); 118 | } 119 | } -------------------------------------------------------------------------------- /contracts/contracts/EternalStorage.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity 0.4.23; 4 | 5 | 6 | /** 7 | * @title EternalStorage 8 | * @dev This contract holds all the necessary state variables to carry out the storage of any contract. 9 | */ 10 | contract EternalStorage { 11 | 12 | mapping(bytes32 => uint256) internal uintStorage; 13 | mapping(bytes32 => string) internal stringStorage; 14 | mapping(bytes32 => address) internal addressStorage; 15 | mapping(bytes32 => bytes) internal bytesStorage; 16 | mapping(bytes32 => bool) internal boolStorage; 17 | mapping(bytes32 => int256) internal intStorage; 18 | 19 | } -------------------------------------------------------------------------------- /contracts/contracts/EternalStorageProxyForStormMultisender.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity 0.4.23; 4 | 5 | import "./EternalStorage.sol"; 6 | import "./OwnedUpgradeabilityProxy.sol"; 7 | 8 | 9 | /** 10 | * @title EternalStorageProxy 11 | * @dev This proxy holds the storage of the token contract and delegates every call to the current implementation set. 12 | * Besides, it allows to upgrade the token's behaviour towards further implementations, and provides basic 13 | * authorization control functionalities 14 | */ 15 | contract EternalStorageProxyForStormMultisender is OwnedUpgradeabilityProxy, EternalStorage { 16 | 17 | function EternalStorageProxyForStormMultisender(address _owner) public OwnedUpgradeabilityProxy(_owner) {} 18 | 19 | } 20 | -------------------------------------------------------------------------------- /contracts/contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity ^0.4.17; 4 | 5 | contract Migrations { 6 | address public owner; 7 | uint public last_completed_migration; 8 | 9 | modifier restricted() { 10 | if (msg.sender == owner) _; 11 | } 12 | 13 | function Migrations() public { 14 | owner = msg.sender; 15 | } 16 | 17 | function setCompleted(uint completed) public restricted { 18 | last_completed_migration = completed; 19 | } 20 | 21 | function upgrade(address new_address) public restricted { 22 | Migrations upgraded = Migrations(new_address); 23 | upgraded.setCompleted(last_completed_migration); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /contracts/contracts/OwnedUpgradeabilityProxy.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity 0.4.23; 4 | 5 | import "./UpgradeabilityProxy.sol"; 6 | import "./UpgradeabilityOwnerStorage.sol"; 7 | 8 | 9 | /** 10 | * @title OwnedUpgradeabilityProxy 11 | * @dev This contract combines an upgradeability proxy with basic authorization control functionalities 12 | */ 13 | contract OwnedUpgradeabilityProxy is UpgradeabilityOwnerStorage, UpgradeabilityProxy { 14 | /** 15 | * @dev Event to show ownership has been transferred 16 | * @param previousOwner representing the address of the previous owner 17 | * @param newOwner representing the address of the new owner 18 | */ 19 | event ProxyOwnershipTransferred(address previousOwner, address newOwner); 20 | 21 | /** 22 | * @dev the constructor sets the original owner of the contract to the sender account. 23 | */ 24 | function OwnedUpgradeabilityProxy(address _owner) public { 25 | setUpgradeabilityOwner(_owner); 26 | } 27 | 28 | /** 29 | * @dev Throws if called by any account other than the owner. 30 | */ 31 | modifier onlyProxyOwner() { 32 | require(msg.sender == proxyOwner()); 33 | _; 34 | } 35 | 36 | /** 37 | * @dev Tells the address of the proxy owner 38 | * @return the address of the proxy owner 39 | */ 40 | function proxyOwner() public view returns (address) { 41 | return upgradeabilityOwner(); 42 | } 43 | 44 | /** 45 | * @dev Allows the current owner to transfer control of the contract to a newOwner. 46 | * @param newOwner The address to transfer ownership to. 47 | */ 48 | function transferProxyOwnership(address newOwner) public onlyProxyOwner { 49 | require(newOwner != address(0)); 50 | ProxyOwnershipTransferred(proxyOwner(), newOwner); 51 | setUpgradeabilityOwner(newOwner); 52 | } 53 | 54 | /** 55 | * @dev Allows the upgradeability owner to upgrade the current version of the proxy. 56 | * @param version representing the version name of the new implementation to be set. 57 | * @param implementation representing the address of the new implementation to be set. 58 | */ 59 | function upgradeTo(string version, address implementation) public onlyProxyOwner { 60 | _upgradeTo(version, implementation); 61 | } 62 | 63 | /** 64 | * @dev Allows the upgradeability owner to upgrade the current version of the proxy and call the new implementation 65 | * to initialize whatever is needed through a low level call. 66 | * @param version representing the version name of the new implementation to be set. 67 | * @param implementation representing the address of the new implementation to be set. 68 | * @param data represents the msg.data to bet sent in the low level call. This parameter may include the function 69 | * signature of the implementation to be called with the needed payload 70 | */ 71 | function upgradeToAndCall(string version, address implementation, bytes data) payable public onlyProxyOwner { 72 | upgradeTo(version, implementation); 73 | require(this.call.value(msg.value)(data)); 74 | } 75 | } -------------------------------------------------------------------------------- /contracts/contracts/OwnedUpgradeabilityStorage.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity 0.4.23; 4 | 5 | import "./EternalStorage.sol"; 6 | import "./UpgradeabilityStorage.sol"; 7 | import "./UpgradeabilityOwnerStorage.sol"; 8 | 9 | 10 | /** 11 | * @title OwnedUpgradeabilityStorage 12 | * @dev This is the storage necessary to perform upgradeable contracts. 13 | * This means, required state variables for upgradeability purpose and eternal storage per se. 14 | */ 15 | contract OwnedUpgradeabilityStorage is UpgradeabilityOwnerStorage, UpgradeabilityStorage, EternalStorage {} -------------------------------------------------------------------------------- /contracts/contracts/Proxy.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity 0.4.23; 4 | 5 | 6 | /** 7 | * @title Proxy 8 | * @dev Gives the possibility to delegate any call to a foreign implementation. 9 | */ 10 | contract Proxy { 11 | 12 | /** 13 | * @dev Fallback function allowing to perform a delegatecall to the given implementation. 14 | * This function will return whatever the implementation call returns 15 | */ 16 | function () public payable { 17 | address _impl = implementation(); 18 | require(_impl != address(0)); 19 | bytes memory data = msg.data; 20 | 21 | assembly { 22 | let result := delegatecall(gas, _impl, add(data, 0x20), mload(data), 0, 0) 23 | let size := returndatasize 24 | 25 | let ptr := mload(0x40) 26 | returndatacopy(ptr, 0, size) 27 | 28 | switch result 29 | case 0 { revert(ptr, size) } 30 | default { return(ptr, size) } 31 | } 32 | } 33 | 34 | /** 35 | * @dev Tells the address of the implementation where every call will be delegated. 36 | * @return address of the implementation to which it will be delegated 37 | */ 38 | function implementation() public view returns (address); 39 | } -------------------------------------------------------------------------------- /contracts/contracts/SafeMath.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity 0.4.23; 4 | 5 | 6 | /** 7 | * @title SafeMath 8 | * @dev Math operations with safety checks that throw on error 9 | */ 10 | library SafeMath { 11 | 12 | /** 13 | * @dev Multiplies two numbers, throws on overflow. 14 | */ 15 | function mul(uint256 a, uint256 b) internal pure returns (uint256) { 16 | if (a == 0) { 17 | return 0; 18 | } 19 | uint256 c = a * b; 20 | assert(c / a == b); 21 | return c; 22 | } 23 | 24 | /** 25 | * @dev Integer division of two numbers, truncating the quotient. 26 | */ 27 | function div(uint256 a, uint256 b) internal pure returns (uint256) { 28 | // assert(b > 0); // Solidity automatically throws when dividing by 0 29 | uint256 c = a / b; 30 | // assert(a == b * c + a % b); // There is no case in which this doesn't hold 31 | return c; 32 | } 33 | 34 | /** 35 | * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). 36 | */ 37 | function sub(uint256 a, uint256 b) internal pure returns (uint256) { 38 | assert(b <= a); 39 | return a - b; 40 | } 41 | 42 | /** 43 | * @dev Adds two numbers, throws on overflow. 44 | */ 45 | function add(uint256 a, uint256 b) internal pure returns (uint256) { 46 | uint256 c = a + b; 47 | assert(c >= a); 48 | return c; 49 | } 50 | } -------------------------------------------------------------------------------- /contracts/contracts/UpgradeabilityOwnerStorage.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity 0.4.23; 4 | 5 | 6 | /** 7 | * @title UpgradeabilityOwnerStorage 8 | * @dev This contract keeps track of the upgradeability owner 9 | */ 10 | contract UpgradeabilityOwnerStorage { 11 | // Owner of the contract 12 | address private _upgradeabilityOwner; 13 | 14 | /** 15 | * @dev Tells the address of the owner 16 | * @return the address of the owner 17 | */ 18 | function upgradeabilityOwner() public view returns (address) { 19 | return _upgradeabilityOwner; 20 | } 21 | 22 | /** 23 | * @dev Sets the address of the owner 24 | */ 25 | function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal { 26 | _upgradeabilityOwner = newUpgradeabilityOwner; 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /contracts/contracts/UpgradeabilityProxy.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity 0.4.23; 4 | 5 | import "./Proxy.sol"; 6 | import "./UpgradeabilityStorage.sol"; 7 | 8 | 9 | /** 10 | * @title UpgradeabilityProxy 11 | * @dev This contract represents a proxy where the implementation address to which it will delegate can be upgraded 12 | */ 13 | contract UpgradeabilityProxy is Proxy, UpgradeabilityStorage { 14 | /** 15 | * @dev This event will be emitted every time the implementation gets upgraded 16 | * @param version representing the version name of the upgraded implementation 17 | * @param implementation representing the address of the upgraded implementation 18 | */ 19 | event Upgraded(string version, address indexed implementation); 20 | 21 | /** 22 | * @dev Upgrades the implementation address 23 | * @param version representing the version name of the new implementation to be set 24 | * @param implementation representing the address of the new implementation to be set 25 | */ 26 | function _upgradeTo(string version, address implementation) internal { 27 | require(_implementation != implementation); 28 | _version = version; 29 | _implementation = implementation; 30 | Upgraded(version, implementation); 31 | } 32 | } -------------------------------------------------------------------------------- /contracts/contracts/UpgradeabilityStorage.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity 0.4.23; 4 | 5 | 6 | /** 7 | * @title UpgradeabilityStorage 8 | * @dev This contract holds all the necessary state variables to support the upgrade functionality 9 | */ 10 | contract UpgradeabilityStorage { 11 | // Version name of the current implementation 12 | string internal _version; 13 | 14 | // Address of the current implementation 15 | address internal _implementation; 16 | 17 | /** 18 | * @dev Tells the version name of the current implementation 19 | * @return string representing the name of the current version 20 | */ 21 | function version() public view returns (string) { 22 | return _version; 23 | } 24 | 25 | /** 26 | * @dev Tells the address of the current implementation 27 | * @return address of the current implementation 28 | */ 29 | function implementation() public view returns (address) { 30 | return _implementation; 31 | } 32 | } -------------------------------------------------------------------------------- /contracts/contracts/multisender/Claimable.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity 0.4.23; 4 | 5 | import "./Ownable.sol"; 6 | import "../EternalStorage.sol"; 7 | 8 | 9 | /** 10 | * @title Claimable 11 | * @dev Extension for the Ownable contract, where the ownership needs to be claimed. 12 | * This allows the new owner to accept the transfer. 13 | */ 14 | contract Claimable is EternalStorage, Ownable { 15 | function pendingOwner() public view returns (address) { 16 | return addressStorage[keccak256("pendingOwner")]; 17 | } 18 | 19 | /** 20 | * @dev Modifier throws if called by any account other than the pendingOwner. 21 | */ 22 | modifier onlyPendingOwner() { 23 | require(msg.sender == pendingOwner()); 24 | _; 25 | } 26 | 27 | /** 28 | * @dev Allows the current owner to set the pendingOwner address. 29 | * @param newOwner The address to transfer ownership to. 30 | */ 31 | function transferOwnership(address newOwner) public onlyOwner { 32 | require(newOwner != address(0)); 33 | addressStorage[keccak256("pendingOwner")] = newOwner; 34 | } 35 | 36 | /** 37 | * @dev Allows the pendingOwner address to finalize the transfer. 38 | */ 39 | function claimOwnership() public onlyPendingOwner { 40 | OwnershipTransferred(owner(), pendingOwner()); 41 | addressStorage[keccak256("owner")] = addressStorage[keccak256("pendingOwner")]; 42 | addressStorage[keccak256("pendingOwner")] = address(0); 43 | } 44 | } -------------------------------------------------------------------------------- /contracts/contracts/multisender/Ownable.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity 0.4.23; 4 | 5 | import "../EternalStorage.sol"; 6 | 7 | 8 | /** 9 | * @title Ownable 10 | * @dev This contract has an owner address providing basic authorization control 11 | */ 12 | contract Ownable is EternalStorage { 13 | /** 14 | * @dev Event to show ownership has been transferred 15 | * @param previousOwner representing the address of the previous owner 16 | * @param newOwner representing the address of the new owner 17 | */ 18 | event OwnershipTransferred(address previousOwner, address newOwner); 19 | 20 | /** 21 | * @dev Throws if called by any account other than the owner. 22 | */ 23 | modifier onlyOwner() { 24 | require(msg.sender == owner()); 25 | _; 26 | } 27 | 28 | /** 29 | * @dev Tells the address of the owner 30 | * @return the address of the owner 31 | */ 32 | function owner() public view returns (address) { 33 | return addressStorage[keccak256("owner")]; 34 | } 35 | 36 | /** 37 | * @dev Allows the current owner to transfer control of the contract to a newOwner. 38 | * @param newOwner the address to transfer ownership to. 39 | */ 40 | function transferOwnership(address newOwner) public onlyOwner { 41 | require(newOwner != address(0)); 42 | setOwner(newOwner); 43 | } 44 | 45 | /** 46 | * @dev Sets a new owner address 47 | */ 48 | function setOwner(address newOwner) internal { 49 | OwnershipTransferred(owner(), newOwner); 50 | addressStorage[keccak256("owner")] = newOwner; 51 | } 52 | } -------------------------------------------------------------------------------- /contracts/contracts/multisender/UpgradebleStormSender.sol: -------------------------------------------------------------------------------- 1 | // Roman Storm Multi Sender 2 | // To Use this Dapp: https://rstormsf.github.io/multisender 3 | pragma solidity 0.4.23; 4 | 5 | import "../OwnedUpgradeabilityStorage.sol"; 6 | import "./Claimable.sol"; 7 | import "../SafeMath.sol"; 8 | 9 | /** 10 | * @title ERC20Basic 11 | * @dev Simpler version of ERC20 interface 12 | * @dev see https://github.com/ethereum/EIPs/issues/179 13 | */ 14 | contract ERC20Basic { 15 | function totalSupply() public view returns (uint256); 16 | function balanceOf(address who) public view returns (uint256); 17 | function transfer(address to, uint256 value) public returns (bool); 18 | event Transfer(address indexed from, address indexed to, uint256 value); 19 | } 20 | 21 | 22 | contract ERC20 is ERC20Basic { 23 | function allowance(address owner, address spender) public view returns (uint256); 24 | function transferFrom(address from, address to, uint256 value) public returns (bool); 25 | function approve(address spender, uint256 value) public returns (bool); 26 | event Approval(address indexed owner, address indexed spender, uint256 value); 27 | } 28 | 29 | 30 | contract UpgradebleStormSender is OwnedUpgradeabilityStorage, Claimable { 31 | using SafeMath for uint256; 32 | 33 | event Multisended(uint256 total, address tokenAddress); 34 | event ClaimedTokens(address token, address owner, uint256 balance); 35 | 36 | modifier hasFee() { 37 | if (currentFee(msg.sender) > 0) { 38 | require(msg.value >= currentFee(msg.sender)); 39 | } 40 | _; 41 | } 42 | 43 | function() public payable {} 44 | 45 | function initialize(address _owner) public { 46 | require(!initialized()); 47 | setOwner(_owner); 48 | setArrayLimit(200); 49 | setDiscountStep(0.00005 ether); 50 | setFee(0.05 ether); 51 | boolStorage[keccak256("rs_multisender_initialized")] = true; 52 | } 53 | 54 | function initialized() public view returns (bool) { 55 | return boolStorage[keccak256("rs_multisender_initialized")]; 56 | } 57 | 58 | function txCount(address customer) public view returns(uint256) { 59 | return uintStorage[keccak256("txCount", customer)]; 60 | } 61 | 62 | function arrayLimit() public view returns(uint256) { 63 | return uintStorage[keccak256("arrayLimit")]; 64 | } 65 | 66 | function setArrayLimit(uint256 _newLimit) public onlyOwner { 67 | require(_newLimit != 0); 68 | uintStorage[keccak256("arrayLimit")] = _newLimit; 69 | } 70 | 71 | function discountStep() public view returns(uint256) { 72 | return uintStorage[keccak256("discountStep")]; 73 | } 74 | 75 | function setDiscountStep(uint256 _newStep) public onlyOwner { 76 | require(_newStep != 0); 77 | uintStorage[keccak256("discountStep")] = _newStep; 78 | } 79 | 80 | function fee() public view returns(uint256) { 81 | return uintStorage[keccak256("fee")]; 82 | } 83 | 84 | function currentFee(address _customer) public view returns(uint256) { 85 | if (fee() > discountRate(msg.sender)) { 86 | return fee().sub(discountRate(_customer)); 87 | } else { 88 | return 0; 89 | } 90 | } 91 | 92 | function setFee(uint256 _newStep) public onlyOwner { 93 | require(_newStep != 0); 94 | uintStorage[keccak256("fee")] = _newStep; 95 | } 96 | 97 | function discountRate(address _customer) public view returns(uint256) { 98 | uint256 count = txCount(_customer); 99 | return count.mul(discountStep()); 100 | } 101 | 102 | function multisendToken(address token, address[] _contributors, uint256[] _balances) public hasFee payable { 103 | if (token == 0x000000000000000000000000000000000000bEEF){ 104 | multisendEther(_contributors, _balances); 105 | } else { 106 | uint256 total = 0; 107 | require(_contributors.length <= arrayLimit()); 108 | ERC20 erc20token = ERC20(token); 109 | uint8 i = 0; 110 | for (i; i < _contributors.length; i++) { 111 | erc20token.transferFrom(msg.sender, _contributors[i], _balances[i]); 112 | total += _balances[i]; 113 | } 114 | setTxCount(msg.sender, txCount(msg.sender).add(1)); 115 | Multisended(total, token); 116 | } 117 | } 118 | 119 | function multisendEther(address[] _contributors, uint256[] _balances) public payable { 120 | uint256 total = msg.value; 121 | uint256 fee = currentFee(msg.sender); 122 | require(total >= fee); 123 | require(_contributors.length <= arrayLimit()); 124 | total = total.sub(fee); 125 | uint256 i = 0; 126 | for (i; i < _contributors.length; i++) { 127 | require(total >= _balances[i]); 128 | total = total.sub(_balances[i]); 129 | _contributors[i].transfer(_balances[i]); 130 | } 131 | setTxCount(msg.sender, txCount(msg.sender).add(1)); 132 | Multisended(msg.value, 0x000000000000000000000000000000000000bEEF); 133 | } 134 | 135 | function claimTokens(address _token) public onlyOwner { 136 | if (_token == 0x0) { 137 | owner().transfer(this.balance); 138 | return; 139 | } 140 | ERC20 erc20token = ERC20(_token); 141 | uint256 balance = erc20token.balanceOf(this); 142 | erc20token.transfer(owner(), balance); 143 | ClaimedTokens(_token, owner(), balance); 144 | } 145 | 146 | function setTxCount(address customer, uint256 _txCount) private { 147 | uintStorage[keccak256("txCount", customer)] = _txCount; 148 | } 149 | 150 | } -------------------------------------------------------------------------------- /contracts/flats/EternalStorageProxyForStormMultisender_flat.sol: -------------------------------------------------------------------------------- 1 | 2 | // File: contracts/EternalStorage.sol 3 | 4 | // Roman Storm Multi Sender 5 | // To Use this Dapp: https://rstormsf.github.io/multisender 6 | pragma solidity 0.4.20; 7 | 8 | 9 | /** 10 | * @title EternalStorage 11 | * @dev This contract holds all the necessary state variables to carry out the storage of any contract. 12 | */ 13 | contract EternalStorage { 14 | 15 | mapping(bytes32 => uint256) internal uintStorage; 16 | mapping(bytes32 => string) internal stringStorage; 17 | mapping(bytes32 => address) internal addressStorage; 18 | mapping(bytes32 => bytes) internal bytesStorage; 19 | mapping(bytes32 => bool) internal boolStorage; 20 | mapping(bytes32 => int256) internal intStorage; 21 | 22 | } 23 | 24 | // File: contracts/UpgradeabilityOwnerStorage.sol 25 | 26 | // Roman Storm Multi Sender 27 | // To Use this Dapp: https://rstormsf.github.io/multisender 28 | pragma solidity 0.4.20; 29 | 30 | 31 | /** 32 | * @title UpgradeabilityOwnerStorage 33 | * @dev This contract keeps track of the upgradeability owner 34 | */ 35 | contract UpgradeabilityOwnerStorage { 36 | // Owner of the contract 37 | address private _upgradeabilityOwner; 38 | 39 | /** 40 | * @dev Tells the address of the owner 41 | * @return the address of the owner 42 | */ 43 | function upgradeabilityOwner() public view returns (address) { 44 | return _upgradeabilityOwner; 45 | } 46 | 47 | /** 48 | * @dev Sets the address of the owner 49 | */ 50 | function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal { 51 | _upgradeabilityOwner = newUpgradeabilityOwner; 52 | } 53 | 54 | } 55 | 56 | // File: contracts/Proxy.sol 57 | 58 | // Roman Storm Multi Sender 59 | // To Use this Dapp: https://rstormsf.github.io/multisender 60 | pragma solidity 0.4.20; 61 | 62 | 63 | /** 64 | * @title Proxy 65 | * @dev Gives the possibility to delegate any call to a foreign implementation. 66 | */ 67 | contract Proxy { 68 | 69 | /** 70 | * @dev Fallback function allowing to perform a delegatecall to the given implementation. 71 | * This function will return whatever the implementation call returns 72 | */ 73 | function () public payable { 74 | address _impl = implementation(); 75 | require(_impl != address(0)); 76 | bytes memory data = msg.data; 77 | 78 | assembly { 79 | let result := delegatecall(gas, _impl, add(data, 0x20), mload(data), 0, 0) 80 | let size := returndatasize 81 | 82 | let ptr := mload(0x40) 83 | returndatacopy(ptr, 0, size) 84 | 85 | switch result 86 | case 0 { revert(ptr, size) } 87 | default { return(ptr, size) } 88 | } 89 | } 90 | 91 | /** 92 | * @dev Tells the address of the implementation where every call will be delegated. 93 | * @return address of the implementation to which it will be delegated 94 | */ 95 | function implementation() public view returns (address); 96 | } 97 | 98 | // File: contracts/UpgradeabilityStorage.sol 99 | 100 | // Roman Storm Multi Sender 101 | // To Use this Dapp: https://rstormsf.github.io/multisender 102 | pragma solidity 0.4.20; 103 | 104 | 105 | /** 106 | * @title UpgradeabilityStorage 107 | * @dev This contract holds all the necessary state variables to support the upgrade functionality 108 | */ 109 | contract UpgradeabilityStorage { 110 | // Version name of the current implementation 111 | string internal _version; 112 | 113 | // Address of the current implementation 114 | address internal _implementation; 115 | 116 | /** 117 | * @dev Tells the version name of the current implementation 118 | * @return string representing the name of the current version 119 | */ 120 | function version() public view returns (string) { 121 | return _version; 122 | } 123 | 124 | /** 125 | * @dev Tells the address of the current implementation 126 | * @return address of the current implementation 127 | */ 128 | function implementation() public view returns (address) { 129 | return _implementation; 130 | } 131 | } 132 | 133 | // File: contracts/UpgradeabilityProxy.sol 134 | 135 | // Roman Storm Multi Sender 136 | // To Use this Dapp: https://rstormsf.github.io/multisender 137 | pragma solidity 0.4.20; 138 | 139 | 140 | 141 | 142 | /** 143 | * @title UpgradeabilityProxy 144 | * @dev This contract represents a proxy where the implementation address to which it will delegate can be upgraded 145 | */ 146 | contract UpgradeabilityProxy is Proxy, UpgradeabilityStorage { 147 | /** 148 | * @dev This event will be emitted every time the implementation gets upgraded 149 | * @param version representing the version name of the upgraded implementation 150 | * @param implementation representing the address of the upgraded implementation 151 | */ 152 | event Upgraded(string version, address indexed implementation); 153 | 154 | /** 155 | * @dev Upgrades the implementation address 156 | * @param version representing the version name of the new implementation to be set 157 | * @param implementation representing the address of the new implementation to be set 158 | */ 159 | function _upgradeTo(string version, address implementation) internal { 160 | require(_implementation != implementation); 161 | _version = version; 162 | _implementation = implementation; 163 | Upgraded(version, implementation); 164 | } 165 | } 166 | 167 | // File: contracts/OwnedUpgradeabilityProxy.sol 168 | 169 | // Roman Storm Multi Sender 170 | // To Use this Dapp: https://rstormsf.github.io/multisender 171 | pragma solidity 0.4.20; 172 | 173 | 174 | 175 | 176 | /** 177 | * @title OwnedUpgradeabilityProxy 178 | * @dev This contract combines an upgradeability proxy with basic authorization control functionalities 179 | */ 180 | contract OwnedUpgradeabilityProxy is UpgradeabilityOwnerStorage, UpgradeabilityProxy { 181 | /** 182 | * @dev Event to show ownership has been transferred 183 | * @param previousOwner representing the address of the previous owner 184 | * @param newOwner representing the address of the new owner 185 | */ 186 | event ProxyOwnershipTransferred(address previousOwner, address newOwner); 187 | 188 | /** 189 | * @dev the constructor sets the original owner of the contract to the sender account. 190 | */ 191 | function OwnedUpgradeabilityProxy(address _owner) public { 192 | setUpgradeabilityOwner(_owner); 193 | } 194 | 195 | /** 196 | * @dev Throws if called by any account other than the owner. 197 | */ 198 | modifier onlyProxyOwner() { 199 | require(msg.sender == proxyOwner()); 200 | _; 201 | } 202 | 203 | /** 204 | * @dev Tells the address of the proxy owner 205 | * @return the address of the proxy owner 206 | */ 207 | function proxyOwner() public view returns (address) { 208 | return upgradeabilityOwner(); 209 | } 210 | 211 | /** 212 | * @dev Allows the current owner to transfer control of the contract to a newOwner. 213 | * @param newOwner The address to transfer ownership to. 214 | */ 215 | function transferProxyOwnership(address newOwner) public onlyProxyOwner { 216 | require(newOwner != address(0)); 217 | ProxyOwnershipTransferred(proxyOwner(), newOwner); 218 | setUpgradeabilityOwner(newOwner); 219 | } 220 | 221 | /** 222 | * @dev Allows the upgradeability owner to upgrade the current version of the proxy. 223 | * @param version representing the version name of the new implementation to be set. 224 | * @param implementation representing the address of the new implementation to be set. 225 | */ 226 | function upgradeTo(string version, address implementation) public onlyProxyOwner { 227 | _upgradeTo(version, implementation); 228 | } 229 | 230 | /** 231 | * @dev Allows the upgradeability owner to upgrade the current version of the proxy and call the new implementation 232 | * to initialize whatever is needed through a low level call. 233 | * @param version representing the version name of the new implementation to be set. 234 | * @param implementation representing the address of the new implementation to be set. 235 | * @param data represents the msg.data to bet sent in the low level call. This parameter may include the function 236 | * signature of the implementation to be called with the needed payload 237 | */ 238 | function upgradeToAndCall(string version, address implementation, bytes data) payable public onlyProxyOwner { 239 | upgradeTo(version, implementation); 240 | require(this.call.value(msg.value)(data)); 241 | } 242 | } 243 | 244 | // File: contracts/EternalStorageProxyForStormMultisender.sol 245 | 246 | // Roman Storm Multi Sender 247 | // To Use this Dapp: https://rstormsf.github.io/multisender 248 | pragma solidity 0.4.20; 249 | 250 | 251 | 252 | 253 | /** 254 | * @title EternalStorageProxy 255 | * @dev This proxy holds the storage of the token contract and delegates every call to the current implementation set. 256 | * Besides, it allows to upgrade the token's behaviour towards further implementations, and provides basic 257 | * authorization control functionalities 258 | */ 259 | contract EternalStorageProxyForStormMultisender is OwnedUpgradeabilityProxy, EternalStorage { 260 | 261 | function EternalStorageProxyForStormMultisender(address _owner) public OwnedUpgradeabilityProxy(_owner) {} 262 | 263 | } 264 | -------------------------------------------------------------------------------- /contracts/flats/UpgradebleStormSender_flat.sol: -------------------------------------------------------------------------------- 1 | 2 | // File: contracts/EternalStorage.sol 3 | 4 | // Roman Storm Multi Sender 5 | // To Use this Dapp: https://rstormsf.github.io/multisender 6 | pragma solidity 0.4.24; 7 | 8 | 9 | /** 10 | * @title EternalStorage 11 | * @dev This contract holds all the necessary state variables to carry out the storage of any contract. 12 | */ 13 | contract EternalStorage { 14 | 15 | mapping(bytes32 => uint256) internal uintStorage; 16 | mapping(bytes32 => string) internal stringStorage; 17 | mapping(bytes32 => address) internal addressStorage; 18 | mapping(bytes32 => bytes) internal bytesStorage; 19 | mapping(bytes32 => bool) internal boolStorage; 20 | mapping(bytes32 => int256) internal intStorage; 21 | 22 | } 23 | 24 | // File: contracts/UpgradeabilityOwnerStorage.sol 25 | 26 | // Roman Storm Multi Sender 27 | // To Use this Dapp: https://rstormsf.github.io/multisender 28 | 29 | 30 | /** 31 | * @title UpgradeabilityOwnerStorage 32 | * @dev This contract keeps track of the upgradeability owner 33 | */ 34 | contract UpgradeabilityOwnerStorage { 35 | // Owner of the contract 36 | address private _upgradeabilityOwner; 37 | 38 | /** 39 | * @dev Tells the address of the owner 40 | * @return the address of the owner 41 | */ 42 | function upgradeabilityOwner() public view returns (address) { 43 | return _upgradeabilityOwner; 44 | } 45 | 46 | /** 47 | * @dev Sets the address of the owner 48 | */ 49 | function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal { 50 | _upgradeabilityOwner = newUpgradeabilityOwner; 51 | } 52 | 53 | } 54 | 55 | // File: contracts/UpgradeabilityStorage.sol 56 | 57 | // Roman Storm Multi Sender 58 | // To Use this Dapp: https://rstormsf.github.io/multisender 59 | 60 | 61 | /** 62 | * @title UpgradeabilityStorage 63 | * @dev This contract holds all the necessary state variables to support the upgrade functionality 64 | */ 65 | contract UpgradeabilityStorage { 66 | // Version name of the current implementation 67 | string internal _version; 68 | 69 | // Address of the current implementation 70 | address internal _implementation; 71 | 72 | /** 73 | * @dev Tells the version name of the current implementation 74 | * @return string representing the name of the current version 75 | */ 76 | function version() public view returns (string) { 77 | return _version; 78 | } 79 | 80 | /** 81 | * @dev Tells the address of the current implementation 82 | * @return address of the current implementation 83 | */ 84 | function implementation() public view returns (address) { 85 | return _implementation; 86 | } 87 | } 88 | 89 | // File: contracts/OwnedUpgradeabilityStorage.sol 90 | 91 | // Roman Storm Multi Sender 92 | // To Use this Dapp: https://rstormsf.github.io/multisender 93 | 94 | 95 | 96 | 97 | 98 | /** 99 | * @title OwnedUpgradeabilityStorage 100 | * @dev This is the storage necessary to perform upgradeable contracts. 101 | * This means, required state variables for upgradeability purpose and eternal storage per se. 102 | */ 103 | contract OwnedUpgradeabilityStorage is UpgradeabilityOwnerStorage, UpgradeabilityStorage, EternalStorage {} 104 | 105 | // File: contracts/SafeMath.sol 106 | 107 | // Roman Storm Multi Sender 108 | // To Use this Dapp: https://rstormsf.github.io/multisender 109 | 110 | 111 | /** 112 | * @title SafeMath 113 | * @dev Math operations with safety checks that throw on error 114 | */ 115 | library SafeMath { 116 | 117 | /** 118 | * @dev Multiplies two numbers, throws on overflow. 119 | */ 120 | function mul(uint256 a, uint256 b) internal pure returns (uint256) { 121 | if (a == 0) { 122 | return 0; 123 | } 124 | uint256 c = a * b; 125 | assert(c / a == b); 126 | return c; 127 | } 128 | 129 | /** 130 | * @dev Integer division of two numbers, truncating the quotient. 131 | */ 132 | function div(uint256 a, uint256 b) internal pure returns (uint256) { 133 | // assert(b > 0); // Solidity automatically throws when dividing by 0 134 | uint256 c = a / b; 135 | // assert(a == b * c + a % b); // There is no case in which this doesn't hold 136 | return c; 137 | } 138 | 139 | /** 140 | * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). 141 | */ 142 | function sub(uint256 a, uint256 b) internal pure returns (uint256) { 143 | assert(b <= a); 144 | return a - b; 145 | } 146 | 147 | /** 148 | * @dev Adds two numbers, throws on overflow. 149 | */ 150 | function add(uint256 a, uint256 b) internal pure returns (uint256) { 151 | uint256 c = a + b; 152 | assert(c >= a); 153 | return c; 154 | } 155 | } 156 | 157 | // File: contracts/multisender/Ownable.sol 158 | 159 | // Roman Storm Multi Sender 160 | // To Use this Dapp: https://rstormsf.github.io/multisender 161 | 162 | 163 | 164 | /** 165 | * @title Ownable 166 | * @dev This contract has an owner address providing basic authorization control 167 | */ 168 | contract Ownable is EternalStorage { 169 | /** 170 | * @dev Event to show ownership has been transferred 171 | * @param previousOwner representing the address of the previous owner 172 | * @param newOwner representing the address of the new owner 173 | */ 174 | event OwnershipTransferred(address previousOwner, address newOwner); 175 | 176 | /** 177 | * @dev Throws if called by any account other than the owner. 178 | */ 179 | modifier onlyOwner() { 180 | require(msg.sender == owner()); 181 | _; 182 | } 183 | 184 | /** 185 | * @dev Tells the address of the owner 186 | * @return the address of the owner 187 | */ 188 | function owner() public view returns (address) { 189 | return addressStorage[keccak256("owner")]; 190 | } 191 | 192 | /** 193 | * @dev Allows the current owner to transfer control of the contract to a newOwner. 194 | * @param newOwner the address to transfer ownership to. 195 | */ 196 | function transferOwnership(address newOwner) public onlyOwner { 197 | require(newOwner != address(0)); 198 | setOwner(newOwner); 199 | } 200 | 201 | /** 202 | * @dev Sets a new owner address 203 | */ 204 | function setOwner(address newOwner) internal { 205 | emit OwnershipTransferred(owner(), newOwner); 206 | addressStorage[keccak256("owner")] = newOwner; 207 | } 208 | } 209 | 210 | // File: contracts/multisender/Claimable.sol 211 | 212 | // Roman Storm Multi Sender 213 | // To Use this Dapp: https://rstormsf.github.io/multisender 214 | 215 | 216 | 217 | 218 | /** 219 | * @title Claimable 220 | * @dev Extension for the Ownable contract, where the ownership needs to be claimed. 221 | * This allows the new owner to accept the transfer. 222 | */ 223 | contract Claimable is EternalStorage, Ownable { 224 | function pendingOwner() public view returns (address) { 225 | return addressStorage[keccak256("pendingOwner")]; 226 | } 227 | 228 | /** 229 | * @dev Modifier throws if called by any account other than the pendingOwner. 230 | */ 231 | modifier onlyPendingOwner() { 232 | require(msg.sender == pendingOwner()); 233 | _; 234 | } 235 | 236 | /** 237 | * @dev Allows the current owner to set the pendingOwner address. 238 | * @param newOwner The address to transfer ownership to. 239 | */ 240 | function transferOwnership(address newOwner) public onlyOwner { 241 | require(newOwner != address(0)); 242 | addressStorage[keccak256("pendingOwner")] = newOwner; 243 | } 244 | 245 | /** 246 | * @dev Allows the pendingOwner address to finalize the transfer. 247 | */ 248 | function claimOwnership() public onlyPendingOwner { 249 | emit OwnershipTransferred(owner(), pendingOwner()); 250 | addressStorage[keccak256("owner")] = addressStorage[keccak256("pendingOwner")]; 251 | addressStorage[keccak256("pendingOwner")] = address(0); 252 | } 253 | } 254 | 255 | // File: contracts/multisender/UpgradebleStormSender.sol 256 | 257 | // Roman Storm Multi Sender 258 | // To Use this Dapp: https://rstormsf.github.io/multisender 259 | 260 | 261 | 262 | 263 | /** 264 | * @title ERC20Basic 265 | * @dev Simpler version of ERC20 interface 266 | * @dev see https://github.com/ethereum/EIPs/issues/179 267 | */ 268 | contract ERC20Basic { 269 | function totalSupply() public view returns (uint256); 270 | function balanceOf(address who) public view returns (uint256); 271 | function transfer(address to, uint256 value) public returns (bool); 272 | event Transfer(address indexed from, address indexed to, uint256 value); 273 | } 274 | 275 | 276 | contract ERC20 is ERC20Basic { 277 | function allowance(address owner, address spender) public view returns (uint256); 278 | function transferFrom(address from, address to, uint256 value) public returns (bool); 279 | function approve(address spender, uint256 value) public returns (bool); 280 | event Approval(address indexed owner, address indexed spender, uint256 value); 281 | } 282 | 283 | 284 | contract UpgradebleStormSender is OwnedUpgradeabilityStorage, Claimable { 285 | using SafeMath for uint256; 286 | 287 | event Multisended(uint256 total, address tokenAddress); 288 | event ClaimedTokens(address token, address owner, uint256 balance); 289 | 290 | modifier hasFee() { 291 | if (currentFee(msg.sender) > 0) { 292 | require(msg.value >= currentFee(msg.sender)); 293 | } 294 | _; 295 | } 296 | 297 | function() public payable {} 298 | 299 | function initialize(address _owner) public { 300 | require(!initialized()); 301 | setOwner(_owner); 302 | setArrayLimit(200); 303 | setDiscountStep(0.00005 ether); 304 | setFee(0.05 ether); 305 | boolStorage[keccak256("rs_multisender_initialized")] = true; 306 | } 307 | 308 | function initialized() public view returns (bool) { 309 | return boolStorage[keccak256("rs_multisender_initialized")]; 310 | } 311 | 312 | function txCount(address customer) public view returns(uint256) { 313 | return uintStorage[keccak256(abi.encodePacked("txCount", customer))]; 314 | } 315 | 316 | function arrayLimit() public view returns(uint256) { 317 | return uintStorage[keccak256(abi.encodePacked("arrayLimit"))]; 318 | } 319 | 320 | function setArrayLimit(uint256 _newLimit) public onlyOwner { 321 | require(_newLimit != 0); 322 | uintStorage[keccak256("arrayLimit")] = _newLimit; 323 | } 324 | 325 | function discountStep() public view returns(uint256) { 326 | return uintStorage[keccak256("discountStep")]; 327 | } 328 | 329 | function setDiscountStep(uint256 _newStep) public onlyOwner { 330 | require(_newStep != 0); 331 | uintStorage[keccak256("discountStep")] = _newStep; 332 | } 333 | 334 | function fee() public view returns(uint256) { 335 | return uintStorage[keccak256("fee")]; 336 | } 337 | 338 | function currentFee(address _customer) public view returns(uint256) { 339 | if (fee() > discountRate(msg.sender)) { 340 | return fee().sub(discountRate(_customer)); 341 | } else { 342 | return 0; 343 | } 344 | } 345 | 346 | function setFee(uint256 _newStep) public onlyOwner { 347 | require(_newStep != 0); 348 | uintStorage[keccak256("fee")] = _newStep; 349 | } 350 | 351 | function discountRate(address _customer) public view returns(uint256) { 352 | uint256 count = txCount(_customer); 353 | return count.mul(discountStep()); 354 | } 355 | 356 | function multisendToken(address token, address[] _contributors, uint256[] _balances) public hasFee payable { 357 | if (token == 0x000000000000000000000000000000000000bEEF){ 358 | multisendEther(_contributors, _balances); 359 | } else { 360 | uint256 total = 0; 361 | require(_contributors.length <= arrayLimit()); 362 | ERC20 erc20token = ERC20(token); 363 | uint8 i = 0; 364 | for (i; i < _contributors.length; i++) { 365 | erc20token.transferFrom(msg.sender, _contributors[i], _balances[i]); 366 | total += _balances[i]; 367 | } 368 | setTxCount(msg.sender, txCount(msg.sender).add(1)); 369 | emit Multisended(total, token); 370 | } 371 | } 372 | 373 | function multisendEther(address[] _contributors, uint256[] _balances) public payable { 374 | uint256 total = msg.value; 375 | uint256 userfee = currentFee(msg.sender); 376 | require(total >= userfee); 377 | require(_contributors.length <= arrayLimit()); 378 | total = total.sub(userfee); 379 | uint256 i = 0; 380 | for (i; i < _contributors.length; i++) { 381 | require(total >= _balances[i]); 382 | total = total.sub(_balances[i]); 383 | _contributors[i].transfer(_balances[i]); 384 | } 385 | setTxCount(msg.sender, txCount(msg.sender).add(1)); 386 | emit Multisended(msg.value, 0x000000000000000000000000000000000000bEEF); 387 | } 388 | 389 | function claimTokens(address _token) public onlyOwner { 390 | if (_token == 0x0) { 391 | owner().transfer(address(this).balance); 392 | return; 393 | } 394 | ERC20 erc20token = ERC20(_token); 395 | uint256 balance = erc20token.balanceOf(this); 396 | erc20token.transfer(owner(), balance); 397 | emit ClaimedTokens(_token, owner(), balance); 398 | } 399 | 400 | function setTxCount(address customer, uint256 _txCount) private { 401 | uintStorage[keccak256(abi.encodePacked("txCount", customer))] = _txCount; 402 | } 403 | 404 | } 405 | -------------------------------------------------------------------------------- /contracts/migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | var Migrations = artifacts.require("./Migrations.sol"); 2 | 3 | module.exports = function(deployer) { 4 | deployer.deploy(Migrations); 5 | }; 6 | -------------------------------------------------------------------------------- /contracts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "contracts", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "flatten": "truffle-flattener UpgradebleStormSender.sol > flats/UpgradebleStormSender_flat.sol" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "truffle": "^4.1.7" 14 | }, 15 | "devDependencies": { 16 | "truffle-flattener": "^1.2.3" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /contracts/truffle-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // See 3 | // to customize your Truffle configuration! 4 | }; 5 | -------------------------------------------------------------------------------- /contracts/truffle.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // See 3 | // to customize your Truffle configuration! 4 | }; 5 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/demo.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "multi-sender-app", 3 | "version": "0.1.0", 4 | "license": "GPL3", 5 | "homepage": "https://rstormsf.github.io/multisender", 6 | "dependencies": { 7 | "bignumber.js": "^6.0.0", 8 | "csvtojson": "^1.1.9", 9 | "gh-pages": "^1.1.0", 10 | "json-validator": "0.0.34", 11 | "mobx": "^3.5.1", 12 | "mobx-react": "^4.4.2", 13 | "node-sass-chokidar": "0.0.3", 14 | "nodemon": "^1.15.1", 15 | "react": "^16.2.0", 16 | "react-app-rewire-mobx": "^1.0.7", 17 | "react-app-rewire-preact": "^1.0.1", 18 | "react-app-rewired": "^1.4.1", 19 | "react-dom": "^16.2.0", 20 | "react-json-view": "^1.16.1", 21 | "react-radio-group": "^3.0.2", 22 | "react-router-dom": "^4.2.2", 23 | "react-scripts": "1.1.1", 24 | "react-select": "^1.2.1", 25 | "react-spinners": "^0.2.6", 26 | "react-validation": "^3.0.7", 27 | "splash-screen": "^4.0.1", 28 | "store2": "^2.7.0", 29 | "sweetalert": "^2.1.0", 30 | "web3": "^1.0.0-beta.30" 31 | }, 32 | "scripts": { 33 | "build-css": "node-sass-chokidar src/assets/stylesheets/application.scss -o src/assets/stylesheets --output-style=compressed", 34 | "watch-css": "nodemon -e scss -x \"npm run build-css\"", 35 | "start": "react-app-rewired start", 36 | "build": "react-app-rewired build", 37 | "test": "react-app-rewired test --env=jsdom", 38 | "eject": "react-app-rewired eject", 39 | "predeploy": "npm run build", 40 | "deploy": "gh-pages -d build -o rstorm" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /public/favicon/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/public/favicon/android-chrome-192x192.png -------------------------------------------------------------------------------- /public/favicon/android-chrome-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/public/favicon/android-chrome-256x256.png -------------------------------------------------------------------------------- /public/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/public/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /public/favicon/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #da532c 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/public/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /public/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/public/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /public/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/public/favicon/favicon.ico -------------------------------------------------------------------------------- /public/favicon/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/public/favicon/mstile-150x150.png -------------------------------------------------------------------------------- /public/favicon/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Token MultiSender", 3 | "short_name": "Save on tx fees with ERC20 MultiSender", 4 | "icons": [ 5 | { 6 | "src": "/android-chrome-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "/android-chrome-256x256.png", 12 | "sizes": "256x256", 13 | "type": "image/png" 14 | } 15 | ], 16 | "theme_color": "#ffffff", 17 | "background_color": "#ffffff", 18 | "display": "standalone" 19 | } 20 | -------------------------------------------------------------------------------- /public/fb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/public/fb.png -------------------------------------------------------------------------------- /public/illustration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/public/illustration.png -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 28 | Token MultiSender 29 | 30 | 31 | 34 |
35 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Token MultiSender", 3 | "name": "Save on tx fees with ERC20 MultiSender", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Header, FirstStep, SecondStep, ThirdStep, FourthStep, FifthStep, Retry, Welcome } from './components'; 3 | import { Route, Redirect } from 'react-router-dom'; 4 | import { inject } from "mobx-react"; 5 | import './assets/stylesheets/application.css'; 6 | 7 | const PrivateRoute = ({ component: Component, startedUrl, ...rest }) => ( 8 | 11 | startedUrl === '#/' || startedUrl === '#/1' ? ( 12 | 13 | ) : ( 14 | 19 | ) 20 | } 21 | /> 22 | ); 23 | 24 | @inject("UiStore") 25 | export class App extends React.Component { 26 | constructor(props){ 27 | super(props); 28 | this.web3Store = props.UiStore.web3Store; 29 | } 30 | render(){ 31 | let startedUrl = this.web3Store.startedUrl; 32 | console.log('fix reset'); 33 | return ( 34 |
35 |
36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | {/* */} 44 |
45 | ); 46 | } 47 | } -------------------------------------------------------------------------------- /src/abis/ERC20ABI.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": true, 4 | "inputs": [], 5 | "name": "name", 6 | "outputs": [ 7 | { 8 | "name": "", 9 | "type": "string" 10 | } 11 | ], 12 | "payable": false, 13 | "stateMutability": "view", 14 | "type": "function" 15 | }, 16 | { 17 | "constant": false, 18 | "inputs": [ 19 | { 20 | "name": "spender", 21 | "type": "address" 22 | }, 23 | { 24 | "name": "value", 25 | "type": "uint256" 26 | } 27 | ], 28 | "name": "approve", 29 | "outputs": [ 30 | { 31 | "name": "", 32 | "type": "bool" 33 | } 34 | ], 35 | "payable": false, 36 | "stateMutability": "nonpayable", 37 | "type": "function" 38 | }, 39 | { 40 | "constant": true, 41 | "inputs": [], 42 | "name": "totalSupply", 43 | "outputs": [ 44 | { 45 | "name": "", 46 | "type": "uint256" 47 | } 48 | ], 49 | "payable": false, 50 | "stateMutability": "view", 51 | "type": "function" 52 | }, 53 | { 54 | "constant": false, 55 | "inputs": [ 56 | { 57 | "name": "from", 58 | "type": "address" 59 | }, 60 | { 61 | "name": "to", 62 | "type": "address" 63 | }, 64 | { 65 | "name": "value", 66 | "type": "uint256" 67 | } 68 | ], 69 | "name": "transferFrom", 70 | "outputs": [ 71 | { 72 | "name": "", 73 | "type": "bool" 74 | } 75 | ], 76 | "payable": false, 77 | "stateMutability": "nonpayable", 78 | "type": "function" 79 | }, 80 | { 81 | "constant": true, 82 | "inputs": [], 83 | "name": "decimals", 84 | "outputs": [ 85 | { 86 | "name": "", 87 | "type": "uint8" 88 | } 89 | ], 90 | "payable": false, 91 | "stateMutability": "view", 92 | "type": "function" 93 | }, 94 | { 95 | "constant": true, 96 | "inputs": [ 97 | { 98 | "name": "who", 99 | "type": "address" 100 | } 101 | ], 102 | "name": "balanceOf", 103 | "outputs": [ 104 | { 105 | "name": "", 106 | "type": "uint256" 107 | } 108 | ], 109 | "payable": false, 110 | "stateMutability": "view", 111 | "type": "function" 112 | }, 113 | { 114 | "constant": true, 115 | "inputs": [], 116 | "name": "symbol", 117 | "outputs": [ 118 | { 119 | "name": "", 120 | "type": "string" 121 | } 122 | ], 123 | "payable": false, 124 | "stateMutability": "view", 125 | "type": "function" 126 | }, 127 | { 128 | "constant": false, 129 | "inputs": [ 130 | { 131 | "name": "to", 132 | "type": "address" 133 | }, 134 | { 135 | "name": "value", 136 | "type": "uint256" 137 | } 138 | ], 139 | "name": "transfer", 140 | "outputs": [ 141 | { 142 | "name": "", 143 | "type": "bool" 144 | } 145 | ], 146 | "payable": false, 147 | "stateMutability": "nonpayable", 148 | "type": "function" 149 | }, 150 | { 151 | "constant": true, 152 | "inputs": [ 153 | { 154 | "name": "owner", 155 | "type": "address" 156 | }, 157 | { 158 | "name": "spender", 159 | "type": "address" 160 | } 161 | ], 162 | "name": "allowance", 163 | "outputs": [ 164 | { 165 | "name": "", 166 | "type": "uint256" 167 | } 168 | ], 169 | "payable": false, 170 | "stateMutability": "view", 171 | "type": "function" 172 | }, 173 | { 174 | "inputs": [ 175 | { 176 | "name": "_name", 177 | "type": "string" 178 | }, 179 | { 180 | "name": "_symbol", 181 | "type": "string" 182 | }, 183 | { 184 | "name": "_decimals", 185 | "type": "uint8" 186 | } 187 | ], 188 | "payable": false, 189 | "stateMutability": "nonpayable", 190 | "type": "constructor" 191 | }, 192 | { 193 | "anonymous": false, 194 | "inputs": [ 195 | { 196 | "indexed": true, 197 | "name": "owner", 198 | "type": "address" 199 | }, 200 | { 201 | "indexed": true, 202 | "name": "spender", 203 | "type": "address" 204 | }, 205 | { 206 | "indexed": false, 207 | "name": "value", 208 | "type": "uint256" 209 | } 210 | ], 211 | "name": "Approval", 212 | "type": "event" 213 | }, 214 | { 215 | "anonymous": false, 216 | "inputs": [ 217 | { 218 | "indexed": true, 219 | "name": "from", 220 | "type": "address" 221 | }, 222 | { 223 | "indexed": true, 224 | "name": "to", 225 | "type": "address" 226 | }, 227 | { 228 | "indexed": false, 229 | "name": "value", 230 | "type": "uint256" 231 | } 232 | ], 233 | "name": "Transfer", 234 | "type": "event" 235 | } 236 | ] -------------------------------------------------------------------------------- /src/abis/StormMultisender.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": false, 4 | "inputs": [], 5 | "name": "claimOwnership", 6 | "outputs": [], 7 | "payable": false, 8 | "stateMutability": "nonpayable", 9 | "type": "function" 10 | }, 11 | { 12 | "constant": true, 13 | "inputs": [], 14 | "name": "version", 15 | "outputs": [ 16 | { 17 | "name": "", 18 | "type": "string" 19 | } 20 | ], 21 | "payable": false, 22 | "stateMutability": "view", 23 | "type": "function" 24 | }, 25 | { 26 | "constant": true, 27 | "inputs": [], 28 | "name": "implementation", 29 | "outputs": [ 30 | { 31 | "name": "", 32 | "type": "address" 33 | } 34 | ], 35 | "payable": false, 36 | "stateMutability": "view", 37 | "type": "function" 38 | }, 39 | { 40 | "constant": true, 41 | "inputs": [], 42 | "name": "upgradeabilityOwner", 43 | "outputs": [ 44 | { 45 | "name": "", 46 | "type": "address" 47 | } 48 | ], 49 | "payable": false, 50 | "stateMutability": "view", 51 | "type": "function" 52 | }, 53 | { 54 | "constant": true, 55 | "inputs": [], 56 | "name": "owner", 57 | "outputs": [ 58 | { 59 | "name": "", 60 | "type": "address" 61 | } 62 | ], 63 | "payable": false, 64 | "stateMutability": "view", 65 | "type": "function" 66 | }, 67 | { 68 | "constant": true, 69 | "inputs": [], 70 | "name": "pendingOwner", 71 | "outputs": [ 72 | { 73 | "name": "", 74 | "type": "address" 75 | } 76 | ], 77 | "payable": false, 78 | "stateMutability": "view", 79 | "type": "function" 80 | }, 81 | { 82 | "constant": false, 83 | "inputs": [ 84 | { 85 | "name": "newOwner", 86 | "type": "address" 87 | } 88 | ], 89 | "name": "transferOwnership", 90 | "outputs": [], 91 | "payable": false, 92 | "stateMutability": "nonpayable", 93 | "type": "function" 94 | }, 95 | { 96 | "payable": true, 97 | "stateMutability": "payable", 98 | "type": "fallback" 99 | }, 100 | { 101 | "anonymous": false, 102 | "inputs": [ 103 | { 104 | "indexed": false, 105 | "name": "total", 106 | "type": "uint256" 107 | }, 108 | { 109 | "indexed": false, 110 | "name": "tokenAddress", 111 | "type": "address" 112 | } 113 | ], 114 | "name": "Multisended", 115 | "type": "event" 116 | }, 117 | { 118 | "anonymous": false, 119 | "inputs": [ 120 | { 121 | "indexed": false, 122 | "name": "token", 123 | "type": "address" 124 | }, 125 | { 126 | "indexed": false, 127 | "name": "owner", 128 | "type": "address" 129 | }, 130 | { 131 | "indexed": false, 132 | "name": "balance", 133 | "type": "uint256" 134 | } 135 | ], 136 | "name": "ClaimedTokens", 137 | "type": "event" 138 | }, 139 | { 140 | "anonymous": false, 141 | "inputs": [ 142 | { 143 | "indexed": false, 144 | "name": "previousOwner", 145 | "type": "address" 146 | }, 147 | { 148 | "indexed": false, 149 | "name": "newOwner", 150 | "type": "address" 151 | } 152 | ], 153 | "name": "OwnershipTransferred", 154 | "type": "event" 155 | }, 156 | { 157 | "constant": false, 158 | "inputs": [ 159 | { 160 | "name": "_owner", 161 | "type": "address" 162 | } 163 | ], 164 | "name": "initialize", 165 | "outputs": [], 166 | "payable": false, 167 | "stateMutability": "nonpayable", 168 | "type": "function" 169 | }, 170 | { 171 | "constant": true, 172 | "inputs": [], 173 | "name": "initialized", 174 | "outputs": [ 175 | { 176 | "name": "", 177 | "type": "bool" 178 | } 179 | ], 180 | "payable": false, 181 | "stateMutability": "view", 182 | "type": "function" 183 | }, 184 | { 185 | "constant": true, 186 | "inputs": [ 187 | { 188 | "name": "customer", 189 | "type": "address" 190 | } 191 | ], 192 | "name": "txCount", 193 | "outputs": [ 194 | { 195 | "name": "", 196 | "type": "uint256" 197 | } 198 | ], 199 | "payable": false, 200 | "stateMutability": "view", 201 | "type": "function" 202 | }, 203 | { 204 | "constant": true, 205 | "inputs": [], 206 | "name": "arrayLimit", 207 | "outputs": [ 208 | { 209 | "name": "", 210 | "type": "uint256" 211 | } 212 | ], 213 | "payable": false, 214 | "stateMutability": "view", 215 | "type": "function" 216 | }, 217 | { 218 | "constant": false, 219 | "inputs": [ 220 | { 221 | "name": "_newLimit", 222 | "type": "uint256" 223 | } 224 | ], 225 | "name": "setArrayLimit", 226 | "outputs": [], 227 | "payable": false, 228 | "stateMutability": "nonpayable", 229 | "type": "function" 230 | }, 231 | { 232 | "constant": true, 233 | "inputs": [], 234 | "name": "discountStep", 235 | "outputs": [ 236 | { 237 | "name": "", 238 | "type": "uint256" 239 | } 240 | ], 241 | "payable": false, 242 | "stateMutability": "view", 243 | "type": "function" 244 | }, 245 | { 246 | "constant": false, 247 | "inputs": [ 248 | { 249 | "name": "_newStep", 250 | "type": "uint256" 251 | } 252 | ], 253 | "name": "setDiscountStep", 254 | "outputs": [], 255 | "payable": false, 256 | "stateMutability": "nonpayable", 257 | "type": "function" 258 | }, 259 | { 260 | "constant": true, 261 | "inputs": [], 262 | "name": "fee", 263 | "outputs": [ 264 | { 265 | "name": "", 266 | "type": "uint256" 267 | } 268 | ], 269 | "payable": false, 270 | "stateMutability": "view", 271 | "type": "function" 272 | }, 273 | { 274 | "constant": true, 275 | "inputs": [ 276 | { 277 | "name": "_customer", 278 | "type": "address" 279 | } 280 | ], 281 | "name": "currentFee", 282 | "outputs": [ 283 | { 284 | "name": "", 285 | "type": "uint256" 286 | } 287 | ], 288 | "payable": false, 289 | "stateMutability": "view", 290 | "type": "function" 291 | }, 292 | { 293 | "constant": false, 294 | "inputs": [ 295 | { 296 | "name": "_newStep", 297 | "type": "uint256" 298 | } 299 | ], 300 | "name": "setFee", 301 | "outputs": [], 302 | "payable": false, 303 | "stateMutability": "nonpayable", 304 | "type": "function" 305 | }, 306 | { 307 | "constant": true, 308 | "inputs": [ 309 | { 310 | "name": "_customer", 311 | "type": "address" 312 | } 313 | ], 314 | "name": "discountRate", 315 | "outputs": [ 316 | { 317 | "name": "", 318 | "type": "uint256" 319 | } 320 | ], 321 | "payable": false, 322 | "stateMutability": "view", 323 | "type": "function" 324 | }, 325 | { 326 | "constant": false, 327 | "inputs": [ 328 | { 329 | "name": "token", 330 | "type": "address" 331 | }, 332 | { 333 | "name": "_contributors", 334 | "type": "address[]" 335 | }, 336 | { 337 | "name": "_balances", 338 | "type": "uint256[]" 339 | } 340 | ], 341 | "name": "multisendToken", 342 | "outputs": [], 343 | "payable": true, 344 | "stateMutability": "payable", 345 | "type": "function" 346 | }, 347 | { 348 | "constant": false, 349 | "inputs": [ 350 | { 351 | "name": "_contributors", 352 | "type": "address[]" 353 | }, 354 | { 355 | "name": "_balances", 356 | "type": "uint256[]" 357 | } 358 | ], 359 | "name": "multisendEther", 360 | "outputs": [], 361 | "payable": true, 362 | "stateMutability": "payable", 363 | "type": "function" 364 | }, 365 | { 366 | "constant": false, 367 | "inputs": [ 368 | { 369 | "name": "_token", 370 | "type": "address" 371 | } 372 | ], 373 | "name": "claimTokens", 374 | "outputs": [], 375 | "payable": false, 376 | "stateMutability": "nonpayable", 377 | "type": "function" 378 | } 379 | ] -------------------------------------------------------------------------------- /src/assets/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/src/assets/images/.gitkeep -------------------------------------------------------------------------------- /src/assets/images/illustration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/src/assets/images/illustration.png -------------------------------------------------------------------------------- /src/assets/images/illustration@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/src/assets/images/illustration@2x.png -------------------------------------------------------------------------------- /src/assets/images/light@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/src/assets/images/light@2x.png -------------------------------------------------------------------------------- /src/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/src/assets/images/logo.png -------------------------------------------------------------------------------- /src/assets/images/logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/src/assets/images/logo@2x.png -------------------------------------------------------------------------------- /src/assets/images/socials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/src/assets/images/socials.png -------------------------------------------------------------------------------- /src/assets/images/socials@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstormsf/multisender/b8cb76369bbe82aa841838b35e724c853fda54f0/src/assets/images/socials@2x.png -------------------------------------------------------------------------------- /src/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | .container{position:relative;z-index:2;width:960px;margin-left:auto;margin-right:auto}@media (max-width: 980px){.container{width:96%}}.header .container,.form_header,.form-inline,.transactions-title{display:flex;justify-content:space-between}@font-face{font-family:'Lato';font-style:normal;font-weight:300;src:local("Lato Light"),local("Lato-Light"),url(https://fonts.gstatic.com/s/lato/v14/S6u9w4BMUTPHh7USSwiPGQ3q5d0.woff2) format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}@font-face{font-family:'Lato';font-style:normal;font-weight:400;src:local("Lato Regular"),local("Lato-Regular"),url(https://fonts.gstatic.com/s/lato/v14/S6uyw4BMUTPHjx4wXiWtFCc.woff2) format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}@font-face{font-family:'Lato';font-style:normal;font-weight:700;src:local("Lato Bold"),local("Lato-Bold"),url(https://fonts.gstatic.com/s/lato/v14/S6u9w4BMUTPHh6UVSwiPGQ3q5d0.woff2) format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}html{color:#9cd8ff;font-size:14px;font-family:'Lato', sans-serif;-webkit-font-smoothing:antialiased}html,body,p,h1,h2,h3{margin:0;padding:0;font-weight:normal}html{height:100%}body{position:relative;min-height:100%;box-sizing:border-box;background-color:#011d2f}body:after{content:'';position:absolute;left:50%;bottom:0;transform:translateX(-50%);background-image:url(../images/light@2x.png);background-size:100% 100%}p{color:#fff;line-height:22px;font-size:14px}a{color:#10b3ff}a:hover{text-decoration:none}strong{font-weight:bold}.title{margin-bottom:30px;color:#fff;line-height:46px;font-size:32px;font-weight:300}@media (max-width: 414px){.title{font-size:26px}}.description{margin-bottom:40px;color:#9cd8ff}.container_bg{padding-bottom:60px}.container_bg:before{content:'';position:absolute;right:-120px;top:10px;width:570px;height:445px;background-image:url(../images/illustration.png)}@media (min--moz-device-pixel-ratio: 1.3), (-o-min-device-pixel-ratio: 2.6 / 2), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){.container_bg:before{background-image:url("../images/illustration@2x.png");background-size:100% 100%}}@media (max-width: 980px){.container_bg:before{display:none}}.container_opacity:before{opacity:0.2}.content{position:relative;z-index:1;width:50%}.container_opacity .content{width:100%}@media (max-width: 980px){.content{width:100%}}.break-all{word-break:break-all}.header{margin-bottom:40px;padding:20px 0;border-bottom:1px solid rgba(149,213,255,0.1)}@media (max-width: 414px){.header{margin-bottom:30px}}.header .container{align-items:center}.header-logo{display:block;width:200px;height:36px}@media (min--moz-device-pixel-ratio: 1.3), (-o-min-device-pixel-ratio: 2.6 / 2), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){.header-logo{background-image:url("../images/logo@2x.png");background-size:100% 100%}}@media (max-width: 980px){.header-logo{width:36px;background-size:200px 100%}}.input,.select,.textarea,.button{outline:none;border-radius:20px;line-height:40px}.input,.select,.textarea,.label,.button{color:#fff;font-size:14px;font-family:'Lato', sans-serif}#addresses-with-balances{line-height:20px}#addresses-with-balances::-webkit-input-placeholder{color:#8e9ea9;opacity:0.7}#addresses-with-balances:-moz-placeholder{color:#8e9ea9;opacity:0.7}#addresses-with-balances::-moz-placeholder{color:#8e9ea9;opacity:0.7}#addresses-with-balances:-ms-input-placeholder{color:#8e9ea9;opacity:0.7}.form span.error{margin-left:10px;color:#fd7491}.form_header{align-items:center}.form-inline{align-items:flex-start}.form-inline-i_token-address{width:80%}.form-inline-i_token-decimals{width:15%}.form-inline-i_balance{width:40%}.input,.select,.textarea{width:100%;margin-bottom:20px;transition:0.3s box-shadow;box-sizing:border-box;border:1px solid #95d5ff;background-color:rgba(255,255,255,0.1)}.input:focus,.select:focus,.textarea:focus{box-shadow:0px 10px 20px 0 rgba(16,179,255,0.3)}.input,.select{height:40px}.input{padding:0 20px}.select{padding:0 38px 0 20px;appearance:none;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAICAMAAADHqI+lAAAACVBMVEWT1P+T1P+T1P9um/dXAAAAAnRSTlMAgJsrThgAAAAlSURBVHgBVcixDQAgAMOwlv+PhqWWyBan56she+KJf+KJJ57sLy2wAIFnBVRPAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-size:8px 4px;background-position:center right 20px}.form_header .select{max-width:160px;margin-bottom:0}.textarea{resize:none;height:186px;padding:10px 20px}.label{display:block;margin-bottom:20px}.form_header .label{margin-right:15px;margin-bottom:0}.button{cursor:pointer;display:inline-block;transition:0.3s box-shadow;border:0;padding:0 20px;background-color:#10b3ff;background-repeat:no-repeat;text-decoration:none;font-size:16px;font-weight:bold}.button:disabled{-moz-box-shadow:inset 0 0 10px rgba(11,72,101,0.3);-webkit-box-shadow:inset 0 0 10px rgba(11,72,101,0.3);box-shadow:inset 0 0 10px rgba(11,72,101,0.3);opacity:0.88}.button:disabled:hover{box-shadow:inset 0 0 10px rgba(11,72,101,0.3)}.button:hover{box-shadow:0px 10px 20px 0 rgba(16,179,255,0.3)}.button_next{margin-top:20px;padding-right:45px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUCAMAAACtdX32AAAAMFBMVEX///////////////////////////////////////////////////////////////9Or7hAAAAAD3RSTlMAPT5BSUpRUt3f5ufp6vUxUI2NAAAAS0lEQVR4AWPABGy8HIwMuAEvPz8fM25pDn688kx8+OWZ6SXPwsWPE/CxMwBlcQMe/NK8DKzc+AzH7zT6yiKiBH+Ekpsc2Hg54YkJAFFVCxvQpdH1AAAAAElFTkSuQmCC);background-size:15px 10px;background-position:center right 20px}.button_add{width:40px;height:40px;margin-bottom:20px;border-radius:50%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAFVBMVEX///////////////////////////9nSIHRAAAABnRSTlMASUrk5udXTd49AAAAPUlEQVR4Ae3SMRKAAAwCQRIv/P/JWqsz2JutrwPdFZQSbJT4stHfosIBJRzxJRr1ODh6Z9noBfYo6Xn+5wToPQYflYXefQAAAABJRU5ErkJggg==);background-size:18px 18px;background-position:center center}#token-address{color:#fff}.table{display:table;width:100%}.table-tr{display:table-row}.table-tr:not(:last-child) .table-td{border-bottom:1px solid rgba(152,215,255,0.3)}.table-td{display:table-cell;vertical-align:middle;padding:20px 0}.table-td:last-child{text-align:right}.table-td:first-child{text-align:left;white-space:nowrap}.table-td:not(:last-child){padding-right:20px}.table-tr_title .table-td{color:#9cd8ff;font-weight:bold}.table-td_hash{color:#9cd8ff}.table-td_check-hash{padding-left:32px;background-repeat:no-repeat;background-position:left center}.table-td_check-hash_wait{color:#9cd8ff;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAw1BMVEWK0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+nW6LJAAAAQHRSTlMAAQIDBQYHDA0bHB8gISQmJyg+P0BGR0lKU1RZYmNrbHV2iYqLo6Spqqusra7Cw8TFysvM29zk5ufo6/Lz+Pn8DzgVHgAAATNJREFUeNplk+1agkAQhQfRykQTrJTEUjSCvtTQECPk/q+qPQ7LsnR+7DOzL898LiRlOP46zfN0vXQM0tXydkWlndeqs/620LTtK3Z7LBo6OpLd5fDzl6nVubSnIXv3zIY/8N4HVGrwBj8bwjaR77SgmhYn5DWF5eE7ZoribkZkoIeI78ZJMmYrQkcGjZD9mq+SokjY6qKqEfniDIiFYMR6FqZPn+J8+A9dYX5QKs5eBaFz3p4wUkLwizrkvB2UcoZXJUwYHiqIsDclnBzAvicyrFYQpBW0lK0oqVbkEHR1fzEEHl/YhCHG1yKaoYi5zubl4Mn8wsqe6uwRK4tNmHaG717VsiP4mV1uih9G4FrttuUG7GGGTLOioUwyRI51Ftv6o94rtNcfNbCz2uB32KycCv0BfU5XCrQEyKwAAAAASUVORK5CYII=);background-size:14px 14px}.table-td_check-hash_done{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAUCAMAAACpgK3LAAAAIVBMVEUevocevocevocevocevocevocevocevocevocevocevofSHwXKAAAACnRSTlMAPT5BUVLd6er1QK/QCAAAAFBJREFUeNq10jkOwDAIRFFvwZj7HzjlVzSYLlQMT4iGdqtu/txsnohdWFhhZxQ2f7Pl1q97TivWjKD3BlGMgdhXMVUsUSxRTBTLFNNarm/xApvEBXS2sERVAAAAAElFTkSuQmCC);background-size:14px 10px}.table-td_check-hash_error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAw1BMVEX///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9ZxT1WAAAAQHRSTlMAAQIDBQYHDA0bHB8gISQmJyg+P0BGR0lOUFNUWWJjbHV2iYqLo6SpqqusrcLDxMXKy8zP29zj5+jr8vP4+fr8rwaczAAAASBJREFUKM9l0tlWwkAQRdFLABUZJEGNMqmACA5MBg3GhvP/X+VDE2I6963W7pXqrpR0TCkYLWJj4sU4KCkfbxBxSjTw/ltzRS6rZmbXO5zsgtRuDIB56Teq535/Zqtba+0fgM9Werb1BpC0Jals++17WZunA7AqSxoc2+QUYCiVImC9d3QORCV1AHPZdbRmgI5GwFRy9RkY6QPoqaBd4F0xUFdB60AsA5ypoFXAyAAXKqjFGLhSQe1n0ws5ai80tk9x1T7FDsHRu9ov0LHjmymv3zMg8qQhwKOjx8GrvAYOD5nefwGwKUuSnwC8Zj97DpD4tgrtYky7jUql0Z3aKkzPhom7YEmYtfE3edv4+aXeZrTNL7UkL5gsY2Pi5SQ40R9LbmAB1Sn/1gAAAABJRU5ErkJggg==);background-size:14px 14px}.table-remove{cursor:pointer;display:block;width:16px;height:16px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAKlBMVEUAsf8Asf8Asf8Asf8Asf8Asf8Asf8Asf8Asf8Asf8Asf8Asf8Asf8Asf9ztzDMAAAADXRSTlMATE1OUFFTVOPm5+j60HDtDwAAAFVJREFUGNNt0NEOwDAEBVDrbC3j/3937TKiwdPNSQig0bjACwchkKp0k1tUn0VuSyYd4vaJnBZ6CB6DmEX5bROzKAXlxjw+L5FXLQ5KZ3P1nMb7Cxlfp8QIeHWv2ywAAAAASUVORK5CYII=);background-position:center center;background-size:8px 8px;background-repeat:no-repeat}.send-info{word-wrap:break-word;overflow:hidden}.send-info-side{float:left;width:50%}.send-info-i{margin-bottom:20px}.send-info-amount{margin-top:10px;color:#9cd8ff;font-size:20px}.transactions-title{margin-bottom:20px}@media (max-width: 414px){.transactions-title{margin-bottom:0}}.socials{font-size:0}@media (max-width: 414px){.socials{display:none}}.socials-i{transition:0.3s background-color;position:relative;display:inline-block;vertical-align:top;width:30px;height:30px;border-radius:50%;background-color:rgba(255,255,255,0.2)}.socials-i:not(:first-child){margin-left:10px}.socials-i:hover{background-color:rgba(255,255,255,0.4)}.socials-i:before{transform:translate(-50%, -50%);content:'';position:absolute;left:50%;top:50%;background-image:url(../images/socials.png)}@media (min--moz-device-pixel-ratio: 1.3), (-o-min-device-pixel-ratio: 2.6 / 2), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){.socials-i:before{background-image:url("../images/socials@2x.png");background-size:16px 69px}}.socials-i_github:before{width:16px;height:16px;background-position:0 0}.socials-i_oracles:before{width:16px;height:14px;background-position:0 -16px}.socials-i_reddit:before{width:15px;height:13px;background-position:0 -30px}.socials-i_telegram:before{width:16px;height:14px;background-position:0 -43px}.socials-i_twitter:before{width:15px;height:12px;background-position:0 -57px} 2 | -------------------------------------------------------------------------------- /src/assets/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | @import './helpers/variables'; 2 | @import './helpers/placeholders'; 3 | @import './helpers/mixins'; 4 | 5 | @import './application/fonts'; 6 | @import './application/base'; 7 | @import './application/header'; 8 | @import './application/controls'; 9 | @import './application/table'; 10 | @import './application/send-info'; 11 | @import './application/transactions'; 12 | @import './application/socials'; 13 | -------------------------------------------------------------------------------- /src/assets/stylesheets/application/base.scss: -------------------------------------------------------------------------------- 1 | html, 2 | body, 3 | p, h1, h2, h3 { 4 | margin: 0; 5 | padding: 0; 6 | font-weight: normal; 7 | } 8 | 9 | html { 10 | height: 100%; 11 | } 12 | 13 | body { 14 | position: relative; 15 | min-height: 100%; 16 | box-sizing: border-box; 17 | background-color: #011d2f; 18 | 19 | &:after { 20 | content: ''; 21 | position: absolute; 22 | left: 50%; 23 | bottom: 0; 24 | transform: translateX(-50%); 25 | background-image: url(../images/light@2x.png); 26 | background-size: 100% 100%; 27 | } 28 | } 29 | 30 | p { 31 | color: #fff; 32 | line-height: 22px; 33 | font-size: 14px; 34 | } 35 | 36 | a { 37 | color: #10b3ff; 38 | 39 | &:hover { 40 | text-decoration: none; 41 | } 42 | } 43 | 44 | strong { 45 | font-weight: bold; 46 | } 47 | 48 | .title { 49 | margin-bottom: 30px; 50 | color: #fff; 51 | line-height: 46px; 52 | font-size: 32px; 53 | font-weight: 300; 54 | 55 | @media (max-width: $mobile--width) { 56 | font-size: 26px; 57 | } 58 | } 59 | 60 | .description { 61 | margin-bottom: 40px; 62 | color: #9cd8ff; 63 | } 64 | 65 | .container { 66 | @extend %container; 67 | 68 | &_bg { 69 | padding-bottom: 60px; 70 | 71 | &:before { 72 | @include image-2x('../images/illustration@2x.png'); 73 | content: ''; 74 | position: absolute; 75 | right: -120px; 76 | top: 10px; 77 | width: 570px; 78 | height: 445px; 79 | background-image: url(../images/illustration.png); 80 | 81 | @media (max-width: $container-responsive--width) { 82 | display: none; 83 | } 84 | } 85 | } 86 | 87 | &_opacity { 88 | &:before { 89 | opacity: 0.2; 90 | } 91 | } 92 | } 93 | 94 | .content { 95 | position: relative; 96 | z-index: 1; 97 | width: 50%; 98 | 99 | .container_opacity & { 100 | width: 100%; 101 | } 102 | 103 | @media (max-width: $container-responsive--width) { 104 | width: 100%; 105 | } 106 | } 107 | 108 | .break-all { 109 | word-break: break-all; 110 | } 111 | -------------------------------------------------------------------------------- /src/assets/stylesheets/application/controls.scss: -------------------------------------------------------------------------------- 1 | %control { 2 | outline: none; 3 | border-radius: 20px; 4 | line-height: 40px; 5 | 6 | &-font { 7 | color: #fff; 8 | font-size: 14px; 9 | font-family: 'Lato', sans-serif; 10 | } 11 | } 12 | #addresses-with-balances { 13 | line-height: 20px; 14 | &::-webkit-input-placeholder { 15 | color: #8e9ea9; 16 | opacity: 0.7; 17 | } 18 | 19 | &:-moz-placeholder { /* Firefox 18- */ 20 | color: #8e9ea9; 21 | opacity: 0.7; 22 | } 23 | 24 | &::-moz-placeholder { /* Firefox 19+ */ 25 | color: #8e9ea9; 26 | opacity: 0.7; 27 | } 28 | 29 | &:-ms-input-placeholder { 30 | color: #8e9ea9; 31 | opacity: 0.7; 32 | } 33 | } 34 | .form { 35 | span.error { 36 | margin-left: 10px; 37 | color: #fd7491; 38 | } 39 | &_header { 40 | @extend %flex-between; 41 | align-items: center; 42 | } 43 | 44 | &-inline { 45 | @extend %flex-between; 46 | align-items: flex-start; 47 | 48 | &-i { 49 | &_token-address { 50 | width: 80%; 51 | } 52 | 53 | &_token-decimals { 54 | width: 15%; 55 | } 56 | 57 | &_balance { 58 | width: 40%; 59 | } 60 | } 61 | } 62 | } 63 | 64 | 65 | .input, 66 | .select, 67 | .textarea { 68 | @extend %control; 69 | @extend %control-font; 70 | width: 100%; 71 | margin-bottom: 20px; 72 | transition: 0.3s box-shadow; 73 | box-sizing: border-box; 74 | border: 1px solid #95d5ff; 75 | background-color: fade-out(#fff, 0.9); 76 | 77 | &:focus { 78 | box-shadow: 0px 10px 20px 0 fade-out(#10b3ff, 0.7); 79 | } 80 | } 81 | 82 | .input, 83 | .select { 84 | height: 40px; 85 | } 86 | 87 | .input { 88 | padding: 0 20px; 89 | } 90 | 91 | .select { 92 | padding: 0 38px 0 20px; 93 | appearance: none; 94 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAICAMAAADHqI+lAAAACVBMVEWT1P+T1P+T1P9um/dXAAAAAnRSTlMAgJsrThgAAAAlSURBVHgBVcixDQAgAMOwlv+PhqWWyBan56she+KJf+KJJ57sLy2wAIFnBVRPAAAAAElFTkSuQmCC); 95 | background-repeat: no-repeat; 96 | background-size: 8px 4px; 97 | background-position: center right 20px; 98 | 99 | .form_header & { 100 | max-width: 160px; 101 | margin-bottom: 0; 102 | } 103 | } 104 | 105 | .textarea { 106 | resize: none; 107 | height: 186px; 108 | padding: 10px 20px; 109 | } 110 | 111 | .label { 112 | @extend %control-font; 113 | display: block; 114 | margin-bottom: 20px; 115 | 116 | .form_header & { 117 | margin-right: 15px; 118 | margin-bottom: 0; 119 | } 120 | } 121 | 122 | .button { 123 | @extend %control; 124 | @extend %control-font; 125 | cursor: pointer; 126 | display: inline-block; 127 | transition: 0.3s box-shadow; 128 | border: 0; 129 | padding: 0 20px; 130 | background-color: #10b3ff; 131 | background-repeat: no-repeat; 132 | text-decoration: none; 133 | font-size: 16px; 134 | font-weight: bold; 135 | &:disabled { 136 | -moz-box-shadow: inset 0 0 10px fade-out(#0b4865, 0.7); 137 | -webkit-box-shadow: inset 0 0 10px fade-out(#0b4865, 0.7); 138 | box-shadow: inset 0 0 10px fade-out(#0b4865, 0.7); 139 | opacity: 0.88; 140 | } 141 | &:disabled:hover { 142 | box-shadow: inset 0 0 10px fade-out(#0b4865, 0.7); 143 | } 144 | &:hover { 145 | box-shadow: 0px 10px 20px 0 fade-out(#10b3ff, 0.7); 146 | } 147 | 148 | &_next { 149 | margin-top: 20px; 150 | padding-right: 45px; 151 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUCAMAAACtdX32AAAAMFBMVEX///////////////////////////////////////////////////////////////9Or7hAAAAAD3RSTlMAPT5BSUpRUt3f5ufp6vUxUI2NAAAAS0lEQVR4AWPABGy8HIwMuAEvPz8fM25pDn688kx8+OWZ6SXPwsWPE/CxMwBlcQMe/NK8DKzc+AzH7zT6yiKiBH+Ekpsc2Hg54YkJAFFVCxvQpdH1AAAAAElFTkSuQmCC); 152 | background-size: 15px 10px; 153 | background-position: center right 20px; 154 | } 155 | 156 | &_add { 157 | width: 40px; 158 | height: 40px; 159 | margin-bottom: 20px; 160 | border-radius: 50%; 161 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAFVBMVEX///////////////////////////9nSIHRAAAABnRSTlMASUrk5udXTd49AAAAPUlEQVR4Ae3SMRKAAAwCQRIv/P/JWqsz2JutrwPdFZQSbJT4stHfosIBJRzxJRr1ODh6Z9noBfYo6Xn+5wToPQYflYXefQAAAABJRU5ErkJggg==); 162 | background-size: 18px 18px; 163 | background-position: center center; 164 | } 165 | } 166 | // .Select-option,.Select-control, .Select.Select--single.has-value.is-focused.is-clearable > .Select-control, .Select--single > .Select-value { 167 | // background-color: #213443; 168 | // color: #fff; 169 | // border: 1px solid #95d5ff; 170 | // // border: 1px solid #95d5ff; 171 | // } 172 | // .Select-placeholder, .Select--single > .Select-control .Select-value { 173 | // color: #fff; 174 | // } 175 | // .Select.has-value.Select--single > .Select-control .Select-value .Select-value-label, .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label { 176 | // color: #fff; 177 | // } 178 | 179 | #token-address { 180 | color: #fff; 181 | } -------------------------------------------------------------------------------- /src/assets/stylesheets/application/fonts.scss: -------------------------------------------------------------------------------- 1 | /* latin */ 2 | @font-face { 3 | font-family: 'Lato'; 4 | font-style: normal; 5 | font-weight: 300; 6 | src: local('Lato Light'), local('Lato-Light'), url(https://fonts.gstatic.com/s/lato/v14/S6u9w4BMUTPHh7USSwiPGQ3q5d0.woff2) format('woff2'); 7 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; 8 | } 9 | 10 | /* latin */ 11 | @font-face { 12 | font-family: 'Lato'; 13 | font-style: normal; 14 | font-weight: 400; 15 | src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v14/S6uyw4BMUTPHjx4wXiWtFCc.woff2) format('woff2'); 16 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; 17 | } 18 | 19 | /* latin */ 20 | @font-face { 21 | font-family: 'Lato'; 22 | font-style: normal; 23 | font-weight: 700; 24 | src: local('Lato Bold'), local('Lato-Bold'), url(https://fonts.gstatic.com/s/lato/v14/S6u9w4BMUTPHh6UVSwiPGQ3q5d0.woff2) format('woff2'); 25 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; 26 | } 27 | 28 | html { 29 | color: #9cd8ff; 30 | font-size: 14px; 31 | font-family: 'Lato', sans-serif; 32 | -webkit-font-smoothing: antialiased; 33 | } 34 | -------------------------------------------------------------------------------- /src/assets/stylesheets/application/header.scss: -------------------------------------------------------------------------------- 1 | .header { 2 | margin-bottom: 40px; 3 | padding: 20px 0; 4 | border-bottom: 1px solid fade-out(#95d5ff, 0.9); 5 | 6 | @media (max-width: $mobile--width) { 7 | margin-bottom: 30px; 8 | } 9 | 10 | .container { 11 | @extend %flex-between; 12 | align-items: center; 13 | } 14 | 15 | &-logo { 16 | @include image-2x('../images/logo@2x.png'); 17 | display: block; 18 | width: 200px; 19 | height: 36px; 20 | 21 | @media (max-width: $container-responsive--width) { 22 | width: 36px; 23 | background-size: 200px 100%; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/assets/stylesheets/application/send-info.scss: -------------------------------------------------------------------------------- 1 | .send-info { 2 | word-wrap: break-word; 3 | overflow: hidden; 4 | 5 | &-side { 6 | float: left; 7 | width: 50%; 8 | } 9 | 10 | &-i { 11 | margin-bottom: 20px; 12 | } 13 | 14 | &-amount { 15 | margin-top: 10px; 16 | color: #9cd8ff; 17 | font-size: 20px; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/assets/stylesheets/application/socials.scss: -------------------------------------------------------------------------------- 1 | .socials { 2 | @media (max-width: $mobile--width) { 3 | display: none; 4 | } 5 | font-size: 0; 6 | 7 | &-i { 8 | transition: 0.3s background-color; 9 | position: relative; 10 | display: inline-block; 11 | vertical-align: top; 12 | width: 30px; 13 | height: 30px; 14 | border-radius: 50%; 15 | background-color: fade-out(#fff, 0.8); 16 | 17 | &:not(:first-child) { 18 | margin-left: 10px; 19 | } 20 | 21 | &:hover { 22 | background-color: fade-out(#fff, 0.6); 23 | } 24 | 25 | &:before { 26 | @include image-2x('../images/socials@2x.png', 16px, 69px); 27 | transform: translate(-50%, -50%); 28 | content: ''; 29 | position: absolute; 30 | left: 50%; 31 | top: 50%; 32 | background-image: url(../images/socials.png); 33 | } 34 | 35 | &_github { 36 | &:before { 37 | width: 16px; 38 | height: 16px; 39 | background-position: 0 0; 40 | } 41 | } 42 | 43 | &_oracles { 44 | &:before { 45 | width: 16px; 46 | height: 14px; 47 | background-position: 0 -16px; 48 | } 49 | } 50 | 51 | &_reddit { 52 | &:before { 53 | width: 15px; 54 | height: 13px; 55 | background-position: 0 -30px; 56 | } 57 | } 58 | 59 | &_telegram { 60 | &:before { 61 | width: 16px; 62 | height: 14px; 63 | background-position: 0 -43px; 64 | } 65 | } 66 | 67 | &_twitter { 68 | &:before { 69 | width: 15px; 70 | height: 12px; 71 | background-position: 0 -57px; 72 | } 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /src/assets/stylesheets/application/table.scss: -------------------------------------------------------------------------------- 1 | .table { 2 | display: table; 3 | width: 100%; 4 | 5 | $this: &; 6 | 7 | &-tr { 8 | display: table-row; 9 | 10 | &:not(:last-child) { 11 | #{$this}-td { 12 | border-bottom: 1px solid fade-out(#98d7ff, 0.7); 13 | } 14 | } 15 | } 16 | 17 | &-td { 18 | display: table-cell; 19 | vertical-align: middle; 20 | padding: 20px 0; 21 | 22 | &:last-child { 23 | text-align: right; 24 | } 25 | 26 | &:first-child { 27 | text-align: left; 28 | white-space: nowrap; 29 | } 30 | 31 | &:not(:last-child) { 32 | padding-right: 20px; 33 | } 34 | 35 | #{$this}-tr_title & { 36 | color: #9cd8ff; 37 | font-weight: bold; 38 | } 39 | 40 | &_hash { 41 | color: #9cd8ff; 42 | } 43 | 44 | &_check-hash { 45 | padding-left: 32px; 46 | background-repeat: no-repeat; 47 | background-position: left center; 48 | 49 | &_wait { 50 | color: #9cd8ff; 51 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAw1BMVEWK0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+K0f+nW6LJAAAAQHRSTlMAAQIDBQYHDA0bHB8gISQmJyg+P0BGR0lKU1RZYmNrbHV2iYqLo6Spqqusra7Cw8TFysvM29zk5ufo6/Lz+Pn8DzgVHgAAATNJREFUeNplk+1agkAQhQfRykQTrJTEUjSCvtTQECPk/q+qPQ7LsnR+7DOzL898LiRlOP46zfN0vXQM0tXydkWlndeqs/620LTtK3Z7LBo6OpLd5fDzl6nVubSnIXv3zIY/8N4HVGrwBj8bwjaR77SgmhYn5DWF5eE7ZoribkZkoIeI78ZJMmYrQkcGjZD9mq+SokjY6qKqEfniDIiFYMR6FqZPn+J8+A9dYX5QKs5eBaFz3p4wUkLwizrkvB2UcoZXJUwYHiqIsDclnBzAvicyrFYQpBW0lK0oqVbkEHR1fzEEHl/YhCHG1yKaoYi5zubl4Mn8wsqe6uwRK4tNmHaG717VsiP4mV1uih9G4FrttuUG7GGGTLOioUwyRI51Ftv6o94rtNcfNbCz2uB32KycCv0BfU5XCrQEyKwAAAAASUVORK5CYII=); 52 | background-size: 14px 14px; 53 | } 54 | 55 | &_done { 56 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAUCAMAAACpgK3LAAAAIVBMVEUevocevocevocevocevocevocevocevocevocevocevofSHwXKAAAACnRSTlMAPT5BUVLd6er1QK/QCAAAAFBJREFUeNq10jkOwDAIRFFvwZj7HzjlVzSYLlQMT4iGdqtu/txsnohdWFhhZxQ2f7Pl1q97TivWjKD3BlGMgdhXMVUsUSxRTBTLFNNarm/xApvEBXS2sERVAAAAAElFTkSuQmCC); 57 | background-size: 14px 10px; 58 | } 59 | 60 | &_error { 61 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAw1BMVEX///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9ZxT1WAAAAQHRSTlMAAQIDBQYHDA0bHB8gISQmJyg+P0BGR0lOUFNUWWJjbHV2iYqLo6SpqqusrcLDxMXKy8zP29zj5+jr8vP4+fr8rwaczAAAASBJREFUKM9l0tlWwkAQRdFLABUZJEGNMqmACA5MBg3GhvP/X+VDE2I6963W7pXqrpR0TCkYLWJj4sU4KCkfbxBxSjTw/ltzRS6rZmbXO5zsgtRuDIB56Teq535/Zqtba+0fgM9Werb1BpC0Jals++17WZunA7AqSxoc2+QUYCiVImC9d3QORCV1AHPZdbRmgI5GwFRy9RkY6QPoqaBd4F0xUFdB60AsA5ypoFXAyAAXKqjFGLhSQe1n0ws5ai80tk9x1T7FDsHRu9ov0LHjmymv3zMg8qQhwKOjx8GrvAYOD5nefwGwKUuSnwC8Zj97DpD4tgrtYky7jUql0Z3aKkzPhom7YEmYtfE3edv4+aXeZrTNL7UkL5gsY2Pi5SQ40R9LbmAB1Sn/1gAAAABJRU5ErkJggg==); 62 | background-size: 14px 14px; 63 | } 64 | } 65 | } 66 | 67 | &-remove { 68 | cursor: pointer; 69 | display: block; 70 | width: 16px; 71 | height: 16px; 72 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAKlBMVEUAsf8Asf8Asf8Asf8Asf8Asf8Asf8Asf8Asf8Asf8Asf8Asf8Asf8Asf9ztzDMAAAADXRSTlMATE1OUFFTVOPm5+j60HDtDwAAAFVJREFUGNNt0NEOwDAEBVDrbC3j/3937TKiwdPNSQig0bjACwchkKp0k1tUn0VuSyYd4vaJnBZ6CB6DmEX5bROzKAXlxjw+L5FXLQ5KZ3P1nMb7Cxlfp8QIeHWv2ywAAAAASUVORK5CYII=); 73 | background-position: center center; 74 | background-size: 8px 8px; 75 | background-repeat: no-repeat; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/assets/stylesheets/application/transactions.scss: -------------------------------------------------------------------------------- 1 | .transactions { 2 | &-title { 3 | @extend %flex-between; 4 | margin-bottom: 20px; 5 | 6 | @media (max-width: $mobile--width) { 7 | margin-bottom: 0; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/assets/stylesheets/helpers/mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin image-2x($image, $width: 100%, $height: 100%) { 2 | @media (min--moz-device-pixel-ratio: 1.3), 3 | (-o-min-device-pixel-ratio: 2.6/2), 4 | (-webkit-min-device-pixel-ratio: 1.3), 5 | (min-device-pixel-ratio: 1.3), 6 | (min-resolution: 1.3dppx) { 7 | background-image: url($image); 8 | background-size: $width $height; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/assets/stylesheets/helpers/placeholders.scss: -------------------------------------------------------------------------------- 1 | %clear { 2 | display: block; 3 | clear: both; 4 | 5 | &:before, 6 | &:after { 7 | content: ''; 8 | display: block; 9 | clear: both; 10 | } 11 | } 12 | 13 | %container { 14 | position: relative; 15 | z-index: 2; 16 | width: $container--width; 17 | margin-left: auto; 18 | margin-right: auto; 19 | 20 | @media (max-width: $container-responsive--width) { 21 | width: 96%; 22 | } 23 | } 24 | 25 | %flex-between { 26 | display: flex; 27 | justify-content: space-between; 28 | } 29 | -------------------------------------------------------------------------------- /src/assets/stylesheets/helpers/variables.scss: -------------------------------------------------------------------------------- 1 | $container--width: 960px; 2 | $container-responsive--width: 980px; 3 | $mobile--width: 414px; 4 | -------------------------------------------------------------------------------- /src/assets/stylesheets/react-select.min.css: -------------------------------------------------------------------------------- 1 | .Select{position:relative}.Select input::-webkit-contacts-auto-fill-button,.Select input::-webkit-credentials-auto-fill-button{display:none!important}.Select input::-ms-clear{display:none!important}.Select input::-ms-reveal{display:none!important}.Select,.Select div,.Select input,.Select span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.Select.is-disabled .Select-arrow-zone{cursor:default;pointer-events:none;opacity:.35}.Select.is-disabled>.Select-control{background-color:#182632}.Select.is-disabled>.Select-control:hover{box-shadow:none}.Select.is-open>.Select-control{border-bottom-right-radius:0;border-bottom-left-radius:0;background:#213443;border-color:#62c1ff #95d5ff #afdfff}.Select.is-open>.Select-control .Select-arrow{top:-2px;border-color:transparent transparent #fff;border-width:0 5px 5px}.Select.is-searchable.is-open>.Select-control{cursor:text}.Select.is-searchable.is-focused:not(.is-open)>.Select-control{cursor:text}.Select.is-focused>.Select-control{background:#213443}.Select.is-focused:not(.is-open)>.Select-control{border-color:#fff;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 0 3px rgba(255,255,255,.1);background:#213443}.Select.has-value.is-clearable.Select--single>.Select-control .Select-value{padding-right:42px}.Select.has-value.Select--single>.Select-control .Select-value .Select-value-label,.Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value .Select-value-label{color:#ebe9e9}.Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label,.Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label{cursor:pointer;text-decoration:none}.Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus,.Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:hover,.Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:hover{color:#fff;outline:0;text-decoration:underline}.Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus,.Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus{background:#213443}.Select.has-value.is-pseudo-focused .Select-input{opacity:0}.Select .Select-arrow-zone:hover>.Select-arrow,.Select.is-open .Select-arrow{border-top-color:#fff}.Select.Select--rtl{direction:rtl;text-align:right}.Select-control{background-color:#213443;border-color:#afdfff #95d5ff #62c1ff;border-radius:4px;border:1px solid #95d5ff;color:#ebe9e9;cursor:default;display:table;border-spacing:0;border-collapse:separate;height:36px;outline:0;overflow:hidden;position:relative;width:100%}.Select-control:hover{box-shadow:0 1px 0 rgba(255,255,255,.06)}.Select-control .Select-input:focus{outline:0;background:#213443}.Select--single>.Select-control .Select-value,.Select-placeholder{bottom:0;color:#fff;left:0;line-height:34px;padding-left:10px;padding-right:10px;position:absolute;right:0;top:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Select-input{height:34px;padding-left:10px;padding-right:10px;vertical-align:middle}.Select-input>input{width:100%;background:none transparent;border:0 none;box-shadow:none;cursor:default;display:inline-block;font-family:inherit;font-size:inherit;margin:0;outline:0;line-height:17px;padding:8px 0 12px;-webkit-appearance:none}.is-focused .Select-input>input{cursor:text}.has-value.is-pseudo-focused .Select-input{opacity:0}.Select-control:not(.is-searchable)>.Select-input{outline:0}.Select-loading-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:16px}.Select-loading{-webkit-animation:Select-animation-spin .4s infinite linear;-o-animation:Select-animation-spin .4s infinite linear;animation:Select-animation-spin .4s infinite linear;width:16px;height:16px;box-sizing:border-box;border-radius:50%;border:2px solid #95d5ff;border-right-color:#ebe9e9;display:inline-block;position:relative;vertical-align:middle}.Select-clear-zone{-webkit-animation:Select-animation-fadeIn .2s;-o-animation:Select-animation-fadeIn .2s;animation:Select-animation-fadeIn .2s;color:#fff;cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:17px}.Select-clear-zone:hover{color:#d8d8d8}.Select-clear{display:inline-block;font-size:18px;line-height:1}.Select--multi .Select-clear-zone{width:17px}.Select-arrow-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:25px;padding-right:5px}.Select--rtl .Select-arrow-zone{padding-right:0;padding-left:5px}.Select-arrow{border-color:#fff transparent transparent;border-style:solid;border-width:5px 5px 2.5px;display:inline-block;height:0;width:0;position:relative}.Select-control>:last-child{padding-right:5px}.Select--multi .Select-multi-value-wrapper{display:inline-block}.Select .Select-aria-only{position:absolute;display:inline-block;height:1px;width:1px;margin:-1px;clip:rect(0,0,0,0);overflow:hidden;float:left}@-webkit-keyframes Select-animation-fadeIn{from{opacity:0}to{opacity:1}}@keyframes Select-animation-fadeIn{from{opacity:0}to{opacity:1}}.Select-menu-outer{border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#213443;border:1px solid #95d5ff;border-top-color:#5b85a1;box-shadow:0 1px 0 rgba(255,255,255,.06);box-sizing:border-box;margin-top:-1px;max-height:200px;position:absolute;left:0;top:100%;width:100%;z-index:1;-webkit-overflow-scrolling:touch}.Select-menu{max-height:198px;overflow-y:auto}.Select-option{box-sizing:border-box;background-color:#213443;color:#fff;cursor:pointer;display:block;padding:8px 10px}.Select-option:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.Select-option.is-selected{background-color:#2a3c4b;background-color:rgba(255,255,255,.04);color:#ebe9e9}.Select-option.is-focused{background-color:#334452;background-color:rgba(255,255,255,.08);color:#ebe9e9}.Select-option.is-disabled{color:#fff;cursor:default}.Select-noresults{box-sizing:border-box;color:#fff;cursor:default;display:block;padding:8px 10px}.Select--multi .Select-input{vertical-align:middle;margin-left:10px;padding:0}.Select--multi.Select--rtl .Select-input{margin-left:0;margin-right:10px}.Select--multi.has-value .Select-input{margin-left:5px}.Select--multi .Select-value{background-color:#334452;background-color:rgba(255,255,255,.08);border-radius:2px;border:1px solid #566570;border:1px solid rgba(255,255,255,.24);color:#fff;display:inline-block;font-size:.9em;line-height:1.4;margin-left:5px;margin-top:5px;vertical-align:top}.Select--multi .Select-value-icon,.Select--multi .Select-value-label{display:inline-block;vertical-align:middle}.Select--multi .Select-value-label{border-bottom-right-radius:2px;border-top-right-radius:2px;cursor:default;padding:2px 5px}.Select--multi a.Select-value-label{color:#fff;cursor:pointer;text-decoration:none}.Select--multi a.Select-value-label:hover{text-decoration:underline}.Select--multi .Select-value-icon{cursor:pointer;border-bottom-left-radius:2px;border-top-left-radius:2px;border-right:1px solid #566570;border-right:1px solid rgba(255,255,255,.24);padding:1px 5px 3px}.Select--multi .Select-value-icon:focus,.Select--multi .Select-value-icon:hover{background-color:#42525f;background-color:rgba(242,242,242,.08);color:#f2f2f2}.Select--multi .Select-value-icon:active{background-color:#566570;background-color:rgba(255,255,255,.24)}.Select--multi.Select--rtl .Select-value{margin-left:0;margin-right:5px}.Select--multi.Select--rtl .Select-value-icon{border-right:none;border-left:1px solid #566570;border-left:1px solid rgba(255,255,255,.24)}.Select--multi.is-disabled .Select-value{background-color:#fcfcfc;border:1px solid #e3e3e3;color:#828282}.Select--multi.is-disabled .Select-value-icon{cursor:not-allowed;border-right:1px solid #e3e3e3}.Select--multi.is-disabled .Select-value-icon:active,.Select--multi.is-disabled .Select-value-icon:focus,.Select--multi.is-disabled .Select-value-icon:hover{background-color:#fcfcfc}@keyframes Select-animation-spin{to{transform:rotate(1turn)}}@-webkit-keyframes Select-animation-spin{to{-webkit-transform:rotate(1turn)}} -------------------------------------------------------------------------------- /src/components/1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Web3Utils from 'web3-utils'; 3 | import Form from 'react-validation/build/form'; 4 | import Textarea from 'react-validation/build/textarea'; 5 | import Button from 'react-validation/build/button'; 6 | import { form, control, button } from 'react-validation'; 7 | import { inject, observer } from "mobx-react"; 8 | import swal from 'sweetalert'; 9 | import generateElement from '../generateElement' 10 | import Example from './example.json' 11 | import { PulseLoader} from 'react-spinners'; 12 | import {RadioGroup, Radio} from 'react-radio-group'; 13 | import csvtojson from 'csvtojson' 14 | import Select from 'react-select' 15 | import '../assets/stylesheets/react-select.min.css'; 16 | 17 | 18 | const ownInput = ({ error, isChanged, isUsed, ...props }) => ( 19 |
20 | {isChanged && isUsed && error} 21 | 22 |
23 | ); 24 | const Input = control(ownInput); 25 | 26 | const required = (value) => { 27 | if (!value.toString().trim().length) { 28 | return required; 29 | } 30 | }; 31 | 32 | const isAddress = (value) => { 33 | if (!Web3Utils.isAddress(value)) { 34 | return Token address is invalid; 35 | } 36 | }; 37 | const InvalidJSON =
Your JSON is invalid, please visit Online Json Validator
38 | 39 | const isJson = (value) => { 40 | try { 41 | JSON.parse(value) 42 | } catch(e) { 43 | return InvalidJSON 44 | } 45 | }; 46 | 47 | @inject("UiStore") 48 | @observer 49 | export class FirstStep extends React.Component { 50 | constructor(props){ 51 | super(props); 52 | this.tokenStore = props.UiStore.tokenStore; 53 | this.txStore = props.UiStore.txStore; 54 | this.web3Store = props.UiStore.web3Store; 55 | this.web3Store.setStartedUrl('#/'); 56 | this.onTokenAddress = this.onTokenAddress.bind(this); 57 | this.onDecimalsChange = this.onDecimalsChange.bind(this); 58 | this.onJsonChange = this.onJsonChange.bind(this); 59 | this.onSubmit = this.onSubmit.bind(this); 60 | this.state ={ 61 | format: '', 62 | placeholder: JSON.stringify(Example), 63 | tokenAddress: {label: '', value: null} 64 | } 65 | this.onSelectFormat = this.onSelectFormat.bind(this) 66 | this.onParse = this.onParse.bind(this) 67 | this.parseCompleted = false; 68 | this.list = []; 69 | } 70 | 71 | componentDidMount() { 72 | this.tokenStore.reset() 73 | this.txStore.reset() 74 | } 75 | async onTokenAddress(e){ 76 | if(!e){ 77 | this.setState({tokenAddress: {label: '', value: ''}}) 78 | return 79 | } 80 | const address = e.value; 81 | if (Web3Utils.isAddress(address)) { 82 | this.tokenStore.setTokenAddress(address); 83 | this.setState({tokenAddress: {label: e.label, value: e.value}}) 84 | } 85 | } 86 | onSelectFormat(newFormat){ 87 | this.parseCompleted = false; 88 | if(newFormat === 'csv'){ 89 | this.setState({format: newFormat, placeholder: ` 90 | 0xCBA5018De6b2b6F89d84A1F5A68953f07554765e,12 91 | 0xa6Bf70bd230867c870eF13631D7EFf1AE8Ab85c9,1123.45645 92 | 0x00b5F428905DEA1a67940093fFeaCeee58cA91Ae,1.049 93 | 0x00fC79F38bAf0dE21E1fee5AC4648Bc885c1d774,14546 94 | `}) 95 | swal("Information", `Please provide CSV file in comma separated address,balance format one line per address. 96 | \nExample:\n 97 | 0xCBA5018De6b2b6F89d84A1F5A68953f07554765e,12 98 | 0xa6Bf70bd230867c870eF13631D7EFf1AE8Ab85c9,113.45 99 | 0x00b5F428905DEA1a67940093fFeaCeee58cA91Ae,1.049 100 | 0x00fC79F38bAf0dE21E1fee5AC4648Bc885c1d774,14546 101 | `, 'info') 102 | } else { 103 | this.setState({format: newFormat, placeholder: JSON.stringify(Example)}) 104 | swal({ 105 | content: generateElement(`
106 | Please provide JSON-array file in the following format. 107 | \nExample:\n 108 |
109 | [
110 | {"0xCBA5018De6b2b6F89d84A1F5A68953f07554765e":"12"}, 111 | {"0xa6Bf70bd230867c870eF13631D7EFf1AE8Ab85c9":"1123.45645"}, 112 | {"0x00b5F428905DEA1a67940093fFeaCeee58cA91Ae":"1.049"}, 113 | {"0x00fC79F38bAf0dE21E1fee5AC4648Bc885c1d774":"14546"} 114 |
] 115 |
116 |
117 | `), 118 | icon: 'info' 119 | }) 120 | 121 | } 122 | } 123 | onDecimalsChange(e) { 124 | this.tokenStore.setDecimals(e.target.value) 125 | } 126 | 127 | onJsonChange(value) { 128 | try { 129 | let addresses = JSON.parse(value); 130 | this.tokenStore.setJsonAddresses(addresses) 131 | this.parseCompleted = true; 132 | } catch(e) { 133 | const error = e.message.replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\t/g, '\\t'); 134 | console.error(error) 135 | swal({ 136 | content: generateElement(`${error} Please visit JsonLint.com`), 137 | icon: "error", 138 | }) 139 | } 140 | } 141 | 142 | async onCsvChange(value){ 143 | return new Promise((res, rej) => { 144 | let addresses = []; 145 | csvtojson({noheader:true}) 146 | .fromString(value) 147 | .on('csv',(csv)=>{ 148 | let el = {}; 149 | if(csv.length === 2){ 150 | Object.defineProperty(el, csv[0], { 151 | value: csv[1], 152 | writable: true, 153 | configurable: true, 154 | enumerable: true, 155 | }); 156 | addresses.push(el) 157 | } 158 | }) 159 | .on('end', () => { 160 | try { 161 | console.log('csv is done') 162 | this.parseCompleted = true; 163 | this.tokenStore.setJsonAddresses(addresses) 164 | res(addresses); 165 | } catch(e) { 166 | console.error(e) 167 | rej(e); 168 | swal({ 169 | content: "Your CSV is invalid", 170 | icon: "error", 171 | }) 172 | } 173 | }) 174 | }) 175 | } 176 | 177 | onParse(e){ 178 | this.list = e.target.value; 179 | if(this.state.format === 'json') { 180 | this.onJsonChange(e.target.value) 181 | } 182 | if(this.state.format === 'csv'){ 183 | this.onCsvChange(e.target.value) 184 | } 185 | return 186 | } 187 | async onSubmit(e){ 188 | try { 189 | e.preventDefault() 190 | if(this.state.format === ''){ 191 | swal("Error!", "Please select format CSV or JSON", 'error') 192 | return 193 | } 194 | 195 | if(!this.parseCompleted){ 196 | if(this.state.format === 'json') { 197 | this.onJsonChange(this.list) 198 | } else { 199 | await this.onCsvChange(this.list) 200 | } 201 | } 202 | await this.tokenStore.parseAddresses() 203 | console.log('length of addresses', this.tokenStore.jsonAddresses.length) 204 | if(this.tokenStore.jsonAddresses.length === 0){ 205 | swal({ 206 | title: "The address list is empty.", 207 | text: "Please make sure you set correct CSV or JSON format in input selector", 208 | icon: "error", 209 | }) 210 | return 211 | } 212 | if(this.tokenStore.invalid_addresses.length > 0){ 213 | swal({ 214 | title: "There are invalid eth addresses. If you click Next, multisender will remove them from the list.", 215 | text: JSON.stringify(this.tokenStore.invalid_addresses.slice(), null, '\n'), 216 | icon: "error", 217 | }) 218 | } else { 219 | this.props.history.push('/3') 220 | } 221 | } catch(e) { 222 | console.error(e) 223 | swal({ 224 | title: "Parsing Error", 225 | text: e.message, 226 | icon: "error", 227 | }) 228 | } 229 | return 230 | } 231 | render () { 232 | if(this.tokenStore.errors.length > 0){ 233 | swal("Error!", this.tokenStore.errors.toString(), 'error') 234 | } 235 | if(this.web3Store.errors.length > 0){ 236 | swal("Error!", this.web3Store.errors.toString(), 'error') 237 | } 238 | return ( 239 |
240 | 241 |
242 |
243 | 247 |
248 |

Welcome to Token MultiSender

249 |

250 | Please provide Token Address, JSON/CSV file with addresses
251 | This Dapp supports Mainnet, POA-Core, POA-sokol, Ropsten, Rinkeby, Kovan
252 | Please wait while all your token balances are loaded 253 |

254 |
255 |
256 |
257 | 258 | 269 | 270 |
271 |
272 | 273 | 274 |
275 |
276 | 283 | 289 | 290 |
291 |
292 |
293 | ); 294 | } 295 | } -------------------------------------------------------------------------------- /src/components/2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | 4 | export class SecondStep extends React.Component { 5 | render () { 6 | return ( 7 |
8 |
9 |

Welcome to Token MultiSender

10 |

11 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod 12 | tempor incididunt ut labore et dolore magna aliqua. 13 |

14 |
15 |
16 |
17 | 18 | 19 |
20 |
21 | 22 | 23 |
24 |
25 |
26 |
27 | 28 | 29 |
30 |
31 | 32 | 33 |
34 | 35 |
36 |
37 |
38 |

0.5 ETH

39 |

0xf3a71cc1be5ce833c471e3f25aa391f9cd56e1aa

40 |
41 | 42 |
43 |
44 |
45 |

2.001 ETH

46 |

0x67de6a531b58327d075535e89524be5c5672f16b

47 |
48 | 49 |
50 |
51 |
52 | Check Information 53 |
54 |
55 |
56 | ); 57 | } 58 | } -------------------------------------------------------------------------------- /src/components/3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | import ReactJson from 'react-json-view' 4 | import { inject, observer } from "mobx-react"; 5 | import BN from 'bignumber.js' 6 | import swal from 'sweetalert'; 7 | import Select from 'react-select'; 8 | 9 | @inject("UiStore") 10 | @observer 11 | export class ThirdStep extends React.Component { 12 | constructor(props){ 13 | super(props); 14 | this.tokenStore = props.UiStore.tokenStore; 15 | this.gasPriceStore = props.UiStore.gasPriceStore; 16 | console.log(this.gasPriceStore.gasPricesArray) 17 | this.onNext = this.onNext.bind(this) 18 | this.state = { 19 | gasPrice: '' 20 | } 21 | } 22 | componentDidMount() { 23 | if(this.tokenStore.dublicates.length > 0){ 24 | 25 | swal({ 26 | title: `There were duplicated eth addresses in your list.`, 27 | text: `${JSON.stringify(this.tokenStore.dublicates.slice(), null, '\n')}.\n Multisender already combined the balances for those addreses. Please make sure it did the calculation correctly.`, 28 | icon: "warning", 29 | }) 30 | } 31 | } 32 | onNext(e) { 33 | e.preventDefault(); 34 | if (new BN(this.tokenStore.totalBalance).gt(new BN(this.tokenStore.defAccTokenBalance))){ 35 | console.error('Your balance is more than total to send') 36 | swal({ 37 | title: "Insufficient token balance", 38 | text: `You don't have enough tokens to send to all addresses.\nAmount needed: ${this.tokenStore.totalBalance} ${this.tokenStore.tokenSymbol}`, 39 | icon: "error", 40 | }) 41 | return 42 | } 43 | if( new BN(this.tokenStore.totalCostInEth).gt(new BN(this.tokenStore.ethBalance))){ 44 | console.error('please fund you account in ') 45 | swal({ 46 | title: "Insufficient ETH balance", 47 | text: `You don't have enough ETH to send to all addresses. Amount needed: ${this.tokenStore.totalCostInEth} ETH`, 48 | icon: "error", 49 | }) 50 | return 51 | } 52 | this.props.history.push('/4') 53 | } 54 | 55 | onGasPriceChange = (selected) => { 56 | if(selected){ 57 | this.gasPriceStore.setSelectedGasPrice(selected.value) 58 | } 59 | } 60 | render() { 61 | return ( 62 |
63 |
64 |

Welcome to Token MultiSender

65 |

66 | Please provide Token Address, JSON file with addresses
67 | This Dapp supports Mainnet, POA-Core, POA-sokol, Ropsten, Rinkeby, Kovan 68 |

69 |
70 | 77 |
78 |

Network Speed (Gas Price)

79 | 87 |
88 |
89 |
90 |
91 |

Total Tokens to be Sent

92 |

{this.tokenStore.totalBalance} {this.tokenStore.tokenSymbol}

93 |
94 |
95 |

Your Balance

96 |

{this.tokenStore.defAccTokenBalance} {this.tokenStore.tokenSymbol}

97 |
98 |
99 |

Your Contract's Current fee Per tx

100 |

{this.tokenStore.currentFee} ETH

101 |
102 |
103 |

Your ETH Balance

104 |

{this.tokenStore.ethBalance}

105 |
106 |
107 |
108 |
109 |

Total Addresses in the Array

110 |

{this.tokenStore.jsonAddresses.length}

111 |
112 |
113 |

Current Allowance

114 |

{this.tokenStore.allowance} {this.tokenStore.tokenSymbol}

115 |
116 |
117 |

Total Number of tx Needed

118 |

{this.tokenStore.totalNumberTx}

119 |
120 |
121 |

Approximate Cost of Operation

122 |

123 | {this.tokenStore.totalCostInEth} ETH 124 |

125 |
126 |
127 |

Selected Network speed (Gas Price)

128 |

129 | {this.gasPriceStore.selectedGasPrice} gwei 130 |

131 |
132 |
133 |
134 | 135 | Next 136 | 137 |
138 |
139 | ); 140 | } 141 | } -------------------------------------------------------------------------------- /src/components/4.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { inject, observer } from "mobx-react"; 3 | 4 | 5 | const Transaction = (tx) => { 6 | const {name, hash, status} = tx.tx; 7 | let classname; 8 | switch(status){ 9 | case 'mined': 10 | classname = 'table-td_check-hash_done' 11 | break; 12 | case 'error': 13 | classname = 'table-td_check-hash_error' 14 | break; 15 | case 'pending': 16 | classname = 'table-td_check-hash_wait' 17 | break; 18 | default: 19 | classname = 'table-td_check-hash_wait' 20 | } 21 | // const classname = status === 'mined' ? 'table-td_check-hash_done' : 'table-td_check-hash_wait' 22 | return ( 23 |
24 |
25 | TxHash: {hash}
{name}
Status: {status} 26 |
27 |
28 | ) 29 | } 30 | @inject("UiStore") 31 | @observer 32 | export class FourthStep extends React.Component { 33 | constructor(props){ 34 | super(props); 35 | this.txStore = props.UiStore.txStore; 36 | this.tokenStore = props.UiStore.tokenStore; 37 | this.totalNumberTx = props.UiStore.tokenStore.totalNumberTx; 38 | console.log(this.totalNumberTx, 'from store') 39 | this.explorerUrl = props.UiStore.web3Store.explorerUrl; 40 | this.state = { 41 | txCount: Number(this.totalNumberTx) 42 | } 43 | } 44 | componentDidMount(){ 45 | try { 46 | this.txStore.doSend() 47 | } catch(e){ 48 | console.log('FROM UI', e) 49 | } 50 | } 51 | render () { 52 | let totalNumberOftx; 53 | 54 | if(Number(this.tokenStore.totalBalance) > Number(this.tokenStore.allowance)){ 55 | totalNumberOftx = Number(this.totalNumberTx) + 1; 56 | } else { 57 | totalNumberOftx = Number(this.totalNumberTx) 58 | } 59 | 60 | const txHashes = this.txStore.txs.map((tx, index) => { 61 | return 62 | }) 63 | let status; 64 | if(this.txStore.txs.length === totalNumberOftx){ 65 | status = "Transactions were sent out. Now wait until all transactions are mined." 66 | } else { 67 | const txCount = totalNumberOftx - this.txStore.txs.length 68 | status = `Please wait...until you sign ${txCount} transactions in Metamask` 69 | } 70 | return ( 71 |
72 |
73 |

Welcome to Token MultiSender

74 |

75 | Please provide Token Address, JSON file with addresses
76 | This Dapp supports Mainnet, POA-Core, POA-sokol, Ropsten, Rinkeby, Kovan 77 |

78 |
79 |

{status}

80 |
81 | {txHashes} 82 |
83 | {/* Back to Home */} 84 |
85 |
86 |
87 | ); 88 | } 89 | } -------------------------------------------------------------------------------- /src/components/5.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | 4 | export class FifthStep extends React.Component { 5 | render () { 6 | return ( 7 |
8 |
9 |
10 |

Table Name

11 |

Total: 3789.093 ETH

12 |
13 |
14 |
15 |
Token Name
16 |
Address
17 |
Amount
18 |
19 |
20 |
21 |

Name 1

22 |
23 |
24 |

0xc6300135a8fcd43123bb486ff06831b5345d0971

25 |
26 |
27 |

2.5672 ETH

28 |
29 |
30 |
31 |
32 |

Name 2

33 |
34 |
35 |

0x0a7772cdbeee6dbdfdf944dd3e11d32d6a183bde

36 |
37 |
38 |

8.009 ETH

39 |
40 |
41 |
42 | Back to Home 43 |
44 |
45 | ); 46 | } 47 | } -------------------------------------------------------------------------------- /src/components/Header.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | import { inject, observer } from "mobx-react"; 4 | 5 | @inject("UiStore") 6 | @observer 7 | export class Header extends React.Component { 8 | render() { 9 | const explorerUrl = this.props.UiStore.web3Store.explorerUrl || 'https://etherscan.io'; 10 | 11 | return ( 12 |
13 |
14 | 15 |
16 | {/* Retry Failed Transaction */} 17 | 21 | {/* */} 26 |
27 | 28 |
29 |
30 |
31 |
32 | ) 33 | } 34 | } -------------------------------------------------------------------------------- /src/components/Retry.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { inject, observer } from "mobx-react"; 3 | import swal from 'sweetalert'; 4 | import { Link } from 'react-router-dom'; 5 | import generateElement from '../generateElement' 6 | 7 | @inject("UiStore") 8 | @observer 9 | export class Retry extends React.Component { 10 | constructor(props) { 11 | super(props) 12 | this.onTxInput = this.onTxInput.bind(this) 13 | this.txStore = props.UiStore.txStore; 14 | 15 | this.state = { 16 | txHash: '' 17 | } 18 | } 19 | 20 | onTxInput(e){ 21 | const txHash = e.target.value; 22 | setTimeout(async () => { 23 | if(txHash.length === 66){ 24 | // https://kovan.etherscan.io/tx/0x234cb7950c9239ce64033647e14b8fdd915106cad24c8ae57b0eb9052e8ec79a 25 | const txdata = await this.txStore.getTxReceipt(txHash); 26 | console.log(txdata) 27 | this.setState({txHash}) 28 | } else { 29 | swal({ 30 | content: generateElement(`Tx Hash is not valid`), 31 | icon: "error", 32 | }) 33 | } 34 | 35 | }, 750) 36 | } 37 | render () { 38 | return ( 39 |
40 |
41 |
42 | 43 | 44 |
45 |
Token Name
46 |
Address
47 |
Amount
48 |
49 |
50 |
51 |

Name 1

52 |
53 |
54 |

0xc6300135a8fcd43123bb486ff06831b5345d0971

55 |
56 |
57 |

2.5672 ETH

58 |
59 |
60 |
61 |
62 |

Name 2

63 |
64 |
65 |

0x0a7772cdbeee6dbdfdf944dd3e11d32d6a183bde

66 |
67 |
68 |

8.009 ETH

69 |
70 |
71 |
72 | Back to Home 73 |
74 |
75 | ); 76 | } 77 | } -------------------------------------------------------------------------------- /src/components/Welcome.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | 4 | export class Welcome extends React.Component { 5 | render () { 6 | return ( 7 |
8 |
9 |

Welcome to Token MultiSender

10 |

11 | Desc youtube video how to use multisender 12 |

13 |

14 | Already have JSON or CSV prepared? 15 |

16 | Proceed for JSON/CSV 17 | 18 |

19 | Transaction Wizard. Build a list of addresses and balances using UI. 20 |

21 | Proceed for Transaction Wizard 22 |
23 |
24 | ); 25 | } 26 | } -------------------------------------------------------------------------------- /src/components/example.csv: -------------------------------------------------------------------------------- 1 | 0xCBA5018De6b2b6F89d84A1F5A68953f07554765e,12 2 | 0xa6Bf70bd230867c870eF13631D7EFf1AE8Ab85c9,1123.45645 3 | 0x00b5F428905DEA1a67940093fFeaCeee58cA91Ae,1.049 4 | 0x00fC79F38bAf0dE21E1fee5AC4648Bc885c1d774,14546 -------------------------------------------------------------------------------- /src/components/example.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"0xCBA5018De6b2b6F89d84A1F5A68953f07554765e":"12"}, 3 | {"0xa6Bf70bd230867c870eF13631D7EFf1AE8Ab85c9":"1123.45645"}, 4 | {"0x00b5F428905DEA1a67940093fFeaCeee58cA91Ae":"1.049"}, 5 | {"0x00fC79F38bAf0dE21E1fee5AC4648Bc885c1d774":"14546"} 6 | ] -------------------------------------------------------------------------------- /src/components/index.js: -------------------------------------------------------------------------------- 1 | export { Header } from './Header'; 2 | export { FirstStep } from './1'; 3 | export { SecondStep } from './2'; 4 | export { ThirdStep } from './3'; 5 | export { FourthStep } from './4'; 6 | export { FifthStep } from './5'; 7 | export { Retry } from './Retry'; 8 | export { Welcome } from './Welcome'; 9 | -------------------------------------------------------------------------------- /src/generateElement.js: -------------------------------------------------------------------------------- 1 | export default function generateElement(msg){ 2 | let errorNode = document.createElement("div"); 3 | errorNode.innerHTML = `${msg}`; 4 | return errorNode; 5 | } -------------------------------------------------------------------------------- /src/getToken.js: -------------------------------------------------------------------------------- 1 | import Web3 from 'web3'; 2 | import ERC20ABI from './ERC20ABI' 3 | export { 4 | getTokenDecimals 5 | } 6 | const getTokenDecimals = async ({web3Instance, tokenAddress}) => { 7 | const web3 = new Web3(web3Instance.currentProvider); 8 | const token = new web3.eth.Contract(ERC20ABI, tokenAddress); 9 | return await token.methods.decimals().call(); 10 | } 11 | -------------------------------------------------------------------------------- /src/getWeb3.js: -------------------------------------------------------------------------------- 1 | import Web3 from 'web3' 2 | let getWeb3 = () => { 3 | return new Promise(function (resolve, reject) { 4 | // Wait for loading completion to avoid race conditions with web3 injection timing. 5 | window.addEventListener('load', function () { 6 | var results 7 | var web3 = window.web3 8 | 9 | // Checking if Web3 has been injected by the browser (Mist/MetaMask) 10 | if (typeof web3 !== 'undefined') { 11 | // Use Mist/MetaMask's provider. 12 | web3 = new window.Web3(web3.currentProvider) 13 | web3.version.getNetwork((err, netId) => { 14 | let netIdName, trustApiName, explorerUrl; 15 | console.log('netId', netId); 16 | switch (netId) { 17 | case "1": 18 | netIdName = 'Foundation' 19 | trustApiName = 'api' 20 | explorerUrl = 'https://etherscan.io' 21 | console.log('This is Foundation', netId) 22 | break; 23 | case "3": 24 | netIdName = 'Ropsten' 25 | trustApiName = 'ropsten' 26 | explorerUrl = 'https://ropsten.etherscan.io' 27 | console.log('This is Ropsten', netId) 28 | break; 29 | case "4": 30 | netIdName = 'Rinkeby' 31 | trustApiName = 'rinkeby' 32 | explorerUrl = 'https://rinkeby.etherscan.io' 33 | console.log('This is Rinkeby', netId) 34 | break; 35 | case "42": 36 | netIdName = 'Kovan' 37 | trustApiName = 'kovan' 38 | explorerUrl = 'https://kovan.etherscan.io' 39 | console.log('This is Kovan', netId) 40 | break; 41 | case "99": 42 | netIdName = 'POA Core' 43 | trustApiName = 'poa' 44 | explorerUrl = 'https://poaexplorer.com' 45 | console.log('This is Core', netId) 46 | break; 47 | case "77": 48 | netIdName = 'POA Sokol' 49 | trustApiName = 'https://trust-sokol.herokuapp.com' 50 | explorerUrl = 'https://sokol.poaexplorer.com' 51 | console.log('This is Sokol', netId) 52 | break; 53 | default: 54 | netIdName = 'Unknown' 55 | console.log('This is an unknown network.', netId) 56 | } 57 | document.title = `${netIdName} - MultiSender dApp` 58 | var defaultAccount = web3.eth.defaultAccount || null; 59 | if(defaultAccount === null){ 60 | reject({message: 'Please unlock your metamask and refresh the page'}) 61 | } 62 | results = { 63 | web3Instance: web3, 64 | netIdName, 65 | netId, 66 | injectedWeb3: true, 67 | defaultAccount, 68 | trustApiName, 69 | explorerUrl 70 | } 71 | resolve(results) 72 | }) 73 | 74 | console.log('Injected web3 detected.'); 75 | 76 | } else { 77 | // Fallback to localhost if no web3 injection. 78 | const errorMsg = `Metamask is not installed. Please go to 79 | https://metamask.io and return to this page after you installed it` 80 | reject({message: errorMsg}) 81 | console.log('No web3 instance injected, using Local web3.'); 82 | console.error('Metamask not found'); 83 | } 84 | }) 85 | }) 86 | } 87 | 88 | export default getWeb3 89 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { App } from './App'; 4 | import { HashRouter } from 'react-router-dom'; 5 | import { Provider } from "mobx-react"; 6 | import UiStore from "./stores/UiStore"; 7 | 8 | const Root = ( 9 | 10 | 11 | 12 | 13 | 14 | ); 15 | ReactDOM.render(Root, document.getElementById('root')); 16 | -------------------------------------------------------------------------------- /src/stores/UiStore.js: -------------------------------------------------------------------------------- 1 | import Web3Store from './web3Store' 2 | import TokenStore from './tokenStore'; 3 | import GasPriceStore from './gasPriceStore'; 4 | import TxStore from './txStore'; 5 | 6 | class UiStore { 7 | constructor() { 8 | this.gasPriceStore = new GasPriceStore() 9 | this.web3Store = new Web3Store(this) 10 | this.tokenStore = new TokenStore(this) 11 | this.txStore = new TxStore(this) 12 | } 13 | } 14 | 15 | export default new UiStore(); -------------------------------------------------------------------------------- /src/stores/autosave.js: -------------------------------------------------------------------------------- 1 | import * as mobx from 'mobx'; 2 | import storage from 'store2' 3 | 4 | export default function autosave(store, storageKey, deserialize = x => x) { 5 | console.log(store, storageKey, deserialize) 6 | let firstRun = true 7 | 8 | mobx.autorun(`autorun for ${storageKey}`, () => { 9 | if (firstRun) { 10 | const existingStore = storage.get(storageKey) 11 | 12 | if (existingStore) { 13 | mobx.extendObservable(store, deserialize(existingStore)) 14 | } 15 | 16 | firstRun = false 17 | } 18 | 19 | storage.set(storageKey, mobx.toJS(store)) 20 | console.log(storage) 21 | }) 22 | } -------------------------------------------------------------------------------- /src/stores/gasPriceStore.js: -------------------------------------------------------------------------------- 1 | import { action, observable, computed } from "mobx"; 2 | import Web3Utils from 'web3-utils'; 3 | 4 | class GasPriceStore { 5 | @observable gasPrices = {}; 6 | @observable loading = true; 7 | @observable gasPricesArray = [ 8 | {label: 'fast', value: '21'}, 9 | {label: 'standard', value: '21'}, 10 | {label: 'slow', value: '21'}, 11 | {label: 'instant', value: '21'}, 12 | ]; 13 | @observable selectedGasPrice = '22' 14 | gasPricePromise = null; 15 | constructor(rootStore) { 16 | this.getGasPrices() 17 | } 18 | 19 | async getGasPrices(){ 20 | this.gasPricePromise = fetch('https://gasprice.poa.network/').then((response) => { 21 | return response.json() 22 | }).then((data) => { 23 | this.gasPricesArray.map((v) => { 24 | v.value = data[v.label] 25 | v.label = `${v.label}: ${data[v.label]} gwei` 26 | return v; 27 | }) 28 | this.selectedGasPrice = data.fast; 29 | this.gasPrices = data; 30 | this.loading = false; 31 | }).catch((e) => { 32 | this.loading = true; 33 | console.error(e) 34 | }) 35 | } 36 | 37 | @computed get standardInHex() { 38 | const toWei = Web3Utils.toWei(this.selectedGasPrice.toString(), 'gwei') 39 | return Web3Utils.toHex(toWei) 40 | } 41 | @action 42 | setSelectedGasPrice(value) { 43 | this.selectedGasPrice = value; 44 | } 45 | 46 | } 47 | 48 | export default GasPriceStore; -------------------------------------------------------------------------------- /src/stores/tokenStore.js: -------------------------------------------------------------------------------- 1 | import { action, observable, computed } from "mobx"; 2 | import ERC20ABI from '../abis/ERC20ABI' 3 | import StormMultiSenderABI from '../abis/StormMultisender' 4 | import Web3Utils from 'web3-utils'; 5 | 6 | const BN = require('bignumber.js'); 7 | function add(a, b) { 8 | return new BN(a).plus(new BN(b)); 9 | } 10 | class TokenStore { 11 | @observable decimals = ''; 12 | @observable jsonAddresses = [{"0x0": "0"}]; 13 | @observable tokenAddress = ''; 14 | @observable defAccTokenBalance = '' 15 | @observable allowance = '' 16 | @observable currentFee = '' 17 | @observable tokenSymbol = '' 18 | @observable ethBalance = '' 19 | @observable balances_to_send = [] 20 | @observable addresses_to_send = [] 21 | @observable invalid_addresses = [] 22 | @observable filteredAddresses = [] 23 | @observable totalBalance = '0' 24 | @observable arrayLimit = 0 25 | @observable errors = [] 26 | @observable dublicates = [] 27 | proxyMultiSenderAddress = process.env.REACT_APP_PROXY_MULTISENDER 28 | 29 | constructor(rootStore) { 30 | this.web3Store = rootStore.web3Store; 31 | this.gasPriceStore = rootStore.gasPriceStore; 32 | 33 | } 34 | 35 | @action 36 | async getDecimals(address) { 37 | try{ 38 | const web3 = this.web3Store.web3; 39 | const token = new web3.eth.Contract(ERC20ABI, address); 40 | this.decimals = await token.methods.decimals().call(); 41 | return this.decimals 42 | } catch(e) { 43 | this.errors.push('Cannot get decimals for token contract.\n Please make sure you are on the right network and token address exists') 44 | console.error('Get Decimals', e) 45 | } 46 | } 47 | 48 | async getBalance() { 49 | try { 50 | const web3 = this.web3Store.web3; 51 | const token = new web3.eth.Contract(ERC20ABI, this.tokenAddress); 52 | const defAccTokenBalance = await token.methods.balanceOf(this.web3Store.defaultAccount).call(); 53 | this.defAccTokenBalance = new BN(defAccTokenBalance).div(this.multiplier).toString(10) 54 | return this.defAccTokenBalance 55 | } 56 | catch(e){ 57 | this.errors.push(`${this.web3Store.defaultAccount} doesn't have token balance.\n Please make sure you are on the right network and token address exists`) 58 | console.error('getBalance',e) 59 | } 60 | } 61 | async getEthBalance() { 62 | try { 63 | const web3 = this.web3Store.web3; 64 | let ethBalance = await web3.eth.getBalance(this.web3Store.defaultAccount) 65 | ethBalance = Web3Utils.fromWei(ethBalance) 66 | this.ethBalance = new BN(ethBalance).toFormat(3) 67 | return this.ethBalance 68 | } 69 | catch(e){ 70 | console.error(e) 71 | } 72 | } 73 | async getTokenSymbol(tokenAddress) { 74 | try { 75 | const web3 = this.web3Store.web3; 76 | const token = new web3.eth.Contract(ERC20ABI, tokenAddress); 77 | this.tokenSymbol = await token.methods.symbol().call(); 78 | return this.tokenSymbol 79 | } 80 | catch(e){ 81 | this.errors.push('Token with this Address doesnt exist.\n Please make sure you are on the right network and token address exists') 82 | console.error(e) 83 | } 84 | } 85 | @action 86 | async getAllowance() { 87 | try { 88 | const web3 = this.web3Store.web3; 89 | const token = new web3.eth.Contract(ERC20ABI, this.tokenAddress); 90 | const allowance = await token.methods.allowance(this.web3Store.defaultAccount, this.proxyMultiSenderAddress).call(); 91 | this.allowance = new BN(allowance).div(this.multiplier).toString(10) 92 | return this.allowance 93 | } 94 | catch(e){ 95 | this.errors.push(`Token address doesn't have allowance method.\n Please make sure you are on the right network and token address exists.\n 96 | Your account: ${this.web3Store.defaultAccount}`) 97 | console.error('GetAllowance',e) 98 | } 99 | } 100 | 101 | @action 102 | async getCurrentFee(){ 103 | try { 104 | this.web3Store.getWeb3Promise.then(async () => { 105 | const web3 = this.web3Store.web3; 106 | const multisender = new web3.eth.Contract(StormMultiSenderABI, this.proxyMultiSenderAddress); 107 | const currentFee = await multisender.methods.currentFee(this.web3Store.defaultAccount).call(); 108 | this.currentFee = Web3Utils.fromWei(currentFee) 109 | return this.currentFee 110 | }) 111 | } 112 | catch(e){ 113 | console.error('getCurrentFee',e) 114 | } 115 | } 116 | 117 | async getArrayLimit(){ 118 | try { 119 | await this.web3Store.getWeb3Promise.then(async () => { 120 | const web3 = this.web3Store.web3; 121 | const multisender = new web3.eth.Contract(StormMultiSenderABI, this.proxyMultiSenderAddress); 122 | this.arrayLimit = await multisender.methods.arrayLimit().call(); 123 | return this.arrayLimit 124 | }) 125 | } 126 | catch(e){ 127 | console.error('GetArrayLimit', e) 128 | } 129 | } 130 | 131 | @action 132 | async setTokenAddress(tokenAddress) { 133 | await this.web3Store.getWeb3Promise.then(async () => { 134 | if(Web3Utils.isAddress(this.web3Store.defaultAccount) && tokenAddress !== "0x000000000000000000000000000000000000bEEF"){ 135 | this.tokenAddress = tokenAddress; 136 | await this.getDecimals(tokenAddress) 137 | await this.getBalance() 138 | await this.getAllowance() 139 | await this.getCurrentFee() 140 | this.getTokenSymbol(tokenAddress) 141 | this.getEthBalance() 142 | this.getArrayLimit() 143 | } else { 144 | this.tokenAddress = tokenAddress; 145 | await this.getCurrentFee() 146 | await this.getEthBalance() 147 | this.getArrayLimit() 148 | this.decimals = 18; 149 | this.defAccTokenBalance = this.ethBalance; 150 | } 151 | }) 152 | } 153 | 154 | @action 155 | setDecimals(decimals) { 156 | this.decimals = decimals; 157 | } 158 | 159 | @action 160 | setJsonAddresses(addresses){ 161 | this.jsonAddresses = addresses; 162 | } 163 | 164 | @action 165 | async reset(){ 166 | this.decimals = ''; 167 | this.jsonAddresses = [{"0x0": "0"}]; 168 | this.tokenAddress = ''; 169 | this.defAccTokenBalance = '' 170 | this.allowance = '' 171 | this.currentFee = '' 172 | this.tokenSymbol = '' 173 | this.ethBalance = '' 174 | this.balances_to_send = [] 175 | this.addresses_to_send = [] 176 | this.invalid_addresses = [] 177 | this.filteredAddresses = [] 178 | this.totalBalance = '0' 179 | this.arrayLimit = 0 180 | this.errors = [] 181 | this.dublicates = [] 182 | } 183 | 184 | @action 185 | async parseAddresses(){ 186 | this.addresses_to_send = [] 187 | this.dublicates = [] 188 | this.totalBalance = 0; 189 | this.invalid_addresses = []; 190 | this.balances_to_send = []; 191 | return new Promise((res, rej) => { 192 | try { 193 | this.jsonAddresses.forEach((account, index) => { 194 | if(Object.keys(account).length === 0){ 195 | rej({message: `There was an error parsing ${JSON.stringify(account)} at line ${index}`}) 196 | } 197 | const address = Object.keys(account)[0].replace(/\s/g, "");; 198 | if(!Web3Utils.isAddress(address)){ 199 | this.invalid_addresses.push(address); 200 | } else { 201 | let balance = Object.values(account)[0]; 202 | this.totalBalance = new BN(balance).plus(this.totalBalance).toString(10) 203 | console.log('balance,', balance) 204 | balance = this.multiplier.times(balance); 205 | const indexAddr = this.addresses_to_send.indexOf(address); 206 | if(indexAddr === -1){ 207 | this.addresses_to_send.push(address); 208 | this.balances_to_send.push(balance.toString(10)) 209 | } else { 210 | if(this.dublicates.indexOf(address) === -1){ 211 | this.dublicates.push(address); 212 | } 213 | this.balances_to_send[indexAddr] = (new BN(this.balances_to_send[indexAddr]).plus(balance)).toString(10) 214 | } 215 | } 216 | }) 217 | 218 | this.jsonAddresses = this.addresses_to_send.map((addr, index) => { 219 | let obj = {} 220 | obj[addr] = (new BN(this.balances_to_send[index]).div(this.multiplier)).toString(10) 221 | return obj; 222 | }) 223 | res(this.jsonAddresses) 224 | if(this.tokenAddress === "0x000000000000000000000000000000000000bEEF") { 225 | this.allowance = this.totalBalance 226 | } 227 | } catch(e){ 228 | rej(e) 229 | } 230 | }) 231 | } 232 | 233 | @computed get totalBalanceWithDecimals() { 234 | return new BN(this.totalBalance).times(this.multiplier).toString(10) 235 | } 236 | @computed get multiplier(){ 237 | const decimals = Number(this.decimals) 238 | return new BN(10).pow(decimals) 239 | } 240 | 241 | @computed get totalNumberTx() { 242 | return Math.ceil(this.jsonAddresses.length/this.arrayLimit); 243 | } 244 | 245 | @computed get totalCostInEth(){ 246 | const standardGasPrice = Web3Utils.toWei(this.gasPriceStore.selectedGasPrice.toString(), 'gwei'); 247 | const currentFeeInWei = Web3Utils.toWei(this.currentFee); 248 | const tx = new BN(standardGasPrice).times(new BN('5000000')) 249 | const txFeeMiners = tx.times(new BN(this.totalNumberTx)) 250 | const contractFee = new BN(currentFeeInWei).times(this.totalNumberTx); 251 | 252 | return Web3Utils.fromWei(txFeeMiners.plus(contractFee).toString(10)) 253 | } 254 | 255 | } 256 | 257 | export default TokenStore; -------------------------------------------------------------------------------- /src/stores/txStore.js: -------------------------------------------------------------------------------- 1 | import { action, observable, computed, autorun, toJS } from "mobx"; 2 | import Web3Utils from 'web3-utils' 3 | import ERC20ABI from "../abis/ERC20ABI" 4 | import MultiSenderAbi from "../abis/StormMultisender" 5 | import Web3 from "web3"; 6 | import { observer } from "mobx-react"; 7 | import swal from 'sweetalert'; 8 | const BN = require('bignumber.js'); 9 | 10 | 11 | class TxStore { 12 | @observable txs = [] 13 | txHashToIndex = {} 14 | @observable approval = ''; 15 | constructor(rootStore) { 16 | this.tokenStore = rootStore.tokenStore 17 | this.web3Store = rootStore.web3Store 18 | this.gasPriceStore = rootStore.gasPriceStore 19 | this.interval = null; 20 | } 21 | 22 | @action 23 | async reset() { 24 | this.txs = [] 25 | this.txHashToIndex = {} 26 | this.approval = ''; 27 | this.keepRunning = false; 28 | clearInterval(this.interval); 29 | } 30 | 31 | @action 32 | async doSend(){ 33 | this.keepRunning = true; 34 | this.txs = []; 35 | this.approval = ''; 36 | if(new BN(this.tokenStore.totalBalance).gt(new BN(this.tokenStore.allowance))){ 37 | this._approve(); 38 | const interval = setInterval(() => { 39 | const index = this.txHashToIndex[this.approval]; 40 | console.log('checking autorun', index, this.approval, this.txHashToIndex, toJS(this.txs)) 41 | if(this.approval){ 42 | if(this.txs[index] && this.txs[index].status === 'mined'){ 43 | clearInterval(interval); 44 | console.log('lets GO!', this.tokenStore.totalNumberTx, this.tokenStore.arrayLimit) 45 | setTimeout(() => { 46 | this._multisend({slice: this.tokenStore.totalNumberTx, addPerTx: this.tokenStore.arrayLimit}) 47 | }, 1000) 48 | } 49 | } 50 | }, 3000) 51 | this.interval = interval; 52 | } else { 53 | this._multisend({slice: this.tokenStore.totalNumberTx, addPerTx: this.tokenStore.arrayLimit}) 54 | } 55 | } 56 | 57 | async _approve(){ 58 | const index = this.txs.length; 59 | const web3 = this.web3Store.web3; 60 | const token = new web3.eth.Contract(ERC20ABI, this.tokenStore.tokenAddress); 61 | try{ 62 | return token.methods['approve(address,uint256)'](this.tokenStore.proxyMultiSenderAddress, this.tokenStore.totalBalanceWithDecimals) 63 | .send({from: this.web3Store.defaultAccount, gasPrice: this.gasPriceStore.standardInHex}) 64 | .on('transactionHash', (hash) => { 65 | this.approval = hash 66 | this.txHashToIndex[hash] = index; 67 | this.txs[index] = {status: 'pending', name: `MultiSender Approval to spend ${this.tokenStore.totalBalance} ${this.tokenStore.tokenSymbol}`, hash} 68 | this.getTxStatus(hash) 69 | 70 | }) 71 | .on('error', (error) => { 72 | swal("Error!", error.message, 'error') 73 | console.error(error) 74 | }) 75 | } catch (e){ 76 | console.error(e) 77 | } 78 | 79 | } 80 | 81 | async _multisend({slice, addPerTx}) { 82 | if(!this.keepRunning){ 83 | return 84 | } 85 | const token_address = this.tokenStore.tokenAddress 86 | let {addresses_to_send, balances_to_send, proxyMultiSenderAddress, currentFee, totalBalance} = this.tokenStore; 87 | 88 | 89 | const start = (slice - 1) * addPerTx; 90 | const end = slice * addPerTx; 91 | addresses_to_send = addresses_to_send.slice(start, end); 92 | balances_to_send = balances_to_send.slice(start, end); 93 | let ethValue; 94 | if(token_address === "0x000000000000000000000000000000000000bEEF"){ 95 | 96 | const totalInWei = balances_to_send.reduce((total, num) => { 97 | return (new BN(total).plus(new BN(num))) 98 | }) 99 | const totalInEth = Web3Utils.fromWei(totalInWei.toString()) 100 | ethValue = new BN(currentFee).plus(totalInEth) 101 | } else { 102 | ethValue = new BN(currentFee) 103 | } 104 | console.log('slice', slice, addresses_to_send[0], balances_to_send[0], addPerTx) 105 | const web3 = this.web3Store.web3; 106 | const multisender = new web3.eth.Contract(MultiSenderAbi, proxyMultiSenderAddress); 107 | 108 | try { 109 | let encodedData = await multisender.methods.multisendToken(token_address, addresses_to_send, balances_to_send).encodeABI({from: this.web3Store.defaultAccount}) 110 | let gas = await web3.eth.estimateGas({ 111 | from: this.web3Store.defaultAccount, 112 | data: encodedData, 113 | value: Web3Utils.toHex(Web3Utils.toWei(ethValue.toString())), 114 | to: proxyMultiSenderAddress 115 | }) 116 | console.log('gas', gas) 117 | let tx = multisender.methods.multisendToken(token_address, addresses_to_send, balances_to_send) 118 | .send({ 119 | from: this.web3Store.defaultAccount, 120 | gasPrice: this.gasPriceStore.standardInHex, 121 | gas: Web3Utils.toHex(gas + 150000), 122 | value: Web3Utils.toHex(Web3Utils.toWei(ethValue.toString())), 123 | }) 124 | 125 | .on('transactionHash', (hash) => { 126 | this.txHashToIndex[hash] = this.txs.length 127 | this.txs.push({status: 'pending', name: `Sending Batch #${this.txs.length} ${this.tokenStore.tokenSymbol}\n 128 | From ${addresses_to_send[0]} to: ${addresses_to_send[addresses_to_send.length-1]} 129 | `, hash}) 130 | this.getTxStatus(hash) 131 | }) 132 | .on('error', (error) => { 133 | swal("Error!", error.message, 'error') 134 | console.log(error) 135 | }) 136 | slice--; 137 | if (slice > 0) { 138 | this._multisend({slice, addPerTx}); 139 | } else { 140 | 141 | } 142 | } catch(e){ 143 | console.error(e) 144 | } 145 | } 146 | 147 | async getTxReceipt(hash){ 148 | console.log('getTxReceipt') 149 | try { 150 | const web3 = this.web3Store.web3; 151 | const res = await web3.eth.getTransaction(hash); 152 | return res; 153 | } catch(e) { 154 | console.error(e); 155 | } 156 | } 157 | 158 | async getTxStatus(hash) { 159 | console.log('GET TX STATUS', hash) 160 | if(!this.keepRunning){ 161 | return 162 | } 163 | setTimeout(() => { 164 | const web3 = this.web3Store.web3; 165 | web3.eth.getTransactionReceipt(hash, (error, res) => { 166 | if(res && res.blockNumber){ 167 | if(res.status === '0x1'){ 168 | const index = this.txHashToIndex[hash] 169 | this.txs[index].status = `mined` 170 | } else { 171 | const index = this.txHashToIndex[hash] 172 | this.txs[index].status = `error` 173 | this.txs[index].name = `Mined but with errors. Perhaps out of gas` 174 | } 175 | } else { 176 | this.getTxStatus(hash) 177 | } 178 | }) 179 | }, 3000) 180 | } 181 | 182 | } 183 | 184 | export default TxStore; -------------------------------------------------------------------------------- /src/stores/web3Store.js: -------------------------------------------------------------------------------- 1 | import { action, observable } from "mobx"; 2 | import getWeb3 from '../getWeb3'; 3 | import Web3 from 'web3'; 4 | class Web3Store { 5 | @observable web3 = {}; 6 | @observable defaultAccount = ''; 7 | getWeb3Promise = null; 8 | @observable loading = true; 9 | @observable errors = []; 10 | @observable userTokens = []; 11 | @observable explorerUrl = ''; 12 | @observable startedUrl = window.location.hash 13 | constructor(rootStore) { 14 | 15 | this.getWeb3Promise = getWeb3().then(async (web3Config) => { 16 | const {web3Instance, defaultAccount} = web3Config; 17 | this.defaultAccount = defaultAccount; 18 | this.web3 = new Web3(web3Instance.currentProvider); 19 | this.getUserTokens(web3Config) 20 | this.setExplorerUrl(web3Config.explorerUrl) 21 | console.log('web3 loaded') 22 | }).catch((e) => { 23 | console.error(e,'web3 not loaded') 24 | this.errors.push(e.message) 25 | }) 26 | } 27 | @action 28 | setExplorerUrl(url){ 29 | this.explorerUrl = url 30 | } 31 | @action 32 | setStartedUrl(url){ 33 | this.startedUrl = url; 34 | } 35 | async getUserTokens({trustApiName, defaultAccount}) { 36 | window.fetch(`https://${trustApiName}.trustwalletapp.com/tokens?address=${defaultAccount}`).then((res) => { 37 | return res.json() 38 | }).then((res) => { 39 | let tokens = res.docs.map(({contract}) => { 40 | const {address, symbol} = contract; 41 | return {label: `${symbol} - ${address}`, value: address} 42 | }) 43 | tokens.unshift({ 44 | value: '0x000000000000000000000000000000000000bEEF', 45 | label: "ETH - Ethereum Native Currency" 46 | }) 47 | this.userTokens = tokens; 48 | this.loading = false; 49 | }).catch((e) => { 50 | this.loading = false; 51 | console.error(e); 52 | }) 53 | } 54 | 55 | } 56 | 57 | export default Web3Store; -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "experimentalDecorators": true, 4 | "allowJs": true 5 | } 6 | } --------------------------------------------------------------------------------