Merge remote-tracking branch 'Token/master' into develop
This commit is contained in:
commit
287023f978
153 files changed
+97420
No files matched your search
+332
@@ -0,0 +1,332 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
**/Properties/launchSettings.json
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
*.sln.iml
|
||||
|
||||
# CodeRush
|
||||
.cr/
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# SmartContracts
|
||||
!**/SmartContracts/src/bin
|
||||
@@ -0,0 +1,46 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team using the online form in the contacts page of the superalgos.org website. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
@@ -0,0 +1,45 @@
|
||||
# Contributing
|
||||
|
||||
We are thrilled you are interested in contributing to this repository. Your help may be essential to the project's success and we want you in!
|
||||
|
||||
Superalgos is a collective project, currently at a very early stage. Although this repository is not open source software yet, we do welcome contributions from the community.
|
||||
|
||||
Contributions are deemed _voluntary work_. There might be incentives in place for certain kinds of contributions. Contact us for more information in this regard.
|
||||
|
||||
In any case, contributors agree to provide an express grant of patent rights for their contributions. Submitting Pull Requests to this repository represents an express agreement with the terms of our Balanced Contributor Intellectual Property Agreement. This agreement is a direct implementation of GitHub's [Balanced Employee Intellectual Property Agreement 1.0.1](https://github.com/github/balanced-employee-ip-agreement/blob/master/Balanced_Employee_IP_Agreement.md).
|
||||
|
||||
# Balanced Contributor Intellectual Property Agreement 1.0.1
|
||||
|
||||
This BALANCED CONTRIBUTOR INTELLECTUAL PROPERTY AGREEMENT is between person or team submitting Pull Requests to this repository and Superalgos.org ("Project").
|
||||
|
||||
**What is this?** This is the Project's Intellectual Property Agreement ("Agreement"). If you've worked in the technology space before, there's a good chance that you've run across one or more of these in the past. This document is the official, entire and exclusive agreement on what intellectual property ("IP") is yours, and what belongs to the Project.
|
||||
|
||||
**Why is this?** The Project needs to be clear on what IP it owns and has rights to. Its customers, contributors, and investors depend on the Project having the legal rights to the products and services it is providing so that the Project can continue operating and doing business.
|
||||
|
||||
The Project also believes that it's important to be clear on what it doesn't own. The Project doesn't want you looking over your shoulder every time you work on something personal or worrying that the Project will someday seize your open source non-lethal mousetrap simulation software. In other words, the Project isn't interested in appropriating your personal projects.
|
||||
|
||||
**Read this.** Please read this document and be sure you understand it before you submit any Pull Requests. Due to legal risk and corporate obligations, the Project cannot, by and large, negotiate its terms. If you feel you have a particular circumstance that keeps you from signing, please let the Project's legal department ("Legal") know. And, of course, you're always free and encouraged to get your own legal counsel to explain anything you're not clear on.
|
||||
|
||||
Cool? Then, by submitting your first Pull Request, and as a condition of your contribution, you agree to the following:
|
||||
|
||||
1. **What the Project owns.** The Project owns any IP ("Project IP") that you create, or help create _as its contributor_, but only if it meets one or more of these additional conditions: The IP was (i) related to an existing or prospective Project product or service at the time you developed, invented, or created it, (ii) developed for use by the Project, or (iii) developed or promoted with existing Project IP or with the Project's endorsement. You hereby grant and assign, and will grant and assign, to the Project all rights and interests in all Project IP.
|
||||
|
||||
"Project IP" includes concepts, designs, developments, discoveries, ideas, improvements, inventions, trade secrets, trademarks, and works of authorship.
|
||||
|
||||
2. **What the Project doesn't own.** If you create IP that doesn't fit into one of the categories listed above, the Project doesn't own it. In other words, the Project doesn't own concepts, designs, developments, discoveries, ideas, improvements, inventions, trade secrets, trademarks, or works of authorship that you develop, invent, or create that do not meet any of the conditions in Section 1.
|
||||
|
||||
3. **Contribution of your IP to Project projects.** If you include your own IP – such as IP you created prior to working for the Project – into a Project product or service, it's still yours, of course, but you grant the Project a non-exclusive, irrevocable, fully paid-up, royalty-free, perpetual, sublicensable, transferable, worldwide license to use it without restriction in any way or implementation, in modified form, or as is, by itself, or incorporated into another product or service ("License"). If you include your name in any project over which the Project would have rights under this Agreement, such as in a copyright notice or a comment in code or documentation, then the License covers the rights associated with that use of your name as well.
|
||||
|
||||
4. **Your contributions to non-Project projects.** The Project recognizes that you may be engaged in work that requires you to submit IP to entities other than the Project, such as open source projects used by the Project. Please make sure that Legal is aware of what you're working on so that Legal can help with any licensing issues. If any project asks you to sign a contribution agreement, you should check with Legal before doing so. These agreements may be legally binding on the Project and so should be run through Legal first.
|
||||
|
||||
5. **Voluntary Works** All Project IP that you are involved with or create as part of your work for the Project is voluntary work which does not require compensation. There might be incentives in place for certain kinds of contributions. Feel free to contact the Project to learn more.
|
||||
|
||||
6. **No conflicts.** You agree that you don't have any outstanding agreements or obligations that conflict with those in this Agreement, and that you won't enter into conflicting agreements in the future.
|
||||
|
||||
7. **IP protection.** The Project might someday need to show the work that went into the development of IP that it uses or has used, or to make government filings to establish that it owns the IP or has rights over it. To help in those situations, you agree not to destroy any records you maintain relating to the development of any Project IP or IP under License (together, "All IP"), and, if the Project asks, to provide those records to the Project. You agree to help the Project secure and defend its rights in All IP. For your help the Project will compensate you at a reasonable rate. If the Project is unable to secure your help, you authorize the Project to act on your behalf (as your agent and attorney-in-fact) in securing all rights related to All IP.
|
||||
|
||||
8. **Confidentiality.** As an contributor or contractor of the Project, you will have access to sensitive confidential information that is important to the Project's business. You are responsible for keeping this information confidential, including after you end your work for the Project.
|
||||
|
||||
"Confidential Information" includes non-public technical details about our products or services, financial information, business strategies and forecasts, customer data, or any other information, data or know-how that is valuable to the Project because it is not publicly known.
|
||||
|
||||
The Project's Confidential Information is sensitive and we expect that you'll treat it as such. You agree to only use the Project's Confidential Information for the purpose of performing your contribution and for the benefit of the Project. You will do your best to keep Confidential Information secret. If you are not sure if something is Confidential Information, you should assume that it is, until you can confirm otherwise.
|
||||
@@ -0,0 +1,39 @@
|
||||
COPYRIGHT NOTICE
|
||||
|
||||
© Copyright 2018 Superalgos.org
|
||||
|
||||
|
||||
LICENSE NOTICE
|
||||
|
||||
Superalgos is a collaborative project currently at a very early stage. Because certain aspects of
|
||||
the project are still not clearly defined, we have chosen to --temporarily-- grant a restrictive
|
||||
license for the use of this repository, until those aspects are clarified and a proper open source
|
||||
license can be granted.
|
||||
|
||||
Superalgos.org is publishing the code of this software for several reasons. However, it shall not be considered free software yet. Superalgos is a collaborative project in the crypto space and this
|
||||
software is still proprietary software.
|
||||
|
||||
The reasons for opening up the code of this software at this stage are the following:
|
||||
|
||||
* We believe that transparency is paramount to achieving our goals, so we want everyone to
|
||||
be able to understand what this software does and how. Opening up the code of this software
|
||||
allows anyone to take a close look.
|
||||
|
||||
* We welcome contributions from the community. Contributions are regarded as voluntary work.
|
||||
There may be incentives in place for certain kinds of contributions. Contact us to learn more.
|
||||
Contributors agree to provide an express grant of patent rights for their contributions.
|
||||
|
||||
|
||||
LICENSE WORDING
|
||||
|
||||
Superalgos.org grants a limited license for the following uses:
|
||||
|
||||
1. CODE REVIEW AND AUDITS. You are granted permission to clone this repository to analyze,
|
||||
review or audit the code.
|
||||
|
||||
2. COLLABORATING WITH Superalgos.org. You are granted permission to fork this repository
|
||||
with the sole purpose of correcting bugs and developing functionality in agreement with
|
||||
Superalgos.org. By contributing to this repository you explicitely agree to the terms
|
||||
detailed in CONTRIBUTING.MD.
|
||||
|
||||
PLEASE SEE CONTRIBUTING.MD FOR MORE DETAILS ON THE IMPLICATIONS SURROUNDING YOUR CONTRIBUTIONS TO THIS REPOSITORY.
|
||||
@@ -0,0 +1,4 @@
|
||||
# ALGOToken
|
||||
Responsible for the issuing of ALGO tokens
|
||||
|
||||
Plese see the documentation at https://smartcontracts.superalgos.org/ .
|
||||
@@ -0,0 +1,75 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28010.2048
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdvancedAlgos.AlgoToken.AlgoErc20Token", "algo-erc20-token\src\AdvancedAlgos.AlgoToken.AlgoErc20Token\AdvancedAlgos.AlgoToken.AlgoErc20Token.csproj", "{96BC465D-507E-43BC-A71E-1B4F7799AB19}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdvancedAlgos.AlgoToken.AlgoErc20Token.IntegrationTests", "algo-erc20-token\test\AdvancedAlgos.AlgoToken.AlgoErc20Token.IntegrationTests\AdvancedAlgos.AlgoToken.AlgoErc20Token.IntegrationTests.csproj", "{B569A2AD-A0E7-4623-AB3A-9BB49938CBE6}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "algo-erc20-token", "algo-erc20-token", "{921A277C-0B10-4186-A814-786F903B4E2C}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "algo-token-distribution", "algo-token-distribution", "{4EDC9FAE-176A-4995-B977-F6D2B735F616}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "framework", "framework", "{9A083680-1F9C-4A8C-8FB2-A623DD333AEE}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdvancedAlgos.AlgoToken.AlgoTokenDistribution", "algo-token-distribution\src\AdvancedAlgos.AlgoToken.AlgoTokenDistribution\AdvancedAlgos.AlgoToken.AlgoTokenDistribution.csproj", "{6D1C63E9-A2F1-4084-B8E4-499B41341023}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests", "algo-token-distribution\test\AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests\AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests.csproj", "{CF2E35E6-EFC5-445F-AB17-BEC7E3039C41}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdvancedAlgos.AlgoToken.Framework.Ethereum.IntegrationTest", "framework\src\AdvancedAlgos.AlgoToken.Framework.Ethereum.IntegrationTest\AdvancedAlgos.AlgoToken.Framework.Ethereum.IntegrationTest.csproj", "{127474F7-81E8-4153-AEE0-A2049D75F77D}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdvancedAlgos.AlgoToken.Framework.Ethereum", "framework\src\AdvancedAlgos.AlgoToken.Framework.Ethereum\AdvancedAlgos.AlgoToken.Framework.Ethereum.csproj", "{B05DC461-E82E-430B-A66D-9C0C9C9F9C9E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdvancedAlgos.AlgoToken.AlgoTokenPlayground", "algo-token-playground\src\AdvancedAlgos.AlgoToken.AlgoTokenPlayground\AdvancedAlgos.AlgoToken.AlgoTokenPlayground.csproj", "{42569CB0-DA27-4BAE-A657-3617D1644AD5}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{96BC465D-507E-43BC-A71E-1B4F7799AB19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{96BC465D-507E-43BC-A71E-1B4F7799AB19}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{96BC465D-507E-43BC-A71E-1B4F7799AB19}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{96BC465D-507E-43BC-A71E-1B4F7799AB19}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B569A2AD-A0E7-4623-AB3A-9BB49938CBE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B569A2AD-A0E7-4623-AB3A-9BB49938CBE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B569A2AD-A0E7-4623-AB3A-9BB49938CBE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B569A2AD-A0E7-4623-AB3A-9BB49938CBE6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6D1C63E9-A2F1-4084-B8E4-499B41341023}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6D1C63E9-A2F1-4084-B8E4-499B41341023}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6D1C63E9-A2F1-4084-B8E4-499B41341023}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6D1C63E9-A2F1-4084-B8E4-499B41341023}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CF2E35E6-EFC5-445F-AB17-BEC7E3039C41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CF2E35E6-EFC5-445F-AB17-BEC7E3039C41}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CF2E35E6-EFC5-445F-AB17-BEC7E3039C41}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CF2E35E6-EFC5-445F-AB17-BEC7E3039C41}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{127474F7-81E8-4153-AEE0-A2049D75F77D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{127474F7-81E8-4153-AEE0-A2049D75F77D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{127474F7-81E8-4153-AEE0-A2049D75F77D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{127474F7-81E8-4153-AEE0-A2049D75F77D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B05DC461-E82E-430B-A66D-9C0C9C9F9C9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B05DC461-E82E-430B-A66D-9C0C9C9F9C9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B05DC461-E82E-430B-A66D-9C0C9C9F9C9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B05DC461-E82E-430B-A66D-9C0C9C9F9C9E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{42569CB0-DA27-4BAE-A657-3617D1644AD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{42569CB0-DA27-4BAE-A657-3617D1644AD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{42569CB0-DA27-4BAE-A657-3617D1644AD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{42569CB0-DA27-4BAE-A657-3617D1644AD5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{96BC465D-507E-43BC-A71E-1B4F7799AB19} = {921A277C-0B10-4186-A814-786F903B4E2C}
|
||||
{B569A2AD-A0E7-4623-AB3A-9BB49938CBE6} = {921A277C-0B10-4186-A814-786F903B4E2C}
|
||||
{6D1C63E9-A2F1-4084-B8E4-499B41341023} = {4EDC9FAE-176A-4995-B977-F6D2B735F616}
|
||||
{CF2E35E6-EFC5-445F-AB17-BEC7E3039C41} = {4EDC9FAE-176A-4995-B977-F6D2B735F616}
|
||||
{127474F7-81E8-4153-AEE0-A2049D75F77D} = {9A083680-1F9C-4A8C-8FB2-A623DD333AEE}
|
||||
{B05DC461-E82E-430B-A66D-9C0C9C9F9C9E} = {9A083680-1F9C-4A8C-8FB2-A623DD333AEE}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {79FFEB06-291F-417C-9AC3-2AA0D31CC7D4}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Nethereum.Web3" Version="2.5.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="SmartContracts\src\bin\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="SmartContracts\src\bin\*.*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\framework\src\AdvancedAlgos.AlgoToken.Framework.Ethereum\AdvancedAlgos.AlgoToken.Framework.Ethereum.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
#pragma warning disable EPS02 // Non-readonly struct used as in-parameter
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoErc20Token
|
||||
{
|
||||
public static class AlgoIntegralConverterExtensions
|
||||
{
|
||||
public const byte TOKEN_DECIMALS = 18;
|
||||
public const long MEGA_FACTOR = 1000000;
|
||||
|
||||
public static readonly BigInteger TokenFactor = BigInteger.Pow(10, TOKEN_DECIMALS);
|
||||
|
||||
public static BigInteger Algo(this in byte value) => value * TokenFactor;
|
||||
public static BigInteger Algo(this in sbyte value) => value * TokenFactor;
|
||||
public static BigInteger Algo(this in short value) => value * TokenFactor;
|
||||
public static BigInteger Algo(this in ushort value) => value * TokenFactor;
|
||||
public static BigInteger Algo(this in int value) => value * TokenFactor;
|
||||
public static BigInteger Algo(this in uint value) => value * TokenFactor;
|
||||
public static BigInteger Algo(this in long value) => value * TokenFactor;
|
||||
public static BigInteger Algo(this in ulong value) => value * TokenFactor;
|
||||
|
||||
public static BigInteger MAlgo(this in byte value) => value * TokenFactor * MEGA_FACTOR;
|
||||
public static BigInteger MAlgo(this in sbyte value) => value * TokenFactor * MEGA_FACTOR;
|
||||
public static BigInteger MAlgo(this in short value) => value * TokenFactor * MEGA_FACTOR;
|
||||
public static BigInteger MAlgo(this in ushort value) => value * TokenFactor * MEGA_FACTOR;
|
||||
public static BigInteger MAlgo(this in int value) => value * TokenFactor * MEGA_FACTOR;
|
||||
public static BigInteger MAlgo(this in uint value) => value * TokenFactor * MEGA_FACTOR;
|
||||
public static BigInteger MAlgo(this in long value) => value * TokenFactor * MEGA_FACTOR;
|
||||
public static BigInteger MAlgo(this in ulong value) => value * TokenFactor * MEGA_FACTOR;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum;
|
||||
using Nethereum.Contracts;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoErc20Token
|
||||
{
|
||||
public class AlgoTokenV1 : Erc20Token<AlgoTokenV1>
|
||||
{
|
||||
public AlgoTokenV1(Web3 web3, IGasPriceProvider gasPriceProvider) : base(web3, gasPriceProvider) { }
|
||||
public AlgoTokenV1(string contractAddress, Web3 web3, IGasPriceProvider gasPriceProvider) : base(contractAddress, web3, gasPriceProvider) { }
|
||||
|
||||
protected override string AbiResourceName => $"SmartContracts.src.bin.{nameof(AlgoTokenV1)}.abi";
|
||||
protected override string BinResourceName => $"SmartContracts.src.bin.{nameof(AlgoTokenV1)}.bin";
|
||||
protected override BigInteger DeploymentGasUnits => 1200000;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum;
|
||||
using Nethereum.Contracts;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoErc20Token
|
||||
{
|
||||
public abstract class Erc20Token<TContract> : SmartContract<TContract>
|
||||
where TContract : SmartContract<TContract>
|
||||
{
|
||||
private Function _transfer;
|
||||
private Function _balanceOf;
|
||||
private Function _pause;
|
||||
private Function _unpause;
|
||||
|
||||
public Erc20Token(Web3 web3, IGasPriceProvider gasPriceProvider) : base(web3, gasPriceProvider) { }
|
||||
public Erc20Token(string contractAddress, Web3 web3, IGasPriceProvider gasPriceProvider) : base(contractAddress, web3, gasPriceProvider) { }
|
||||
|
||||
public Task<TransactionReceipt> DeployAsync()
|
||||
=> base.DeployAsync();
|
||||
|
||||
protected override void Initialize(Contract contractDescriptor)
|
||||
{
|
||||
_transfer = contractDescriptor.GetFunction("transfer");
|
||||
_balanceOf = contractDescriptor.GetFunction("balanceOf");
|
||||
_pause = contractDescriptor.GetFunction("pause");
|
||||
_unpause = contractDescriptor.GetFunction("unpause");
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> TransferAsync(string to, BigInteger value) =>
|
||||
InvokeAsync(_transfer, 900000, to, value);
|
||||
|
||||
public Task<BigInteger> BalanceOfAsync(string owner) =>
|
||||
_balanceOf.CallAsync<BigInteger>(owner);
|
||||
|
||||
public Task<TransactionReceipt> PauseAsync() =>
|
||||
InvokeAsync(_pause, 900000);
|
||||
|
||||
public Task<TransactionReceipt> UnpauseAsync() =>
|
||||
InvokeAsync(_unpause, 900000);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"solidity.soliumRules": {
|
||||
"indentation": "off",
|
||||
"operator-whitespace": "off",
|
||||
"error-reason": "off",
|
||||
"linebreak-style": "off"
|
||||
},
|
||||
"solidity.packageDefaultDependenciesContractsDirectory": ""
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
pragma solidity 0.5.4;
|
||||
|
||||
import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol";
|
||||
import "openzeppelin-solidity/contracts/token/ERC20/ERC20Pausable.sol";
|
||||
|
||||
contract AlgoTokenV1 is ERC20, ERC20Detailed, ERC20Pausable {
|
||||
|
||||
uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(18));
|
||||
|
||||
constructor()
|
||||
ERC20Pausable()
|
||||
ERC20Detailed("Algos", "ALGO", 18)
|
||||
public
|
||||
{
|
||||
_mint(msg.sender, INITIAL_SUPPLY);
|
||||
}
|
||||
}
|
||||
+13793
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
||||
[{"constant":false,"inputs":[],"name":"pauseMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isAlgoMiner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[],"name":"startMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newMinerAddress","type":"address"}],"name":"migrateMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addSupervisor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"stopAndRemoveOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"resumeMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isCoreTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCategory","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isSupervisor","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"mine","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"deactivateMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwnerAddress","type":"address"}],"name":"resetMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"activateMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceSupervisor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"DAYS_PER_YEAR","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"stopMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"minerType","type":"uint16"},{"name":"category","type":"uint8"},{"name":"ownerAddress","type":"address"},{"name":"tokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
|
||||
+1
@@ -0,0 +1 @@
|
||||
608060405234801561001057600080fd5b50604051608080610ea08339810160409081528151602083015191830151606090930151909290610049336401000000006100c3810204565b61005b336401000000006100de810204565b6002805461ffff191661ffff959095169490941762ff000019166201000060ff949094169390930292909217630100000060b860020a0319166301000000600160a060020a03928316021790925560038054600160a060020a03191691909216179055610184565b6100db600082640100000000610c476100f682021704565b50565b6100db600182640100000000610c476100f682021704565b600160a060020a038116151561010b57600080fd5b61011e828264010000000061014d810204565b1561012857600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561016457600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610d0d806101936000396000f3006080604052600436106101065763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663162f986d811461010b5780631777fb4b1461012257806321b79d981461014b578063231d4e2a1461016057806329d10b6e146101815780632e6b6849146101a2578063363aa6c7146101c3578063427534a4146101d8578063608d3d3d146101ed57806380258e471461020e57806381a244591461023957806399f4b2511461025a5780639e614ca01461026f578063ada436e914610284578063b2a32cd5146102a5578063be952494146102ba578063c6846ef8146102cf578063d43acc79146102f6578063da4086791461030b575b600080fd5b34801561011757600080fd5b50610120610320565b005b34801561012e57600080fd5b50610137610386565b604080519115158252519081900360200190f35b34801561015757600080fd5b5061012061038b565b34801561016c57600080fd5b50610120600160a060020a036004351661042f565b34801561018d57600080fd5b50610120600160a060020a036004351661051b565b3480156101ae57600080fd5b50610120600160a060020a0360043516610538565b3480156101cf57600080fd5b50610120610555565b3480156101e457600080fd5b506101206105fd565b3480156101f957600080fd5b50610137600160a060020a0360043516610660565b34801561021a57600080fd5b50610223610678565b6040805160ff9092168252519081900360200190f35b34801561024557600080fd5b50610137600160a060020a0360043516610687565b34801561026657600080fd5b5061012061069a565b34801561027b57600080fd5b5061012061086c565b34801561029057600080fd5b50610120600160a060020a03600435166108c6565b3480156102b157600080fd5b5061012061095b565b3480156102c657600080fd5b50610120610a6d565b3480156102db57600080fd5b506102e4610a78565b60408051918252519081900360200190f35b34801561030257600080fd5b50610120610a7e565b34801561031757600080fd5b50610120610a87565b61032933610687565b151561033457600080fd5b60016003805460a060020a900460ff169081111561034e57fe5b1461035857600080fd5b600380546002919074ff0000000000000000000000000000000000000000191660a060020a835b0217905550565b600190565b60025463010000009004600160a060020a031633146103a957600080fd5b60016003805460a060020a900460ff16908111156103c357fe5b146103cd57600080fd5b6003547501000000000000000000000000000000000000000000900460ff16156103f657600080fd5b6003805475ff00000000000000000000000000000000000000000019167501000000000000000000000000000000000000000000179055565b61043833610660565b151561044357600080fd5b60006003805460a060020a900460ff169081111561045d57fe5b1461046757600080fd5b600354604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051610518928492600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b1580156104d357600080fd5b505af11580156104e7573d6000803e3d6000fd5b505050506040513d60208110156104fd57600080fd5b5051600354600160a060020a0316919063ffffffff610b1416565b50565b61052433610687565b151561052f57600080fd5b61051881610bcc565b61054133610660565b151561054c57600080fd5b61051881610bdd565b61055e33610687565b151561056957600080fd5b600380805460a060020a900460ff169081111561058257fe5b141561058d57600080fd5b6003805474ff00000000000000000000000000000000000000001916740300000000000000000000000000000000000000001775ff000000000000000000000000000000000000000000191690556002805476ffffffffffffffffffffffffffffffffffffffff00000019169055565b61060633610687565b151561061157600080fd5b60026003805460a060020a900460ff169081111561062b57fe5b1461063557600080fd5b600380546001919074ff0000000000000000000000000000000000000000191660a060020a8361037f565b6000610672818363ffffffff610bee16565b92915050565b60025462010000900460ff1690565b600061067260018363ffffffff610bee16565b60006106a533610660565b15156106b057600080fd5b60016003805460a060020a900460ff16908111156106ca57fe5b146106d457600080fd5b6003547501000000000000000000000000000000000000000000900460ff1615156106fe57600080fd5b60035460b860020a900461ffff161515610774576003805478ffff00000000000000000000000000000000000000000000001976ff0000000000000000000000000000000000000000000019909116760100000000000000000000000000000000000000000000171660b860020a17905561083c565b60038054600161ffff60b860020a8084048216929092018116820278ffff00000000000000000000000000000000000000000000001990931692909217928390559091041661016e141561083c576003805478ffff000000000000000000000000000000000000000000000019600160ff760100000000000000000000000000000000000000000000808504821692909201160276ff0000000000000000000000000000000000000000000019909216919091171660b860020a179Line truncated
|
||||
+303
@@ -0,0 +1,303 @@
|
||||
{
|
||||
"abi": [
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "pauseMining",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "isAlgoMiner",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "startMining",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "newMinerAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "migrateMiner",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "addSupervisor",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "addCoreTeam",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "stopAndRemoveOwnership",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "resumeMining",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isCoreTeam",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "getCategory",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint8"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isSupervisor",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "mine",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "deactivateMiner",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "newOwnerAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "resetMiner",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "activateMiner",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "renounceSupervisor",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "DAYS_PER_YEAR",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "renounceCoreTeam",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "stopMining",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"name": "minerType",
|
||||
"type": "uint16"
|
||||
},
|
||||
{
|
||||
"name": "category",
|
||||
"type": "uint8"
|
||||
},
|
||||
{
|
||||
"name": "ownerAddress",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "tokenAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
}
|
||||
],
|
||||
"bytecode": "608060405234801561001057600080fd5b50604051608080610ea08339810160409081528151602083015191830151606090930151909290610049336401000000006100c3810204565b61005b336401000000006100de810204565b6002805461ffff191661ffff959095169490941762ff000019166201000060ff949094169390930292909217630100000060b860020a0319166301000000600160a060020a03928316021790925560038054600160a060020a03191691909216179055610184565b6100db600082640100000000610c476100f682021704565b50565b6100db600182640100000000610c476100f682021704565b600160a060020a038116151561010b57600080fd5b61011e828264010000000061014d810204565b1561012857600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561016457600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610d0d806101936000396000f3006080604052600436106101065763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663162f986d811461010b5780631777fb4b1461012257806321b79d981461014b578063231d4e2a1461016057806329d10b6e146101815780632e6b6849146101a2578063363aa6c7146101c3578063427534a4146101d8578063608d3d3d146101ed57806380258e471461020e57806381a244591461023957806399f4b2511461025a5780639e614ca01461026f578063ada436e914610284578063b2a32cd5146102a5578063be952494146102ba578063c6846ef8146102cf578063d43acc79146102f6578063da4086791461030b575b600080fd5b34801561011757600080fd5b50610120610320565b005b34801561012e57600080fd5b50610137610386565b604080519115158252519081900360200190f35b34801561015757600080fd5b5061012061038b565b34801561016c57600080fd5b50610120600160a060020a036004351661042f565b34801561018d57600080fd5b50610120600160a060020a036004351661051b565b3480156101ae57600080fd5b50610120600160a060020a0360043516610538565b3480156101cf57600080fd5b50610120610555565b3480156101e457600080fd5b506101206105fd565b3480156101f957600080fd5b50610137600160a060020a0360043516610660565b34801561021a57600080fd5b50610223610678565b6040805160ff9092168252519081900360200190f35b34801561024557600080fd5b50610137600160a060020a0360043516610687565b34801561026657600080fd5b5061012061069a565b34801561027b57600080fd5b5061012061086c565b34801561029057600080fd5b50610120600160a060020a03600435166108c6565b3480156102b157600080fd5b5061012061095b565b3480156102c657600080fd5b50610120610a6d565b3480156102db57600080fd5b506102e4610a78565b60408051918252519081900360200190f35b34801561030257600080fd5b50610120610a7e565b34801561031757600080fd5b50610120610a87565b61032933610687565b151561033457600080fd5b60016003805460a060020a900460ff169081111561034e57fe5b1461035857600080fd5b600380546002919074ff0000000000000000000000000000000000000000191660a060020a835b0217905550565b600190565b60025463010000009004600160a060020a031633146103a957600080fd5b60016003805460a060020a900460ff16908111156103c357fe5b146103cd57600080fd5b6003547501000000000000000000000000000000000000000000900460ff16156103f657600080fd5b6003805475ff00000000000000000000000000000000000000000019167501000000000000000000000000000000000000000000179055565b61043833610660565b151561044357600080fd5b60006003805460a060020a900460ff169081111561045d57fe5b1461046757600080fd5b600354604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051610518928492600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b1580156104d357600080fd5b505af11580156104e7573d6000803e3d6000fd5b505050506040513d60208110156104fd57600080fd5b5051600354600160a060020a0316919063ffffffff610b1416565b50565b61052433610687565b151561052f57600080fd5b61051881610bcc565b61054133610660565b151561054c57600080fd5b61051881610bdd565b61055e33610687565b151561056957600080fd5b600380805460a060020a900460ff169081111561058257fe5b141561058d57600080fd5b6003805474ff00000000000000000000000000000000000000001916740300000000000000000000000000000000000000001775ff000000000000000000000000000000000000000000191690556002805476ffffffffffffffffffffffffffffffffffffffff00000019169055565b61060633610687565b151561061157600080fd5b60026003805460a060020a900460ff169081111561062b57fe5b1461063557600080fd5b600380546001919074ff0000000000000000000000000000000000000000191660a060020a8361037f565b6000610672818363ffffffff610bee16565b92915050565b60025462010000900460ff1690565b600061067260018363ffffffff610bee16565b60006106a533610660565b15156106b057600080fd5b60016003805460a060020a900460ff16908111156106ca57fe5b146106d457600080fd5b6003547501000000000000000000000000000000000000000000900460ff1615156106fe57600080fd5b60035460b860020a900461ffff161515610774576003805478ffff00000000000000000000000000000000000000000000001976ff0000000000000000000000000000000000000000000019909116760100000000000000000000000000000000000000000000171660b860020a17905561083c565b60038054600161ffff60b860020a8084048216929092018116820278ffff00000000000000000000000000000000000000000000001990931692909217928390559091041661016e141561083c576003805478ffff000000000000000000000000000000000000000000000019600160ff760100000000000000000000000000000000000000000000808504821692909201160276ff0000000000000000000000000000000000000000000019909216919091Line truncated
|
||||
"functionHashes": {
|
||||
"DAYS_PER_YEAR()": "c6846ef8",
|
||||
"activateMiner()": "b2a32cd5",
|
||||
"addCoreTeam(address)": "2e6b6849",
|
||||
"addSupervisor(address)": "29d10b6e",
|
||||
"deactivateMiner()": "9e614ca0",
|
||||
"getCategory()": "80258e47",
|
||||
"isAlgoMiner()": "1777fb4b",
|
||||
"isCoreTeam(address)": "608d3d3d",
|
||||
"isSupervisor(address)": "81a24459",
|
||||
"migrateMiner(address)": "231d4e2a",
|
||||
"mine()": "99f4b251",
|
||||
"pauseMining()": "162f986d",
|
||||
"renounceCoreTeam()": "d43acc79",
|
||||
"renounceSupervisor()": "be952494",
|
||||
"resetMiner(address)": "ada436e9",
|
||||
"resumeMining()": "427534a4",
|
||||
"startMining()": "21b79d98",
|
||||
"stopAndRemoveOwnership()": "363aa6c7",
|
||||
"stopMining()": "da408679"
|
||||
},
|
||||
"gasEstimates": {
|
||||
"creation": {
|
||||
"codeDepositCost": "668200",
|
||||
"executionCost": "infinite",
|
||||
"totalCost": "infinite"
|
||||
},
|
||||
"external": {
|
||||
"DAYS_PER_YEAR()": "536",
|
||||
"activateMiner()": "infinite",
|
||||
"addCoreTeam(address)": "infinite",
|
||||
"addSupervisor(address)": "infinite",
|
||||
"deactivateMiner()": "infinite",
|
||||
"getCategory()": "608",
|
||||
"isAlgoMiner()": "212",
|
||||
"isCoreTeam(address)": "infinite",
|
||||
"isSupervisor(address)": "infinite",
|
||||
"migrateMiner(address)": "infinite",
|
||||
"mine()": "infinite",
|
||||
"pauseMining()": "infinite",
|
||||
"renounceCoreTeam()": "infinite",
|
||||
"renounceSupervisor()": "infinite",
|
||||
"resetMiner(address)": "infinite",
|
||||
"resumeMining()": "infinite",
|
||||
"startMining()": "21275",
|
||||
"stopAndRemoveOwnership()": "infinite",
|
||||
"stopMining()": "21624"
|
||||
}
|
||||
}
|
||||
}
|
||||
+10176
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
||||
[{"constant":false,"inputs":[{"name":"minerAddress","type":"address"}],"name":"trasferToMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"TOKEN_FACTOR","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"CAT_4_VALUE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CAT_1_VALUE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CAT_3_VALUE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isCoreTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CAT_0_VALUE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CAT_5_VALUE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CAT_2_VALUE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"poolType","type":"uint16"},{"name":"tokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
|
||||
+1
@@ -0,0 +1 @@
|
||||
608060405234801561001057600080fd5b5060405160408061076083398101604052805160209091015161003b33640100000000610077810204565b60018054600160a060020a0390921662010000026201000060b060020a031961ffff90941661ffff199093169290921792909216179055610120565b61008f60008264010000000061056b61009282021704565b50565b600160a060020a03811615156100a757600080fd5b6100ba82826401000000006100e9810204565b156100c457600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561010057600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6106318061012f6000396000f3006080604052600436106100955763ffffffff60e060020a6000350416632296f4c7811461009a57806325109e8b146100bd5780632e6b6849146100e4578063455acbcd14610105578063492fba841461011a57806349dc9ed01461012f578063608d3d3d146101445780639fc3c98314610179578063a89febb21461018e578063aed6183f146101a3578063d43acc79146101b8575b600080fd5b3480156100a657600080fd5b506100bb600160a060020a03600435166101cd565b005b3480156100c957600080fd5b506100d26103cc565b60408051918252519081900360200190f35b3480156100f057600080fd5b506100bb600160a060020a03600435166103d8565b34801561011157600080fd5b506100d26103f8565b34801561012657600080fd5b506100d2610407565b34801561013b57600080fd5b506100d2610415565b34801561015057600080fd5b50610165600160a060020a0360043516610424565b604080519115158252519081900360200190f35b34801561018557600080fd5b506100d261043c565b34801561019a57600080fd5b506100d261044a565b3480156101af57600080fd5b506100d2610459565b3480156101c457600080fd5b506100bb610468565b60008060006101db33610424565b15156101e657600080fd5b83925082600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561022757600080fd5b505af115801561023b573d6000803e3d6000fd5b505050506040513d602081101561025157600080fd5b5051151561025e57600080fd5b82600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561029c57600080fd5b505af11580156102b0573d6000803e3d6000fd5b505050506040513d60208110156102c657600080fd5b50519150600060ff8316108015906102e2575060058260ff1611155b15156102ed57600080fd5b50600060ff8216151561030b575069152d02c7e14af680000061039c565b8160ff1660011415610328575069d3c21bcecceda100000061039c565b8160ff166002141561034657506a01a784379d99db4200000061039c565b8160ff166003141561036457506a027b46536c66c8e300000061039c565b8160ff166004141561038257506a034f086f3b33b68400000061039c565b8160ff166005141561039c57506a0422ca8b0a00a4250000005b600081116103a957600080fd5b6001546103c690620100009004600160a060020a03168583610473565b50505050565b670de0b6b3a764000081565b6103e133610424565b15156103ec57600080fd5b6103f581610512565b50565b6a034f086f3b33b68400000081565b69d3c21bcecceda100000081565b6a027b46536c66c8e300000081565b6000610436818363ffffffff61052316565b92915050565b69152d02c7e14af680000081565b6a0422ca8b0a00a42500000081565b6a01a784379d99db4200000081565b6104713361055a565b565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1580156104d657600080fd5b505af11580156104ea573d6000803e3d6000fd5b505050506040513d602081101561050057600080fd5b5051151561050d57600080fd5b505050565b6103f560008263ffffffff61056b16565b6000600160a060020a038216151561053a57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6103f560008263ffffffff6105b916565b600160a060020a038116151561058057600080fd5b61058a8282610523565b1561059457600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a03811615156105ce57600080fd5b6105d88282610523565b15156105e357600080fd5b600160a060020a0316600090815260209190915260409020805460ff191690555600a165627a7a72305820f296b4ffb64dca2d6eb3a2164312cba487eba728c8b0729ef90193efdf3b0b3d0029
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
{
|
||||
"abi": [
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "minerAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "trasferToMiner",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "TOKEN_FACTOR",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "addCoreTeam",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "CAT_4_VALUE",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "CAT_1_VALUE",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "CAT_3_VALUE",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isCoreTeam",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "CAT_0_VALUE",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "CAT_5_VALUE",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "CAT_2_VALUE",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "renounceCoreTeam",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"name": "poolType",
|
||||
"type": "uint16"
|
||||
},
|
||||
{
|
||||
"name": "tokenAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
}
|
||||
],
|
||||
"bytecode": "608060405234801561001057600080fd5b5060405160408061076083398101604052805160209091015161003b33640100000000610077810204565b60018054600160a060020a0390921662010000026201000060b060020a031961ffff90941661ffff199093169290921792909216179055610120565b61008f60008264010000000061056b61009282021704565b50565b600160a060020a03811615156100a757600080fd5b6100ba82826401000000006100e9810204565b156100c457600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561010057600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6106318061012f6000396000f3006080604052600436106100955763ffffffff60e060020a6000350416632296f4c7811461009a57806325109e8b146100bd5780632e6b6849146100e4578063455acbcd14610105578063492fba841461011a57806349dc9ed01461012f578063608d3d3d146101445780639fc3c98314610179578063a89febb21461018e578063aed6183f146101a3578063d43acc79146101b8575b600080fd5b3480156100a657600080fd5b506100bb600160a060020a03600435166101cd565b005b3480156100c957600080fd5b506100d26103cc565b60408051918252519081900360200190f35b3480156100f057600080fd5b506100bb600160a060020a03600435166103d8565b34801561011157600080fd5b506100d26103f8565b34801561012657600080fd5b506100d2610407565b34801561013b57600080fd5b506100d2610415565b34801561015057600080fd5b50610165600160a060020a0360043516610424565b604080519115158252519081900360200190f35b34801561018557600080fd5b506100d261043c565b34801561019a57600080fd5b506100d261044a565b3480156101af57600080fd5b506100d2610459565b3480156101c457600080fd5b506100bb610468565b60008060006101db33610424565b15156101e657600080fd5b83925082600160a060020a0316631777fb4b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561022757600080fd5b505af115801561023b573d6000803e3d6000fd5b505050506040513d602081101561025157600080fd5b5051151561025e57600080fd5b82600160a060020a03166380258e476040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561029c57600080fd5b505af11580156102b0573d6000803e3d6000fd5b505050506040513d60208110156102c657600080fd5b50519150600060ff8316108015906102e2575060058260ff1611155b15156102ed57600080fd5b50600060ff8216151561030b575069152d02c7e14af680000061039c565b8160ff1660011415610328575069d3c21bcecceda100000061039c565b8160ff166002141561034657506a01a784379d99db4200000061039c565b8160ff166003141561036457506a027b46536c66c8e300000061039c565b8160ff166004141561038257506a034f086f3b33b68400000061039c565b8160ff166005141561039c57506a0422ca8b0a00a4250000005b600081116103a957600080fd5b6001546103c690620100009004600160a060020a03168583610473565b50505050565b670de0b6b3a764000081565b6103e133610424565b15156103ec57600080fd5b6103f581610512565b50565b6a034f086f3b33b68400000081565b69d3c21bcecceda100000081565b6a027b46536c66c8e300000081565b6000610436818363ffffffff61052316565b92915050565b69152d02c7e14af680000081565b6a0422ca8b0a00a42500000081565b6a01a784379d99db4200000081565b6104713361055a565b565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1580156104d657600080fd5b505af11580156104ea573d6000803e3d6000fd5b505050506040513d602081101561050057600080fd5b5051151561050d57600080fd5b505050565b6103f560008263ffffffff61056b16565b6000600160a060020a038216151561053a57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6103f560008263ffffffff6105b916565b600160a060020a038116151561058057600080fd5b61058a8282610523565b1561059457600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a03811615156105ce57600080fd5b6105d88282610523565b15156105e357600080fd5b600160a060020a0316600090815260209190915260409020805460ff191690555600a165627a7a72305820f296b4ffb64dca2d6eb3a2164312cba487eba728c8b0729ef90193efdf3b0b3d0029",
|
||||
"functionHashes": {
|
||||
"CAT_0_VALUE()": "9fc3c983",
|
||||
"CAT_1_VALUE()": "492fba84",
|
||||
"CAT_2_VALUE()": "aed6183f",
|
||||
"CAT_3_VALUE()": "49dc9ed0",
|
||||
"CAT_4_VALUE()": "455acbcd",
|
||||
"CAT_5_VALUE()": "a89febb2",
|
||||
"TOKEN_FACTOR()": "25109e8b",
|
||||
"addCoreTeam(address)": "2e6b6849",
|
||||
"isCoreTeam(address)": "608d3d3d",
|
||||
"renounceCoreTeam()": "d43acc79",
|
||||
"trasferToMiner(address)": "2296f4c7"
|
||||
},
|
||||
"gasEstimates": {
|
||||
"creation": {
|
||||
"codeDepositCost": "317000",
|
||||
"executionCost": "infinite",
|
||||
"totalCost": "infinite"
|
||||
},
|
||||
"external": {
|
||||
"CAT_0_VALUE()": "401",
|
||||
"CAT_1_VALUE()": "335",
|
||||
"CAT_2_VALUE()": "445",
|
||||
"CAT_3_VALUE()": "357",
|
||||
"CAT_4_VALUE()": "313",
|
||||
"CAT_5_VALUE()": "423",
|
||||
"TOKEN_FACTOR()": "269",
|
||||
"addCoreTeam(address)": "infinite",
|
||||
"isCoreTeam(address)": "infinite",
|
||||
"renounceCoreTeam()": "infinite",
|
||||
"trasferToMiner(address)": "infinite"
|
||||
}
|
||||
}
|
||||
}
|
||||
+16216
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
||||
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"INITIAL_SUPPLY","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isPauser","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renouncePauser","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addPauser","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"account","type":"address"}],"name":"PauserAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"account","type":"address"}],"name":"PauserRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"}]
|
||||
+1
@@ -0,0 +1 @@
|
||||
60806040523480156200001157600080fd5b50604080518082018252600581527f416c676f7300000000000000000000000000000000000000000000000000000060208083019182528351808501909452600484527f414c474f00000000000000000000000000000000000000000000000000000000908401528151919291601291620000909160039190620002c1565b508151620000a6906004906020850190620002c1565b506005805460ff191660ff9290921691909117905550620000d290503364010000000062000103810204565b6007805460ff19169055620000fd336b033b2e3c9fd0803ce800000064010000000062000155810204565b62000366565b6200011e60068264010000000062000b2c6200021482021704565b604051600160a060020a038216907f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f890600090a250565b600160a060020a03821615156200016b57600080fd5b60025462000188908264010000000062000ace6200026f82021704565b600255600160a060020a038216600090815260208190526040902054620001be908264010000000062000ace6200026f82021704565b600160a060020a0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600160a060020a03811615156200022a57600080fd5b6200023f828264010000000062000289810204565b156200024a57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000828201838110156200028257600080fd5b9392505050565b6000600160a060020a0382161515620002a157600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200030457805160ff191683800117855562000334565b8280016001018555821562000334579182015b828111156200033457825182559160200191906001019062000317565b506200034292915062000346565b5090565b6200036391905b808211156200034257600081556001016200034d565b90565b610ba680620003766000396000f3fe608060405234801561001057600080fd5b5060043610610133576000357c0100000000000000000000000000000000000000000000000000000000900480635c975abb116100bf5780638456cb591161008e5780638456cb591461032357806395d89b411461032b578063a457c2d714610333578063a9059cbb1461035f578063dd62ed3e1461038b57610133565b80635c975abb146102c75780636ef8d66d146102cf57806370a08231146102d757806382dc1ec4146102fd57610133565b80632ff2e9dc116101065780632ff2e9dc14610245578063313ce5671461024d578063395093511461026b5780633f4ba83a1461029757806346fbf68e146102a157610133565b806306fdde0314610138578063095ea7b3146101b557806318160ddd146101f557806323b872dd1461020f575b600080fd5b6101406103b9565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017a578181015183820152602001610162565b50505050905090810190601f1680156101a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101e1600480360360408110156101cb57600080fd5b50600160a060020a03813516906020013561044f565b604080519115158252519081900360200190f35b6101fd610473565b60408051918252519081900360200190f35b6101e16004803603606081101561022557600080fd5b50600160a060020a03813581169160208101359091169060400135610479565b6101fd61049f565b6102556104af565b6040805160ff9092168252519081900360200190f35b6101e16004803603604081101561028157600080fd5b50600160a060020a0381351690602001356104b8565b61029f6104d5565b005b6101e1600480360360208110156102b757600080fd5b5035600160a060020a0316610539565b6101e1610552565b61029f61055b565b6101fd600480360360208110156102ed57600080fd5b5035600160a060020a0316610566565b61029f6004803603602081101561031357600080fd5b5035600160a060020a0316610581565b61029f6105a1565b610140610607565b6101e16004803603604081101561034957600080fd5b50600160a060020a038135169060200135610668565b6101e16004803603604081101561037557600080fd5b50600160a060020a038135169060200135610685565b6101fd600480360360408110156103a157600080fd5b50600160a060020a03813581169160200135166106a2565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104455780601f1061041a57610100808354040283529160200191610445565b820191906000526020600020905b81548152906001019060200180831161042857829003601f168201915b5050505050905090565b60075460009060ff161561046257600080fd5b61046c83836106cd565b9392505050565b60025490565b60075460009060ff161561048c57600080fd5b61049784848461074b565b949350505050565b6b033b2e3c9fd0803ce800000081565b60055460ff1690565b60075460009060ff16156104cb57600080fd5b61046c8383610814565b6104de33610539565b15156104e957600080fd5b60075460ff1615156104fa57600080fd5b6007805460ff191690556040805133815290517f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9181900360200190a1565b600061054c60068363ffffffff6108c416565b92915050565b60075460ff1690565b610564336108fb565b565b600160a060020a031660009081526020819052604090205490565b61058a33610539565b151561059557600080fd5b61059e81610943565b50565b6105aa33610539565b15156105b557600080fd5b60075460ff16156105c557600080fd5b6007805460ff191660011790556040805133815290517f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589181900360200190a1565b60048054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610445578Line truncated
|
||||
+455
@@ -0,0 +1,455 @@
|
||||
{
|
||||
"abi": [
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "name",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "approve",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "totalSupply",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "transferFrom",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "INITIAL_SUPPLY",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "decimals",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint8"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "addedValue",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "increaseAllowance",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "success",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "unpause",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isPauser",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "paused",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "renouncePauser",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "balanceOf",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "addPauser",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "pause",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "symbol",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "subtractedValue",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "decreaseAllowance",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "success",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "transfer",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "allowance",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "Paused",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": false,
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "Unpaused",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "PauserAdded",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "PauserRemoved",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"name": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "Transfer",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"name": "spender",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "Approval",
|
||||
"type": "event"
|
||||
}
|
||||
],
|
||||
"bytecode": "60806040523480156200001157600080fd5b50604080518082018252600581527f416c676f7300000000000000000000000000000000000000000000000000000060208083019182528351808501909452600484527f414c474f00000000000000000000000000000000000000000000000000000000908401528151919291601291620000909160039190620002c1565b508151620000a6906004906020850190620002c1565b506005805460ff191660ff9290921691909117905550620000d290503364010000000062000103810204565b6007805460ff19169055620000fd336b033b2e3c9fd0803ce800000064010000000062000155810204565b62000366565b6200011e60068264010000000062000b2c6200021482021704565b604051600160a060020a038216907f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f890600090a250565b600160a060020a03821615156200016b57600080fd5b60025462000188908264010000000062000ace6200026f82021704565b600255600160a060020a038216600090815260208190526040902054620001be908264010000000062000ace6200026f82021704565b600160a060020a0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600160a060020a03811615156200022a57600080fd5b6200023f828264010000000062000289810204565b156200024a57600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000828201838110156200028257600080fd5b9392505050565b6000600160a060020a0382161515620002a157600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200030457805160ff191683800117855562000334565b8280016001018555821562000334579182015b828111156200033457825182559160200191906001019062000317565b506200034292915062000346565b5090565b6200036391905b808211156200034257600081556001016200034d565b90565b610ba680620003766000396000f3fe608060405234801561001057600080fd5b5060043610610133576000357c0100000000000000000000000000000000000000000000000000000000900480635c975abb116100bf5780638456cb591161008e5780638456cb591461032357806395d89b411461032b578063a457c2d714610333578063a9059cbb1461035f578063dd62ed3e1461038b57610133565b80635c975abb146102c75780636ef8d66d146102cf57806370a08231146102d757806382dc1ec4146102fd57610133565b80632ff2e9dc116101065780632ff2e9dc14610245578063313ce5671461024d578063395093511461026b5780633f4ba83a1461029757806346fbf68e146102a157610133565b806306fdde0314610138578063095ea7b3146101b557806318160ddd146101f557806323b872dd1461020f575b600080fd5b6101406103b9565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017a578181015183820152602001610162565b50505050905090810190601f1680156101a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101e1600480360360408110156101cb57600080fd5b50600160a060020a03813516906020013561044f565b604080519115158252519081900360200190f35b6101fd610473565b60408051918252519081900360200190f35b6101e16004803603606081101561022557600080fd5b50600160a060020a03813581169160208101359091169060400135610479565b6101fd61049f565b6102556104af565b6040805160ff9092168252519081900360200190f35b6101e16004803603604081101561028157600080fd5b50600160a060020a0381351690602001356104b8565b61029f6104d5565b005b6101e1600480360360208110156102b757600080fd5b5035600160a060020a0316610539565b6101e1610552565b61029f61055b565b6101fd600480360360208110156102ed57600080fd5b5035600160a060020a0316610566565b61029f6004803603602081101561031357600080fd5b5035600160a060020a0316610581565b61029f6105a1565b610140610607565b6101e16004803603604081101561034957600080fd5b50600160a060020a038135169060200135610668565b6101e16004803603604081101561037557600080fd5b50600160a060020a038135169060200135610685565b6101fd600480360360408110156103a157600080fd5b50600160a060020a03813581169160200135166106a2565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104455780601f1061041a57610100808354040283529160200191610445565b820191906000526020600020905b81548152906001019060200180831161042857829003601f168201915b5050505050905090565b60075460009060ff161561046257600080fd5b61046c83836106cd565b9392505050565b60025490565b60075460009060ff161561048c57600080fd5b61049784848461074b565b949350505050565b6b033b2e3c9fd0803ce800000081565b60055460ff1690565b60075460009060ff16156104cb57600080fd5b61046c8383610814565b6104de33610539565b15156104e957600080fd5b60075460ff1615156104fa57600080fd5b6007805460ff191690556040805133815290517f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9181900360200190a1565b600061054c60068363ffffffff6108c416565b92915050565b60075460ff1690565b610564336108fb565b565b600160a060020a031660009081526020819052604090205490565b61058a33610539565b151561059557600080fd5b61059e81610943565b50565b6105aa33610539565b15156105b557600080fd5b60075460ff16156105c557600080fd5b6007805460ff191660011790556040805133815290517f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589181900360200190a1565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301Line truncated
|
||||
"functionHashes": {
|
||||
"INITIAL_SUPPLY()": "2ff2e9dc",
|
||||
"addPauser(address)": "82dc1ec4",
|
||||
"allowance(address,address)": "dd62ed3e",
|
||||
"approve(address,uint256)": "095ea7b3",
|
||||
"balanceOf(address)": "70a08231",
|
||||
"decimals()": "313ce567",
|
||||
"decreaseAllowance(address,uint256)": "a457c2d7",
|
||||
"increaseAllowance(address,uint256)": "39509351",
|
||||
"isPauser(address)": "46fbf68e",
|
||||
"name()": "06fdde03",
|
||||
"pause()": "8456cb59",
|
||||
"paused()": "5c975abb",
|
||||
"renouncePauser()": "6ef8d66d",
|
||||
"symbol()": "95d89b41",
|
||||
"totalSupply()": "18160ddd",
|
||||
"transfer(address,uint256)": "a9059cbb",
|
||||
"transferFrom(address,address,uint256)": "23b872dd",
|
||||
"unpause()": "3f4ba83a"
|
||||
},
|
||||
"gasEstimates": {
|
||||
"creation": {
|
||||
"codeDepositCost": "596400",
|
||||
"executionCost": "infinite",
|
||||
"totalCost": "infinite"
|
||||
},
|
||||
"external": {
|
||||
"INITIAL_SUPPLY()": "226",
|
||||
"addPauser(address)": "infinite",
|
||||
"allowance(address,address)": "879",
|
||||
"approve(address,uint256)": "22820",
|
||||
"balanceOf(address)": "731",
|
||||
"decimals()": "463",
|
||||
"decreaseAllowance(address,uint256)": "infinite",
|
||||
"increaseAllowance(address,uint256)": "infinite",
|
||||
"isPauser(address)": "infinite",
|
||||
"name()": "infinite",
|
||||
"pause()": "infinite",
|
||||
"paused()": "438",
|
||||
"renouncePauser()": "infinite",
|
||||
"symbol()": "infinite",
|
||||
"totalSupply()": "471",
|
||||
"transfer(address,uint256)": "infinite",
|
||||
"transferFrom(address,address,uint256)": "infinite",
|
||||
"unpause()": "infinite"
|
||||
}
|
||||
}
|
||||
}
|
||||
+555
@@ -0,0 +1,555 @@
|
||||
{
|
||||
"name": "algo-erc20-token",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"ansi-regex": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
|
||||
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||
},
|
||||
"bindings": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
||||
"requires": {
|
||||
"file-uri-to-path": "1.0.0"
|
||||
}
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"camelcase": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
|
||||
"integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0="
|
||||
},
|
||||
"cliui": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz",
|
||||
"integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==",
|
||||
"requires": {
|
||||
"string-width": "^2.1.1",
|
||||
"strip-ansi": "^4.0.0",
|
||||
"wrap-ansi": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
||||
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
|
||||
},
|
||||
"command-exists": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.8.tgz",
|
||||
"integrity": "sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw=="
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"cross-spawn": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
|
||||
"integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
|
||||
"requires": {
|
||||
"lru-cache": "^4.0.1",
|
||||
"shebang-command": "^1.2.0",
|
||||
"which": "^1.2.9"
|
||||
}
|
||||
},
|
||||
"decamelize": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
|
||||
},
|
||||
"execa": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz",
|
||||
"integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=",
|
||||
"requires": {
|
||||
"cross-spawn": "^5.0.1",
|
||||
"get-stream": "^3.0.0",
|
||||
"is-stream": "^1.1.0",
|
||||
"npm-run-path": "^2.0.0",
|
||||
"p-finally": "^1.0.0",
|
||||
"signal-exit": "^3.0.0",
|
||||
"strip-eof": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
|
||||
},
|
||||
"find-up": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
|
||||
"integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
|
||||
"requires": {
|
||||
"locate-path": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "0.30.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz",
|
||||
"integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
"jsonfile": "^2.1.0",
|
||||
"klaw": "^1.0.0",
|
||||
"path-is-absolute": "^1.0.0",
|
||||
"rimraf": "^2.2.8"
|
||||
}
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
},
|
||||
"get-caller-file": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
|
||||
"integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
|
||||
},
|
||||
"get-stream": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
|
||||
"integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ="
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
|
||||
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.1.15",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz",
|
||||
"integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA=="
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"requires": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
|
||||
},
|
||||
"invert-kv": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
|
||||
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
|
||||
},
|
||||
"is-stream": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
|
||||
},
|
||||
"isexe": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
|
||||
"integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
},
|
||||
"keccak": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz",
|
||||
"integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==",
|
||||
"requires": {
|
||||
"bindings": "^1.2.1",
|
||||
"inherits": "^2.0.3",
|
||||
"nan": "^2.2.1",
|
||||
"safe-buffer": "^5.1.0"
|
||||
}
|
||||
},
|
||||
"klaw": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz",
|
||||
"integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.9"
|
||||
}
|
||||
},
|
||||
"lcid": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
|
||||
"integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
|
||||
"requires": {
|
||||
"invert-kv": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"locate-path": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
|
||||
"integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
|
||||
"requires": {
|
||||
"p-locate": "^2.0.0",
|
||||
"path-exists": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "4.1.5",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
|
||||
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
|
||||
"requires": {
|
||||
"pseudomap": "^1.0.2",
|
||||
"yallist": "^2.1.2"
|
||||
}
|
||||
},
|
||||
"mem": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz",
|
||||
"integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=",
|
||||
"requires": {
|
||||
"mimic-fn": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"memorystream": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
|
||||
"integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI="
|
||||
},
|
||||
"mimic-fn": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
|
||||
"integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"nan": {
|
||||
"version": "2.12.1",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz",
|
||||
"integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw=="
|
||||
},
|
||||
"npm-run-path": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
|
||||
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
|
||||
"requires": {
|
||||
"path-key": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
|
||||
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"openzeppelin-solidity": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-2.1.3.tgz",
|
||||
"integrity": "sha512-Zz595xw6w4ZrNU3JJJTlPd8bHFbHv5OkJlkqsM2i+NBs6CzImoHI3dZ+nmhkfR+p52cGXKmayAGbnfdCum1SMg=="
|
||||
},
|
||||
"os-locale": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz",
|
||||
"integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==",
|
||||
"requires": {
|
||||
"execa": "^0.7.0",
|
||||
"lcid": "^1.0.0",
|
||||
"mem": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
|
||||
},
|
||||
"p-finally": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
||||
"integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4="
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
|
||||
"integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
|
||||
"requires": {
|
||||
"p-try": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"p-locate": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
|
||||
"integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
|
||||
"requires": {
|
||||
"p-limit": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"p-try": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
|
||||
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M="
|
||||
},
|
||||
"path-exists": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||
},
|
||||
"path-key": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
|
||||
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A="
|
||||
},
|
||||
"pseudomap": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
|
||||
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
|
||||
},
|
||||
"require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
|
||||
},
|
||||
"require-from-string": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
|
||||
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="
|
||||
},
|
||||
"require-main-filename": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
|
||||
"integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.6.3",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
|
||||
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
|
||||
"integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg=="
|
||||
},
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
||||
},
|
||||
"shebang-command": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
|
||||
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
|
||||
"requires": {
|
||||
"shebang-regex": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"shebang-regex": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
|
||||
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM="
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
|
||||
},
|
||||
"solc": {
|
||||
"version": "0.5.4",
|
||||
"resolved": "https://registry.npmjs.org/solc/-/solc-0.5.4.tgz",
|
||||
"integrity": "sha512-Jz3yz2mct0AYzR83/jBgxDqrLXTHhYUg2G2PVJbMMt5Vu+8e3Of1Mn3nvjPw5mh46jrzt8l4fBN7vHqG5ZF0cw==",
|
||||
"requires": {
|
||||
"command-exists": "^1.2.8",
|
||||
"fs-extra": "^0.30.0",
|
||||
"keccak": "^1.0.2",
|
||||
"memorystream": "^0.3.1",
|
||||
"require-from-string": "^2.0.0",
|
||||
"semver": "^5.5.0",
|
||||
"tmp": "0.0.33",
|
||||
"yargs": "^11.0.0"
|
||||
}
|
||||
},
|
||||
"string-width": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
||||
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
|
||||
"requires": {
|
||||
"is-fullwidth-code-point": "^2.0.0",
|
||||
"strip-ansi": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
||||
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
||||
"requires": {
|
||||
"ansi-regex": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"strip-eof": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
|
||||
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8="
|
||||
},
|
||||
"tmp": {
|
||||
"version": "0.0.33",
|
||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
|
||||
"integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
|
||||
"requires": {
|
||||
"os-tmpdir": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"which": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"which-module": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
|
||||
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
|
||||
},
|
||||
"wrap-ansi": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
|
||||
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
|
||||
"requires": {
|
||||
"string-width": "^1.0.1",
|
||||
"strip-ansi": "^3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
|
||||
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
|
||||
"requires": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
||||
"requires": {
|
||||
"code-point-at": "^1.0.0",
|
||||
"is-fullwidth-code-point": "^1.0.0",
|
||||
"strip-ansi": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
||||
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
||||
"requires": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"y18n": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
|
||||
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
|
||||
},
|
||||
"yallist": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
|
||||
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
|
||||
},
|
||||
"yargs": {
|
||||
"version": "11.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz",
|
||||
"integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==",
|
||||
"requires": {
|
||||
"cliui": "^4.0.0",
|
||||
"decamelize": "^1.1.1",
|
||||
"find-up": "^2.1.0",
|
||||
"get-caller-file": "^1.0.1",
|
||||
"os-locale": "^2.0.0",
|
||||
"require-directory": "^2.1.1",
|
||||
"require-main-filename": "^1.0.1",
|
||||
"set-blocking": "^2.0.0",
|
||||
"string-width": "^2.0.0",
|
||||
"which-module": "^2.0.0",
|
||||
"y18n": "^3.2.1",
|
||||
"yargs-parser": "^9.0.2"
|
||||
}
|
||||
},
|
||||
"yargs-parser": {
|
||||
"version": "9.0.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz",
|
||||
"integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=",
|
||||
"requires": {
|
||||
"camelcase": "^4.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "algo-erc20-token",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"openzeppelin-solidity": "^2.1.3",
|
||||
"solc": "^0.5.4"
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
|
||||
<PackageReference Include="xunit" Version="2.3.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
|
||||
<PackageReference Include="Nethereum.Web3" Version="2.5.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\framework\src\AdvancedAlgos.AlgoToken.Framework.Ethereum.IntegrationTest\AdvancedAlgos.AlgoToken.Framework.Ethereum.IntegrationTest.csproj" />
|
||||
<ProjectReference Include="..\..\..\framework\src\AdvancedAlgos.AlgoToken.Framework.Ethereum\AdvancedAlgos.AlgoToken.Framework.Ethereum.csproj" />
|
||||
<ProjectReference Include="..\..\src\AdvancedAlgos.AlgoToken.AlgoErc20Token\AdvancedAlgos.AlgoToken.AlgoErc20Token.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum.Exceptions;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum.IntegrationTest;
|
||||
using Nethereum.Web3;
|
||||
using Nethereum.Web3.Accounts;
|
||||
using Xunit;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoErc20Token.IntegrationTests
|
||||
{
|
||||
public class AlgoTokenV1Tests
|
||||
{
|
||||
private const long INITIAL_SUPPLY = 1000000000;
|
||||
|
||||
[Fact]
|
||||
public async Task DeployContractAndTransferTokensTest()
|
||||
{
|
||||
EthNetwork.UseDefaultTestNet();
|
||||
|
||||
var account1 = new Account(EthNetwork.Instance.PrefundedPrivateKey);
|
||||
var account2 = EthAccountFactory.Create();
|
||||
|
||||
// Create the ERC20 token...
|
||||
var contract = new AlgoTokenV1(EthNetwork.Instance.GetWeb3(account1), EthNetwork.Instance.GasPriceProvider);
|
||||
await contract.DeployAsync();
|
||||
|
||||
// Ensure that the initial supply is allocated to the owner...
|
||||
Assert.Equal(INITIAL_SUPPLY.Algo(), await contract.BalanceOfAsync(account1.Address));
|
||||
|
||||
// Perform a transfer...
|
||||
await contract.TransferAsync(account2.Address, 2.Algo());
|
||||
|
||||
// Ensure the receiver got the tokens...
|
||||
Assert.Equal(2.Algo(), await contract.BalanceOfAsync(account2.Address));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task PausableFeatureTest()
|
||||
{
|
||||
EthNetwork.UseDefaultTestNet();
|
||||
|
||||
var account1 = new Account(EthNetwork.Instance.PrefundedPrivateKey);
|
||||
var account2 = EthAccountFactory.Create();
|
||||
|
||||
// Create the ERC20 token...
|
||||
var contract = new AlgoTokenV1(EthNetwork.Instance.GetWeb3(account1), EthNetwork.Instance.GasPriceProvider);
|
||||
await contract.DeployAsync();
|
||||
|
||||
// Perform a transfer and check the result...
|
||||
await contract.TransferAsync(account2.Address, 2.Algo());
|
||||
Assert.Equal(2.Algo(), await contract.BalanceOfAsync(account2.Address));
|
||||
|
||||
// Pause the contract...
|
||||
await contract.PauseAsync();
|
||||
|
||||
// Ensure the contract cannot be used while is in paused state...
|
||||
await Assert.ThrowsAsync<TransactionRejectedException>(
|
||||
() => contract.TransferAsync(account2.Address, 2.Algo()));
|
||||
|
||||
// Ensure the balance was not modified...
|
||||
Assert.Equal(2.Algo(), await contract.BalanceOfAsync(account2.Address));
|
||||
|
||||
// Unpause the contract...
|
||||
await contract.UnpauseAsync();
|
||||
|
||||
// Try a new transfer and ensure it succeeded...
|
||||
await contract.TransferAsync(account2.Address, 2.Algo());
|
||||
Assert.Equal(4.Algo(), await contract.BalanceOfAsync(account2.Address));
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="SmartContracts\src\bin\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="SmartContracts\src\bin\*.*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Nethereum.Web3" Version="2.5.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\framework\src\AdvancedAlgos.AlgoToken.Framework.Ethereum\AdvancedAlgos.AlgoToken.Framework.Ethereum.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum;
|
||||
using Nethereum.Contracts;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution
|
||||
{
|
||||
public class AlgoFees : SmartContract<AlgoFees>
|
||||
{
|
||||
private Function _registerMiner;
|
||||
private Function _unregisterMiner;
|
||||
private Function _mine;
|
||||
private Function _terminate;
|
||||
|
||||
private Function _addSystem;
|
||||
private Function _addCoreTeam;
|
||||
|
||||
private Function _getMinerCount;
|
||||
private Function _getMinerByIndex;
|
||||
|
||||
public AlgoFees(Web3 web3, IGasPriceProvider gasPriceProvider) : base(web3, gasPriceProvider) { }
|
||||
public AlgoFees(string contractAddress, Web3 web3, IGasPriceProvider gasPriceProvider) : base(contractAddress, web3, gasPriceProvider) { }
|
||||
|
||||
protected override string AbiResourceName => $"SmartContracts.src.bin.{nameof(AlgoFees)}.abi";
|
||||
protected override string BinResourceName => $"SmartContracts.src.bin.{nameof(AlgoFees)}.bin";
|
||||
protected override BigInteger DeploymentGasUnits => 1400000;
|
||||
|
||||
public Task<TransactionReceipt> DeployAsync(string tokenAddress)
|
||||
=> base.DeployAsync(tokenAddress);
|
||||
|
||||
protected override void Initialize(Contract contractDescriptor)
|
||||
{
|
||||
_registerMiner = contractDescriptor.GetFunction("registerMiner");
|
||||
_unregisterMiner = contractDescriptor.GetFunction("unregisterMiner");
|
||||
_mine = contractDescriptor.GetFunction("mine");
|
||||
_terminate = contractDescriptor.GetFunction("terminate");
|
||||
|
||||
_addSystem = contractDescriptor.GetFunction("addSystem");
|
||||
_addCoreTeam = contractDescriptor.GetFunction("addCoreTeam");
|
||||
|
||||
_getMinerCount = contractDescriptor.GetFunction("getMinerCount");
|
||||
_getMinerByIndex = contractDescriptor.GetFunction("getMinerByIndex");
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> RegisterMinerAsync(string minerAddress) =>
|
||||
InvokeAsync(_registerMiner, 900000, minerAddress);
|
||||
|
||||
public Task<TransactionReceipt> UnregisterMinerAsync(string minerAddress) =>
|
||||
InvokeAsync(_unregisterMiner, 900000, minerAddress);
|
||||
|
||||
public Task<TransactionReceipt> MineAsync() =>
|
||||
InvokeAsync(_mine, 1500000);
|
||||
|
||||
public Task<TransactionReceipt> TerminateAsync() =>
|
||||
InvokeAsync(_terminate, 900000);
|
||||
|
||||
public Task<TransactionReceipt> AddSystemAsync(string account) =>
|
||||
InvokeAsync(_addSystem, 900000, account);
|
||||
|
||||
public Task<TransactionReceipt> AddCoreTeamAsync(string account) =>
|
||||
InvokeAsync(_addCoreTeam, 900000, account);
|
||||
|
||||
public Task<BigInteger> GetMinerCountAsync() =>
|
||||
_getMinerCount.CallAsync<BigInteger>();
|
||||
|
||||
public Task<string> GetMinerByIndexAsync(BigInteger index) =>
|
||||
_getMinerByIndex.CallAsync<string>(index);
|
||||
}
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum;
|
||||
using Nethereum.Contracts;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution
|
||||
{
|
||||
public class AlgoMiner : SmartContract<AlgoMiner>
|
||||
{
|
||||
private Function _activateMiner;
|
||||
private Function _deactivateMiner;
|
||||
private Function _migrateMiner;
|
||||
private Function _pauseMining;
|
||||
private Function _resumeMining;
|
||||
private Function _stopAndRemoveOwnership;
|
||||
private Function _resetMiner;
|
||||
private Function _startMining;
|
||||
private Function _stopMining;
|
||||
private Function _mine;
|
||||
private Function _terminate;
|
||||
|
||||
private Function _addSystem;
|
||||
private Function _addCoreTeam;
|
||||
private Function _addSupervisor;
|
||||
|
||||
public AlgoMiner(Web3 web3, IGasPriceProvider gasPriceProvider) : base(web3, gasPriceProvider) { }
|
||||
public AlgoMiner(string contractAddress, Web3 web3, IGasPriceProvider gasPriceProvider) : base(contractAddress, web3, gasPriceProvider) { }
|
||||
|
||||
protected override string AbiResourceName => $"SmartContracts.src.bin.{nameof(AlgoMiner)}.abi";
|
||||
protected override string BinResourceName => $"SmartContracts.src.bin.{nameof(AlgoMiner)}.bin";
|
||||
protected override BigInteger DeploymentGasUnits => 1600000;
|
||||
|
||||
public Task<TransactionReceipt> DeployAsync(byte minerType, byte category, string minerAccountAddress, string referralAccountAddress, string tokenAddress)
|
||||
=> base.DeployAsync(minerType, category, minerAccountAddress, referralAccountAddress, tokenAddress);
|
||||
|
||||
protected override void Initialize(Contract contractDescriptor)
|
||||
{
|
||||
_activateMiner = contractDescriptor.GetFunction("activateMiner");
|
||||
_deactivateMiner = contractDescriptor.GetFunction("deactivateMiner");
|
||||
_migrateMiner = contractDescriptor.GetFunction("migrateMiner");
|
||||
_pauseMining = contractDescriptor.GetFunction("pauseMining");
|
||||
_resumeMining = contractDescriptor.GetFunction("resumeMining");
|
||||
_stopAndRemoveOwnership = contractDescriptor.GetFunction("stopAndRemoveOwnership");
|
||||
_resetMiner = contractDescriptor.GetFunction("resetMiner");
|
||||
_startMining = contractDescriptor.GetFunction("startMining");
|
||||
_stopMining = contractDescriptor.GetFunction("stopMining");
|
||||
_mine = contractDescriptor.GetFunction("mine");
|
||||
_terminate = contractDescriptor.GetFunction("terminate");
|
||||
|
||||
_addSystem = contractDescriptor.GetFunction("addSystem");
|
||||
_addCoreTeam = contractDescriptor.GetFunction("addCoreTeam");
|
||||
_addSupervisor = contractDescriptor.GetFunction("addSupervisor");
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> ActivateMinerAsync() =>
|
||||
InvokeAsync(_activateMiner, 900000);
|
||||
|
||||
public Task<TransactionReceipt> DeactivateMinerAsync() =>
|
||||
InvokeAsync(_deactivateMiner, 900000);
|
||||
|
||||
public Task<TransactionReceipt> MigrateMinerAsync(string newMinerAddress) =>
|
||||
InvokeAsync(_migrateMiner, 900000, newMinerAddress);
|
||||
|
||||
public Task<TransactionReceipt> PauseMiningAsync() =>
|
||||
InvokeAsync(_pauseMining, 900000);
|
||||
|
||||
public Task<TransactionReceipt> ResumeMiningAsync() =>
|
||||
InvokeAsync(_resumeMining, 900000);
|
||||
|
||||
public Task<TransactionReceipt> StopAndRemoveOwnershipAsync() =>
|
||||
InvokeAsync(_stopAndRemoveOwnership, 900000);
|
||||
|
||||
public Task<TransactionReceipt> ResetMinerAsync(string newOwnerAddress, string newReferralAddress) =>
|
||||
InvokeAsync(_resetMiner, 900000, newOwnerAddress, newReferralAddress);
|
||||
|
||||
public Task<TransactionReceipt> StartMiningAsync() =>
|
||||
InvokeAsync(_startMining, 900000);
|
||||
|
||||
public Task<TransactionReceipt> StopMiningAsync() =>
|
||||
InvokeAsync(_stopMining, 900000);
|
||||
|
||||
public Task<TransactionReceipt> MineAsync() =>
|
||||
InvokeAsync(_mine, 900000);
|
||||
|
||||
public Task<TransactionReceipt> TerminateAsync() =>
|
||||
InvokeAsync(_terminate, 900000);
|
||||
|
||||
public Task<TransactionReceipt> AddSystemAsync(string account) =>
|
||||
InvokeAsync(_addSystem, 900000, account);
|
||||
|
||||
public Task<TransactionReceipt> AddCoreTeamAsync(string account) =>
|
||||
InvokeAsync(_addCoreTeam, 900000, account);
|
||||
|
||||
public Task<TransactionReceipt> AddSupervisorAsync(string account) =>
|
||||
InvokeAsync(_addSupervisor, 900000, account);
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum;
|
||||
using Nethereum.Contracts;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution
|
||||
{
|
||||
public class AlgoPool : SmartContract<AlgoPool>
|
||||
{
|
||||
private Function _transferToMiner;
|
||||
private Function _terminate;
|
||||
|
||||
public AlgoPool(Web3 web3, IGasPriceProvider gasPriceProvider) : base(web3, gasPriceProvider) { }
|
||||
public AlgoPool(string contractAddress, Web3 web3, IGasPriceProvider gasPriceProvider) : base(contractAddress, web3, gasPriceProvider) { }
|
||||
|
||||
protected override string AbiResourceName => $"SmartContracts.src.bin.{nameof(AlgoPool)}.abi";
|
||||
protected override string BinResourceName => $"SmartContracts.src.bin.{nameof(AlgoPool)}.bin";
|
||||
protected override BigInteger DeploymentGasUnits => 1200000;
|
||||
|
||||
public Task<TransactionReceipt> DeployAsync(byte poolType, string tokenAddress)
|
||||
=> base.DeployAsync(poolType, tokenAddress);
|
||||
|
||||
protected override void Initialize(Contract contractDescriptor)
|
||||
{
|
||||
_transferToMiner = contractDescriptor.GetFunction("transferToMiner");
|
||||
_terminate = contractDescriptor.GetFunction("terminate");
|
||||
}
|
||||
|
||||
public Task<TransactionReceipt> TransferToMinerAsync(string minerAddress) =>
|
||||
InvokeAsync(_transferToMiner, 900000, minerAddress);
|
||||
|
||||
public Task<TransactionReceipt> TerminateAsync() =>
|
||||
InvokeAsync(_terminate, 900000);
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.Algorithms
|
||||
{
|
||||
public static class FeesDistributionAlgorithm
|
||||
{
|
||||
private static decimal[] _categoryProportions = new decimal[]
|
||||
{
|
||||
1,
|
||||
10,
|
||||
20,
|
||||
30,
|
||||
40,
|
||||
50
|
||||
};
|
||||
|
||||
public static decimal[] Distribute(decimal totalAmount, long[] miners)
|
||||
{
|
||||
decimal totalProportion = 0;
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
totalProportion += _categoryProportions[i] * miners[i];
|
||||
}
|
||||
|
||||
var allocationPercentage = new decimal[6];
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
if (miners[i] > 0) allocationPercentage[i] = _categoryProportions[i] / totalProportion;
|
||||
}
|
||||
|
||||
var feePerMiner = new decimal[6];
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
if (miners[i] > 0) feePerMiner[i] = Math.Round(totalAmount * allocationPercentage[i]);
|
||||
}
|
||||
|
||||
return feePerMiner;
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"solidity.soliumRules": {
|
||||
"indentation": "off",
|
||||
"operator-whitespace": "off",
|
||||
"error-reason": "off",
|
||||
"linebreak-style": "off"
|
||||
},
|
||||
"solidity.packageDefaultDependenciesContractsDirectory": ""
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
pragma solidity 0.5.4;
|
||||
|
||||
contract AlgoCommon {
|
||||
|
||||
uint256 internal constant TOKEN_FACTOR = 10 ** uint256(18);
|
||||
uint256 internal constant CAT_0_VALUE = 100000 * TOKEN_FACTOR;
|
||||
uint256 internal constant CAT_1_VALUE = 1000000 * TOKEN_FACTOR;
|
||||
uint256 internal constant CAT_2_VALUE = 2 * 1000000 * TOKEN_FACTOR;
|
||||
uint256 internal constant CAT_3_VALUE = 3 * 1000000 * TOKEN_FACTOR;
|
||||
uint256 internal constant CAT_4_VALUE = 4 * 1000000 * TOKEN_FACTOR;
|
||||
uint256 internal constant CAT_5_VALUE = 5 * 1000000 * TOKEN_FACTOR;
|
||||
|
||||
function getCapacityByCategory(uint8 category) internal pure returns (uint256) {
|
||||
if(category == 0) {
|
||||
return CAT_0_VALUE;
|
||||
} else if(category == 1) {
|
||||
return CAT_1_VALUE;
|
||||
} else if(category == 2) {
|
||||
return CAT_2_VALUE;
|
||||
} else if(category == 3) {
|
||||
return CAT_3_VALUE;
|
||||
} else if(category == 4) {
|
||||
return CAT_4_VALUE;
|
||||
} else if(category == 5) {
|
||||
return CAT_5_VALUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
pragma solidity 0.5.4;
|
||||
|
||||
import "openzeppelin-solidity/contracts/access/Roles.sol";
|
||||
|
||||
contract AlgoCoreTeamRole {
|
||||
using Roles for Roles.Role;
|
||||
|
||||
Roles.Role private _coreTeamMembers;
|
||||
|
||||
constructor () internal {
|
||||
_addCoreTeam(msg.sender);
|
||||
}
|
||||
|
||||
modifier onlyCoreTeam() {
|
||||
require(isCoreTeam(msg.sender));
|
||||
_;
|
||||
}
|
||||
|
||||
function isCoreTeam(address account) public view returns (bool) {
|
||||
return _coreTeamMembers.has(account);
|
||||
}
|
||||
|
||||
function addCoreTeam(address account) public onlyCoreTeam {
|
||||
_addCoreTeam(account);
|
||||
}
|
||||
|
||||
function renounceCoreTeam() public {
|
||||
_removeCoreTeam(msg.sender);
|
||||
}
|
||||
|
||||
function _addCoreTeam(address account) internal {
|
||||
_coreTeamMembers.add(account);
|
||||
}
|
||||
|
||||
function _removeCoreTeam(address account) internal {
|
||||
_coreTeamMembers.remove(account);
|
||||
}
|
||||
}
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
pragma solidity 0.5.4;
|
||||
|
||||
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
|
||||
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
|
||||
|
||||
import "./IAlgoMiner.sol";
|
||||
import "./ERC20TokenHolder.sol";
|
||||
import "./AlgoSystemRole.sol";
|
||||
import "./AlgoCoreTeamRole.sol";
|
||||
|
||||
contract AlgoFees is ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole {
|
||||
using SafeERC20 for IERC20;
|
||||
|
||||
uint256 private constant CAT_0_VALUE_PROPORTION = 1;
|
||||
uint256 private constant CAT_1_VALUE_PROPORTION = 10;
|
||||
uint256 private constant CAT_2_VALUE_PROPORTION = 20;
|
||||
uint256 private constant CAT_3_VALUE_PROPORTION = 30;
|
||||
uint256 private constant CAT_4_VALUE_PROPORTION = 40;
|
||||
uint256 private constant CAT_5_VALUE_PROPORTION = 50;
|
||||
|
||||
address[] private _miners;
|
||||
mapping(address => uint256) private _minersByAddress;
|
||||
|
||||
constructor(address tokenAddress)
|
||||
ERC20TokenHolder(tokenAddress)
|
||||
AlgoSystemRole()
|
||||
AlgoCoreTeamRole()
|
||||
public {
|
||||
_miners.push(address(0)); // Reserved as a marker for unregistered miner.
|
||||
}
|
||||
|
||||
function registerMiner(address minerAddress) public notTerminated onlyCoreTeam {
|
||||
require(_miners.length < 1000);
|
||||
require(_minersByAddress[minerAddress] == 0);
|
||||
|
||||
IAlgoMiner algoMiner = IAlgoMiner(minerAddress);
|
||||
|
||||
require(algoMiner.isAlgoMiner());
|
||||
|
||||
uint8 minerCategory = algoMiner.getCategory();
|
||||
|
||||
require(minerCategory <= 5);
|
||||
|
||||
_minersByAddress[minerAddress] = _miners.length;
|
||||
_miners.push(minerAddress);
|
||||
}
|
||||
|
||||
function unregisterMiner(address minerAddress) public notTerminated onlyCoreTeam {
|
||||
require(_miners.length > 1);
|
||||
|
||||
if(_miners.length == 2) {
|
||||
|
||||
// Just remove the only registered miner...
|
||||
_miners.pop();
|
||||
delete _minersByAddress[minerAddress];
|
||||
|
||||
} else {
|
||||
|
||||
if(_minersByAddress[minerAddress] != _miners.length) {
|
||||
// Move the latest miner to the gap...
|
||||
_miners[_minersByAddress[minerAddress]] = _miners[_miners.length - 1];
|
||||
}
|
||||
|
||||
_miners.pop();
|
||||
delete _minersByAddress[minerAddress];
|
||||
}
|
||||
}
|
||||
|
||||
function mine() public notTerminated onlySystem {
|
||||
require(_miners.length > 1);
|
||||
|
||||
uint256 currentFeesBalance = _token.balanceOf(address(this));
|
||||
|
||||
require(currentFeesBalance > 0);
|
||||
|
||||
// Count how many ENABLED miners we have for each category...
|
||||
uint256[6] memory miners;
|
||||
uint256 minerCount = _miners.length;
|
||||
|
||||
for(uint256 i = 1; i < minerCount; i++) {
|
||||
IAlgoMiner algoMiner = IAlgoMiner(_miners[i]);
|
||||
|
||||
if(!algoMiner.isMining()) continue;
|
||||
|
||||
uint8 minerCategory = algoMiner.getCategory();
|
||||
|
||||
if(minerCategory == 0) {
|
||||
miners[0]++;
|
||||
} else if(minerCategory == 1) {
|
||||
miners[1]++;
|
||||
} else if(minerCategory == 2) {
|
||||
miners[2]++;
|
||||
} else if(minerCategory == 3) {
|
||||
miners[3]++;
|
||||
} else if(minerCategory == 4) {
|
||||
miners[4]++;
|
||||
} else if(minerCategory == 5) {
|
||||
miners[5]++;
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate the fee to pay per miner according to its category...
|
||||
uint256 totalProportion = CAT_0_VALUE_PROPORTION * miners[0] +
|
||||
CAT_1_VALUE_PROPORTION * miners[1] +
|
||||
CAT_2_VALUE_PROPORTION * miners[2] +
|
||||
CAT_3_VALUE_PROPORTION * miners[3] +
|
||||
CAT_4_VALUE_PROPORTION * miners[4] +
|
||||
CAT_5_VALUE_PROPORTION * miners[5];
|
||||
|
||||
uint256[6] memory feePerMiner;
|
||||
|
||||
feePerMiner[0] = currentFeesBalance * CAT_0_VALUE_PROPORTION / totalProportion;
|
||||
feePerMiner[1] = currentFeesBalance * CAT_1_VALUE_PROPORTION / totalProportion;
|
||||
feePerMiner[2] = currentFeesBalance * CAT_2_VALUE_PROPORTION / totalProportion;
|
||||
feePerMiner[3] = currentFeesBalance * CAT_3_VALUE_PROPORTION / totalProportion;
|
||||
feePerMiner[4] = currentFeesBalance * CAT_4_VALUE_PROPORTION / totalProportion;
|
||||
feePerMiner[5] = currentFeesBalance * CAT_5_VALUE_PROPORTION / totalProportion;
|
||||
|
||||
// Transfer the fees to ENABLED miners...
|
||||
for(uint256 i = 1; i < minerCount; i++) {
|
||||
IAlgoMiner algoMiner = IAlgoMiner(_miners[i]);
|
||||
|
||||
if(!algoMiner.isMining()) continue;
|
||||
|
||||
uint8 minerCategory = algoMiner.getCategory();
|
||||
|
||||
_token.safeTransfer(algoMiner.getMiner(), feePerMiner[minerCategory]);
|
||||
}
|
||||
}
|
||||
|
||||
function terminate() public onlyCoreTeam {
|
||||
_terminate();
|
||||
}
|
||||
|
||||
function getMinerCount() public view returns (uint256) {
|
||||
return _miners.length - 1;
|
||||
}
|
||||
|
||||
function getMinerByIndex(uint256 index) public view returns (address) {
|
||||
return _miners[index + 1];
|
||||
}
|
||||
}
|
||||
+206
@@ -0,0 +1,206 @@
|
||||
pragma solidity 0.5.4;
|
||||
|
||||
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
|
||||
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
|
||||
|
||||
import "./IAlgoMiner.sol";
|
||||
import "./AlgoCommon.sol";
|
||||
import "./ERC20TokenHolder.sol";
|
||||
import "./AlgoSystemRole.sol";
|
||||
import "./AlgoCoreTeamRole.sol";
|
||||
import "./AlgoSupervisorRole.sol";
|
||||
|
||||
contract AlgoMiner is AlgoCommon, ERC20TokenHolder, AlgoSystemRole, AlgoCoreTeamRole, AlgoSupervisorRole, IAlgoMiner {
|
||||
using SafeERC20 for IERC20;
|
||||
|
||||
uint256 private constant DAYS_PER_YEAR = 365;
|
||||
|
||||
enum MinerType {
|
||||
PoolBased,
|
||||
NonPoolBased
|
||||
}
|
||||
|
||||
enum MinerState {
|
||||
Deactivated,
|
||||
Activated,
|
||||
Suspended,
|
||||
Stopped
|
||||
}
|
||||
|
||||
MinerType private _minerType;
|
||||
uint8 private _category;
|
||||
address private _miner;
|
||||
address private _referral;
|
||||
|
||||
MinerState private _state;
|
||||
bool private _mining;
|
||||
uint8 private _currentYear;
|
||||
uint16 private _currentDay;
|
||||
uint256 private _currentYearSupply;
|
||||
|
||||
constructor(MinerType minerType, uint8 category, address minerAccountAddress, address referralAccountAddress, address tokenAddress)
|
||||
ERC20TokenHolder(tokenAddress)
|
||||
AlgoSystemRole()
|
||||
AlgoCoreTeamRole()
|
||||
AlgoSupervisorRole()
|
||||
public {
|
||||
|
||||
require(category <= 5);
|
||||
require(minerAccountAddress != address(0));
|
||||
|
||||
if(minerType == MinerType.PoolBased) {
|
||||
require(referralAccountAddress != address(0));
|
||||
}
|
||||
|
||||
_minerType = minerType;
|
||||
_category = category;
|
||||
_miner = minerAccountAddress;
|
||||
_referral = referralAccountAddress;
|
||||
}
|
||||
|
||||
modifier onlyMiner() {
|
||||
require(msg.sender == _miner);
|
||||
_;
|
||||
}
|
||||
|
||||
function activateMiner() public notTerminated onlyCoreTeam {
|
||||
require(_state == MinerState.Deactivated);
|
||||
|
||||
if(_minerType == MinerType.PoolBased && _currentYearSupply == 0) {
|
||||
|
||||
uint256 capacity = getCapacityByCategory(_category);
|
||||
uint256 expectedBalance = capacity + capacity * 10 / 100;
|
||||
|
||||
uint256 currentBalance = _token.balanceOf(address(this));
|
||||
|
||||
require(currentBalance == expectedBalance);
|
||||
|
||||
_currentYearSupply = capacity / 2;
|
||||
}
|
||||
|
||||
_state = MinerState.Activated;
|
||||
}
|
||||
|
||||
function deactivateMiner() public notTerminated onlyCoreTeam {
|
||||
require(_state != MinerState.Deactivated);
|
||||
|
||||
_state = MinerState.Deactivated;
|
||||
_mining = false;
|
||||
}
|
||||
|
||||
function migrateMiner(address newMinerAddress) public onlyCoreTeam {
|
||||
require(_state == MinerState.Deactivated);
|
||||
|
||||
_token.safeTransfer(newMinerAddress, _token.balanceOf(address(this)));
|
||||
}
|
||||
|
||||
function pauseMining() public notTerminated onlySupervisor {
|
||||
require(_state == MinerState.Activated);
|
||||
|
||||
_state = MinerState.Suspended;
|
||||
}
|
||||
|
||||
function resumeMining() public notTerminated onlySupervisor {
|
||||
require(_state == MinerState.Suspended);
|
||||
|
||||
_state = MinerState.Activated;
|
||||
}
|
||||
|
||||
function stopAndRemoveOwnership() public notTerminated onlySupervisor {
|
||||
require(_state != MinerState.Stopped);
|
||||
|
||||
_state = MinerState.Stopped;
|
||||
_mining = false;
|
||||
_miner = address(0);
|
||||
_referral = address(0);
|
||||
}
|
||||
|
||||
function resetMiner(address newOwnerAddress, address newReferralAddress) public notTerminated onlySupervisor {
|
||||
require(_state == MinerState.Stopped);
|
||||
|
||||
_state = MinerState.Activated;
|
||||
_miner = newOwnerAddress;
|
||||
_referral = newReferralAddress;
|
||||
}
|
||||
|
||||
function startMining() public notTerminated onlyMiner {
|
||||
require(_state == MinerState.Activated);
|
||||
require(!_mining);
|
||||
|
||||
_mining = true;
|
||||
}
|
||||
|
||||
function stopMining() public notTerminated onlyMiner {
|
||||
require(_state == MinerState.Activated);
|
||||
require(_mining);
|
||||
|
||||
_mining = false;
|
||||
}
|
||||
|
||||
function mine() public notTerminated onlySystem {
|
||||
require(_minerType == MinerType.PoolBased);
|
||||
require(_state == MinerState.Activated);
|
||||
require(_mining);
|
||||
|
||||
if(_currentDay == 0) {
|
||||
_currentYear = 1;
|
||||
_currentDay = 1;
|
||||
} else {
|
||||
_currentDay++;
|
||||
if(_currentDay == (DAYS_PER_YEAR + 1)) {
|
||||
_currentYear++;
|
||||
_currentDay = 1;
|
||||
_currentYearSupply = _currentYearSupply / 2;
|
||||
}
|
||||
}
|
||||
|
||||
uint256 minerTokens = _currentYearSupply / DAYS_PER_YEAR;
|
||||
uint256 referralTokens = minerTokens * 10 / 100;
|
||||
|
||||
require(minerTokens > 0);
|
||||
require(referralTokens > 0);
|
||||
|
||||
_token.safeTransfer(_miner, minerTokens);
|
||||
_token.safeTransfer(_referral, referralTokens);
|
||||
}
|
||||
|
||||
function terminate() public onlyCoreTeam {
|
||||
_terminate();
|
||||
}
|
||||
|
||||
function isAlgoMiner() public pure returns (bool) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function getMinerType() public view returns (uint8) {
|
||||
return uint8(_minerType);
|
||||
}
|
||||
|
||||
function getCategory() public view returns (uint8) {
|
||||
return _category;
|
||||
}
|
||||
|
||||
function getMiner() public view returns (address) {
|
||||
return _miner;
|
||||
}
|
||||
|
||||
function getReferral() public view returns (address) {
|
||||
return _referral;
|
||||
}
|
||||
|
||||
function isMining() public view returns (bool) {
|
||||
return _state == MinerState.Activated && _mining;
|
||||
}
|
||||
|
||||
function getCurrentYear() public view returns (uint8) {
|
||||
return _currentYear;
|
||||
}
|
||||
|
||||
function getCurrentDay() public view returns (uint16) {
|
||||
return _currentDay;
|
||||
}
|
||||
|
||||
function getCurrentYearSupply() public view returns (uint256) {
|
||||
return _currentYearSupply;
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
pragma solidity 0.5.4;
|
||||
|
||||
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
|
||||
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
|
||||
|
||||
import "./IAlgoMiner.sol";
|
||||
import "./AlgoCommon.sol";
|
||||
import "./ERC20TokenHolder.sol";
|
||||
import "./AlgoCoreTeamRole.sol";
|
||||
|
||||
contract AlgoPool is AlgoCommon, ERC20TokenHolder, AlgoCoreTeamRole {
|
||||
using SafeERC20 for IERC20;
|
||||
|
||||
enum PoolType {
|
||||
MinerPool,
|
||||
ReferralPool
|
||||
}
|
||||
|
||||
PoolType private _poolType;
|
||||
mapping(address => bool) private _fundedMiners;
|
||||
|
||||
constructor(PoolType poolType, address tokenAddress)
|
||||
ERC20TokenHolder(tokenAddress)
|
||||
AlgoCoreTeamRole()
|
||||
public {
|
||||
_poolType = poolType;
|
||||
}
|
||||
|
||||
function transferToMiner(address minerAddress) public notTerminated onlyCoreTeam {
|
||||
require(!_fundedMiners[minerAddress]);
|
||||
|
||||
IAlgoMiner algoMiner = IAlgoMiner(minerAddress);
|
||||
|
||||
require(algoMiner.isAlgoMiner());
|
||||
|
||||
uint8 minerCategory = algoMiner.getCategory();
|
||||
|
||||
require(minerCategory <= 5);
|
||||
|
||||
uint256 value = getCapacityByCategory(minerCategory);
|
||||
|
||||
// For referral pools only transfer the 10% of the category capacity.
|
||||
if(_poolType == PoolType.ReferralPool) {
|
||||
value = value * 10 / 100;
|
||||
}
|
||||
|
||||
_fundedMiners[minerAddress] = true;
|
||||
_token.safeTransfer(minerAddress, value);
|
||||
}
|
||||
|
||||
function terminate() public onlyCoreTeam {
|
||||
_terminate();
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
pragma solidity 0.5.4;
|
||||
|
||||
import "openzeppelin-solidity/contracts/access/Roles.sol";
|
||||
|
||||
contract AlgoSupervisorRole {
|
||||
using Roles for Roles.Role;
|
||||
|
||||
Roles.Role private _supervisors;
|
||||
|
||||
constructor () internal {
|
||||
_addSupervisor(msg.sender);
|
||||
}
|
||||
|
||||
modifier onlySupervisor() {
|
||||
require(isSupervisor(msg.sender));
|
||||
_;
|
||||
}
|
||||
|
||||
function isSupervisor(address account) public view returns (bool) {
|
||||
return _supervisors.has(account);
|
||||
}
|
||||
|
||||
function addSupervisor(address account) public onlySupervisor {
|
||||
_addSupervisor(account);
|
||||
}
|
||||
|
||||
function renounceSupervisor() public {
|
||||
_removeSupervisor(msg.sender);
|
||||
}
|
||||
|
||||
function _addSupervisor(address account) internal {
|
||||
_supervisors.add(account);
|
||||
}
|
||||
|
||||
function _removeSupervisor(address account) internal {
|
||||
_supervisors.remove(account);
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
pragma solidity 0.5.4;
|
||||
|
||||
import "openzeppelin-solidity/contracts/access/Roles.sol";
|
||||
|
||||
contract AlgoSystemRole {
|
||||
using Roles for Roles.Role;
|
||||
|
||||
Roles.Role private _systemMembers;
|
||||
|
||||
constructor () internal {
|
||||
_addSystem(msg.sender);
|
||||
}
|
||||
|
||||
modifier onlySystem() {
|
||||
require(isSystem(msg.sender));
|
||||
_;
|
||||
}
|
||||
|
||||
function isSystem(address account) public view returns (bool) {
|
||||
return _systemMembers.has(account);
|
||||
}
|
||||
|
||||
function addSystem(address account) public onlySystem {
|
||||
_addSystem(account);
|
||||
}
|
||||
|
||||
function renounceSystem() public {
|
||||
_removeSystem(msg.sender);
|
||||
}
|
||||
|
||||
function _addSystem(address account) internal {
|
||||
_systemMembers.add(account);
|
||||
}
|
||||
|
||||
function _removeSystem(address account) internal {
|
||||
_systemMembers.remove(account);
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
pragma solidity 0.5.4;
|
||||
|
||||
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
|
||||
import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
|
||||
|
||||
import "./Terminable.sol";
|
||||
|
||||
contract ERC20TokenHolder is Terminable {
|
||||
using SafeERC20 for IERC20;
|
||||
|
||||
IERC20 internal _token;
|
||||
|
||||
constructor(address tokenAddress) Terminable() internal {
|
||||
_token = IERC20(tokenAddress);
|
||||
}
|
||||
|
||||
function _terminate() internal {
|
||||
uint256 currentBalance = _token.balanceOf(address(this));
|
||||
if(currentBalance > 0) {
|
||||
_token.safeTransfer(_creator, currentBalance);
|
||||
}
|
||||
Terminable._terminate();
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
pragma solidity 0.5.4;
|
||||
|
||||
contract IAlgoMiner {
|
||||
function isAlgoMiner() public pure returns (bool);
|
||||
function getMinerType() public view returns (uint8);
|
||||
function getCategory() public view returns (uint8);
|
||||
function getMiner() public view returns (address);
|
||||
function getReferral() public view returns (address);
|
||||
function isMining() public view returns (bool);
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
pragma solidity 0.5.4;
|
||||
|
||||
contract Terminable {
|
||||
|
||||
address internal _creator;
|
||||
bool internal _terminated;
|
||||
|
||||
constructor() internal {
|
||||
_creator = msg.sender;
|
||||
_terminated = false;
|
||||
}
|
||||
|
||||
modifier notTerminated() {
|
||||
require(!_terminated);
|
||||
_;
|
||||
}
|
||||
|
||||
function _terminate() internal {
|
||||
_terminated = true;
|
||||
}
|
||||
}
|
||||
+16807
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
||||
[{"constant":false,"inputs":[],"name":"terminate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"minerAddress","type":"address"}],"name":"registerMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isSystem","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"getMinerByIndex","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isCoreTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addSystem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"minerAddress","type":"address"}],"name":"unregisterMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"mine","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getMinerCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceSystem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"tokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
|
||||
+1
@@ -0,0 +1 @@
|
||||
60806040523480156200001157600080fd5b5060405160208062001070833981018060405260208110156200003357600080fd5b50516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a0384161790556200007d90640100000000620000d8810204565b6200009133640100000000620000f6810204565b50600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054600160a060020a0319169055620001a4565b620000f360028264010000000062000dd76200011182021704565b50565b620000f360038264010000000062000dd76200011182021704565b600160a060020a03811615156200012757600080fd5b6200013c82826401000000006200016c810204565b156200014757600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200018457600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610ebc80620001b46000396000f3fe608060405234801561001057600080fd5b50600436106100b85760003560e060020a9004806374be75921161007557806374be7592146101ac57806381f909f3146101d257806399f4b251146101f8578063bb52c13714610200578063d43acc791461021a578063e9d6185914610222576100b8565b80630c08bf88146100bd5780632e6b6849146100c7578063341ccfcb146100ed57806334cdcf26146101135780633d19ab131461014d578063608d3d3d14610186575b600080fd5b6100c561022a565b005b6100c5600480360360208110156100dd57600080fd5b5035600160a060020a0316610248565b6100c56004803603602081101561010357600080fd5b5035600160a060020a0316610268565b6101396004803603602081101561012957600080fd5b5035600160a060020a031661043c565b604080519115158252519081900360200190f35b61016a6004803603602081101561016357600080fd5b5035610455565b60408051600160a060020a039092168252519081900360200190f35b6101396004803603602081101561019c57600080fd5b5035600160a060020a0316610484565b6100c5600480360360208110156101c257600080fd5b5035600160a060020a0316610497565b6100c5600480360360208110156101e857600080fd5b5035600160a060020a03166104b4565b6100c5610656565b610208610ba4565b60408051918252519081900360200190f35b6100c5610bae565b6100c5610bb7565b61023333610484565b151561023e57600080fd5b610246610bc0565b565b61025133610484565b151561025c57600080fd5b61026581610c86565b50565b60005474010000000000000000000000000000000000000000900460ff161561029057600080fd5b61029933610484565b15156102a457600080fd5b6004546103e8116102b457600080fd5b600160a060020a038116600090815260056020526040902054156102d757600080fd5b600081905080600160a060020a0316631777fb4b6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561031857600080fd5b505afa15801561032c573d6000803e3d6000fd5b505050506040513d602081101561034257600080fd5b5051151561034f57600080fd5b600081600160a060020a03166380258e476040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561038d57600080fd5b505afa1580156103a1573d6000803e3d6000fd5b505050506040513d60208110156103b757600080fd5b50519050600560ff821611156103cc57600080fd5b505060048054600160a060020a039092166000818152600560205260408120849055600184018355919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909101805473ffffffffffffffffffffffffffffffffffffffff19169091179055565b600061044f60028363ffffffff610c9716565b92915050565b600060048260010181548110151561046957fe5b600091825260209091200154600160a060020a031692915050565b600061044f60038363ffffffff610c9716565b6104a03361043c565b15156104ab57600080fd5b61026581610cce565b60005474010000000000000000000000000000000000000000900460ff16156104dc57600080fd5b6104e533610484565b15156104f057600080fd5b6004546001106104ff57600080fd5b60045460021415610564576004805480151561051757fe5b600082815260208082208301600019908101805473ffffffffffffffffffffffffffffffffffffffff19169055909201909255600160a060020a0383168252600590526040812055610265565b600454600160a060020a038216600090815260056020526040902054146105fe5760048054600019810190811061059757fe5b6000918252602080832090910154600160a060020a03848116845260059092526040909220546004805492909316929181106105cf57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055505b6004805480151561060b57fe5b600082815260208082208301600019908101805473ffffffffffffffffffffffffffffffffffffffff19169055909201909255600160a060020a038316825260059052604081205550565b60005474010000000000000000000000000000000000000000900460ff161561067e57600080fd5b6106873361043c565b151561069257600080fd5b6004546001106106a157600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a08231916024808301926020929190829003018186803b15801561070557600080fd5b505afa158015610719573d6000803e3d6000fd5b505050506040513d602081101561072f57600080fd5b505190506000811161074057600080fd5b610748610e71565b60045460015b8181101561090157600060048281548110151561076757fe5b60009182526020918290200154604080517f19a74ab30000000000000000000000000000000000000000000000000000000081529051600160a060020a03909216935083926319a74ab392600480840193829003018186803b1580156107cc57600080fd5b505afa1580156107e0573d6000803e3d6000fd5b505050506040513d60208110156107f657600080fd5b5051151561080457506108f9565b600081600160a060020a0Line truncated
|
||||
+214
@@ -0,0 +1,214 @@
|
||||
{
|
||||
"abi": [
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "terminate",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "addCoreTeam",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "minerAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "registerMiner",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isSystem",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "index",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "getMinerByIndex",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isCoreTeam",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "addSystem",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "minerAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "unregisterMiner",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "mine",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "getMinerCount",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "renounceCoreTeam",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "renounceSystem",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"name": "tokenAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
}
|
||||
],
|
||||
"bytecode": "60806040523480156200001157600080fd5b5060405160208062001070833981018060405260208110156200003357600080fd5b50516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a0384161790556200007d90640100000000620000d8810204565b6200009133640100000000620000f6810204565b50600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054600160a060020a0319169055620001a4565b620000f360028264010000000062000dd76200011182021704565b50565b620000f360038264010000000062000dd76200011182021704565b600160a060020a03811615156200012757600080fd5b6200013c82826401000000006200016c810204565b156200014757600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200018457600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b610ebc80620001b46000396000f3fe608060405234801561001057600080fd5b50600436106100b85760003560e060020a9004806374be75921161007557806374be7592146101ac57806381f909f3146101d257806399f4b251146101f8578063bb52c13714610200578063d43acc791461021a578063e9d6185914610222576100b8565b80630c08bf88146100bd5780632e6b6849146100c7578063341ccfcb146100ed57806334cdcf26146101135780633d19ab131461014d578063608d3d3d14610186575b600080fd5b6100c561022a565b005b6100c5600480360360208110156100dd57600080fd5b5035600160a060020a0316610248565b6100c56004803603602081101561010357600080fd5b5035600160a060020a0316610268565b6101396004803603602081101561012957600080fd5b5035600160a060020a031661043c565b604080519115158252519081900360200190f35b61016a6004803603602081101561016357600080fd5b5035610455565b60408051600160a060020a039092168252519081900360200190f35b6101396004803603602081101561019c57600080fd5b5035600160a060020a0316610484565b6100c5600480360360208110156101c257600080fd5b5035600160a060020a0316610497565b6100c5600480360360208110156101e857600080fd5b5035600160a060020a03166104b4565b6100c5610656565b610208610ba4565b60408051918252519081900360200190f35b6100c5610bae565b6100c5610bb7565b61023333610484565b151561023e57600080fd5b610246610bc0565b565b61025133610484565b151561025c57600080fd5b61026581610c86565b50565b60005474010000000000000000000000000000000000000000900460ff161561029057600080fd5b61029933610484565b15156102a457600080fd5b6004546103e8116102b457600080fd5b600160a060020a038116600090815260056020526040902054156102d757600080fd5b600081905080600160a060020a0316631777fb4b6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561031857600080fd5b505afa15801561032c573d6000803e3d6000fd5b505050506040513d602081101561034257600080fd5b5051151561034f57600080fd5b600081600160a060020a03166380258e476040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561038d57600080fd5b505afa1580156103a1573d6000803e3d6000fd5b505050506040513d60208110156103b757600080fd5b50519050600560ff821611156103cc57600080fd5b505060048054600160a060020a039092166000818152600560205260408120849055600184018355919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909101805473ffffffffffffffffffffffffffffffffffffffff19169091179055565b600061044f60028363ffffffff610c9716565b92915050565b600060048260010181548110151561046957fe5b600091825260209091200154600160a060020a031692915050565b600061044f60038363ffffffff610c9716565b6104a03361043c565b15156104ab57600080fd5b61026581610cce565b60005474010000000000000000000000000000000000000000900460ff16156104dc57600080fd5b6104e533610484565b15156104f057600080fd5b6004546001106104ff57600080fd5b60045460021415610564576004805480151561051757fe5b600082815260208082208301600019908101805473ffffffffffffffffffffffffffffffffffffffff19169055909201909255600160a060020a0383168252600590526040812055610265565b600454600160a060020a038216600090815260056020526040902054146105fe5760048054600019810190811061059757fe5b6000918252602080832090910154600160a060020a03848116845260059092526040909220546004805492909316929181106105cf57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055505b6004805480151561060b57fe5b600082815260208082208301600019908101805473ffffffffffffffffffffffffffffffffffffffff19169055909201909255600160a060020a038316825260059052604081205550565b60005474010000000000000000000000000000000000000000900460ff161561067e57600080fd5b6106873361043c565b151561069257600080fd5b6004546001106106a157600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a08231916024808301926020929190829003018186803b15801561070557600080fd5b505afa158015610719573d6000803e3d6000fd5b505050506040513d602081101561072f57600080fd5b505190506000811161074057600080fd5b610748610e71565b60045460015b8181101561090157600060048281548110151561076757fe5b60009182526020918290200154604080517f19a74ab30000000000000000000000000000000000000000000000000000000081529051600160a060020a03909216935083926319a74ab392600480840193829003018186803b1580156107cc57600080fd5b505afa1580156107e0573d6000803e3d6000fd5b505050506040513d60208110156107f657600080fd5b5051151561080457506108f9565b6000Line truncated
|
||||
"functionHashes": {
|
||||
"addCoreTeam(address)": "2e6b6849",
|
||||
"addSystem(address)": "74be7592",
|
||||
"getMinerByIndex(uint256)": "3d19ab13",
|
||||
"getMinerCount()": "bb52c137",
|
||||
"isCoreTeam(address)": "608d3d3d",
|
||||
"isSystem(address)": "34cdcf26",
|
||||
"mine()": "99f4b251",
|
||||
"registerMiner(address)": "341ccfcb",
|
||||
"renounceCoreTeam()": "d43acc79",
|
||||
"renounceSystem()": "e9d61859",
|
||||
"terminate()": "0c08bf88",
|
||||
"unregisterMiner(address)": "81f909f3"
|
||||
},
|
||||
"gasEstimates": {
|
||||
"creation": {
|
||||
"codeDepositCost": "754400",
|
||||
"executionCost": "infinite",
|
||||
"totalCost": "infinite"
|
||||
},
|
||||
"external": {
|
||||
"addCoreTeam(address)": "infinite",
|
||||
"addSystem(address)": "infinite",
|
||||
"getMinerByIndex(uint256)": "1058",
|
||||
"getMinerCount()": "541",
|
||||
"isCoreTeam(address)": "infinite",
|
||||
"isSystem(address)": "infinite",
|
||||
"mine()": "infinite",
|
||||
"registerMiner(address)": "infinite",
|
||||
"renounceCoreTeam()": "infinite",
|
||||
"renounceSystem()": "infinite",
|
||||
"terminate()": "infinite",
|
||||
"unregisterMiner(address)": "infinite"
|
||||
}
|
||||
}
|
||||
}
|
||||
+20333
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
||||
[{"constant":false,"inputs":[],"name":"terminate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pauseMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isAlgoMiner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"isMining","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"startMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newMinerAddress","type":"address"}],"name":"migrateMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addSupervisor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getMiner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getReferral","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isSystem","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"stopAndRemoveOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentDay","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"resumeMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getMinerType","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isCoreTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addSystem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getCategory","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isSupervisor","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwnerAddress","type":"address"},{"name":"newReferralAddress","type":"address"}],"name":"resetMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"mine","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"deactivateMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"activateMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceSupervisor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentYearSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentYear","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"stopMining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceSystem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"minerType","type":"uint8"},{"name":"category","type":"uint8"},{"name":"minerAccountAddress","type":"address"},{"name":"referralAccountAddress","type":"address"},{"name":"tokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
|
||||
+1
@@ -0,0 +1 @@
|
||||
60806040523480156200001157600080fd5b5060405160a08062001458833981018060405260a08110156200003357600080fd5b5080516020820151604083015160608401516080909401516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a038416179055939492939192916200009a906401000000006200018e810204565b620000ae33640100000000620001ac810204565b620000c233640100000000620001c7810204565b600560ff85161115620000d457600080fd5b600160a060020a0383161515620000ea57600080fd5b6000856001811115620000f957fe5b14156200011657600160a060020a03821615156200011657600080fd5b6005805486919060ff1916600183818111156200012f57fe5b0217905550506005805461ff00191661010060ff9590951694909402939093176201000060b060020a03191662010000600160a060020a03938416021790925560068054600160a060020a031916929091169190911790555062000275565b620001a96002826401000000006200110d620001e282021704565b50565b620001a96003826401000000006200110d620001e282021704565b620001a96004826401000000006200110d620001e282021704565b600160a060020a0381161515620001f857600080fd5b6200020d82826401000000006200023d810204565b156200021857600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200025557600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6111d380620002856000396000f3fe608060405234801561001057600080fd5b50600436106101ec576000357c0100000000000000000000000000000000000000000000000000000000900480634969ae70116101215780639e614ca0116100bf578063ce41607a1161008e578063ce41607a14610422578063d43acc791461042a578063da40867914610432578063e9d618591461043a576101ec565b80639e614ca0146103f0578063b2a32cd5146103f8578063be95249414610400578063cdfd0f6414610408576101ec565b806380258e47116100fb57806380258e471461038c57806381a24459146103945780638329138f146103ba57806399f4b251146103e8576101ec565b80634969ae7014610322578063608d3d3d1461034057806374be759214610366576101ec565b80632e6b68491161018e57806334cdcf261161016857806334cdcf26146102cd578063363aa6c7146102f35780633e6968b6146102fb578063427534a41461031a576101ec565b80632e6b68491461027b578063302c11ca146102a1578063329b1c92146102c5576101ec565b806319a74ab3116101ca57806319a74ab31461021f57806321b79d9814610227578063231d4e2a1461022f57806329d10b6e14610255576101ec565b80630c08bf88146101f1578063162f986d146101fb5780631777fb4b14610203575b600080fd5b6101f9610442565b005b6101f9610460565b61020b6104cf565b604080519115158252519081900360200190f35b61020b6104d4565b6101f961050b565b6101f96004803603602081101561024557600080fd5b5035600160a060020a03166105a1565b6101f96004803603602081101561026b57600080fd5b5035600160a060020a031661068b565b6101f96004803603602081101561029157600080fd5b5035600160a060020a03166106a8565b6102a96106c5565b60408051600160a060020a039092168252519081900360200190f35b6102a96106da565b61020b600480360360208110156102e357600080fd5b5035600160a060020a03166106e9565b6101f9610704565b6103036107b5565b6040805161ffff9092168252519081900360200190f35b6101f96107c6565b61032a610832565b6040805160ff9092168252519081900360200190f35b61020b6004803603602081101561035657600080fd5b5035600160a060020a0316610846565b6101f96004803603602081101561037c57600080fd5b5035600160a060020a0316610859565b61032a610876565b61020b600480360360208110156103aa57600080fd5b5035600160a060020a0316610884565b6101f9600480360360408110156103d057600080fd5b50600160a060020a0381358116916020013516610897565b6101f961094a565b6101f9610b86565b6101f9610bf7565b6101f9610d53565b610410610d5c565b60408051918252519081900360200190f35b61032a610d62565b6101f9610d85565b6101f9610d8e565b6101f9610e1f565b61044b33610846565b151561045657600080fd5b61045e610e28565b565b60005460a060020a900460ff161561047757600080fd5b61048033610884565b151561048b57600080fd5b600160065460a060020a900460ff1660038111156104a557fe5b146104af57600080fd5b600680546002919060a060020a60ff02191660a060020a835b0217905550565b600190565b6000600160065460a060020a900460ff1660038111156104f057fe5b148015610506575060065460a860020a900460ff165b905090565b60005460a060020a900460ff161561052257600080fd5b600554620100009004600160a060020a0316331461053f57600080fd5b600160065460a060020a900460ff16600381111561055957fe5b1461056357600080fd5b60065460a860020a900460ff161561057a57600080fd5b6006805475ff000000000000000000000000000000000000000000191660a860020a179055565b6105aa33610846565b15156105b557600080fd5b600060065460a060020a900460ff1660038111156105cf57fe5b146105d957600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051610688928492600160a060020a03909116916370a0823191602480820192602092909190829003018186803b15801561064357600080fd5b505afa158015610657573d6000803e3d6000fd5b505050506040513d602081101561066d57600080fd5b5051600154600160a060020a0316919063ffffffff610eee16565b50565b61069433610884565b151561069f57600080fd5b61068881610fa6565b6106b133610846565b15156106bc57600080fd5b61068881610fb7565b600554620100009004600160a060020a031690565b600654600160a060020a031690565b60006106fc60028363ffffffff610fc816565b90505b919050565b60005460a060020a900460ff161561071b57600080fd5b61072433610884565b151561072f57600080fd5b600360065460a060020a900460ff1Line truncated
|
||||
+466
@@ -0,0 +1,466 @@
|
||||
{
|
||||
"abi": [
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "terminate",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "pauseMining",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "isAlgoMiner",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "isMining",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "startMining",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "newMinerAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "migrateMiner",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "addSupervisor",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "addCoreTeam",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "getMiner",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "getReferral",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isSystem",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "stopAndRemoveOwnership",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "getCurrentDay",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint16"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "resumeMining",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "getMinerType",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint8"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isCoreTeam",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "addSystem",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "getCategory",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint8"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isSupervisor",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "newOwnerAddress",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "newReferralAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "resetMiner",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "mine",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "deactivateMiner",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "activateMiner",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "renounceSupervisor",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "getCurrentYearSupply",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "getCurrentYear",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint8"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "renounceCoreTeam",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "stopMining",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "renounceSystem",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"name": "minerType",
|
||||
"type": "uint8"
|
||||
},
|
||||
{
|
||||
"name": "category",
|
||||
"type": "uint8"
|
||||
},
|
||||
{
|
||||
"name": "minerAccountAddress",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "referralAccountAddress",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "tokenAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
}
|
||||
],
|
||||
"bytecode": "60806040523480156200001157600080fd5b5060405160a08062001458833981018060405260a08110156200003357600080fd5b5080516020820151604083015160608401516080909401516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a038416179055939492939192916200009a906401000000006200018e810204565b620000ae33640100000000620001ac810204565b620000c233640100000000620001c7810204565b600560ff85161115620000d457600080fd5b600160a060020a0383161515620000ea57600080fd5b6000856001811115620000f957fe5b14156200011657600160a060020a03821615156200011657600080fd5b6005805486919060ff1916600183818111156200012f57fe5b0217905550506005805461ff00191661010060ff9590951694909402939093176201000060b060020a03191662010000600160a060020a03938416021790925560068054600160a060020a031916929091169190911790555062000275565b620001a96002826401000000006200110d620001e282021704565b50565b620001a96003826401000000006200110d620001e282021704565b620001a96004826401000000006200110d620001e282021704565b600160a060020a0381161515620001f857600080fd5b6200020d82826401000000006200023d810204565b156200021857600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200025557600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6111d380620002856000396000f3fe608060405234801561001057600080fd5b50600436106101ec576000357c0100000000000000000000000000000000000000000000000000000000900480634969ae70116101215780639e614ca0116100bf578063ce41607a1161008e578063ce41607a14610422578063d43acc791461042a578063da40867914610432578063e9d618591461043a576101ec565b80639e614ca0146103f0578063b2a32cd5146103f8578063be95249414610400578063cdfd0f6414610408576101ec565b806380258e47116100fb57806380258e471461038c57806381a24459146103945780638329138f146103ba57806399f4b251146103e8576101ec565b80634969ae7014610322578063608d3d3d1461034057806374be759214610366576101ec565b80632e6b68491161018e57806334cdcf261161016857806334cdcf26146102cd578063363aa6c7146102f35780633e6968b6146102fb578063427534a41461031a576101ec565b80632e6b68491461027b578063302c11ca146102a1578063329b1c92146102c5576101ec565b806319a74ab3116101ca57806319a74ab31461021f57806321b79d9814610227578063231d4e2a1461022f57806329d10b6e14610255576101ec565b80630c08bf88146101f1578063162f986d146101fb5780631777fb4b14610203575b600080fd5b6101f9610442565b005b6101f9610460565b61020b6104cf565b604080519115158252519081900360200190f35b61020b6104d4565b6101f961050b565b6101f96004803603602081101561024557600080fd5b5035600160a060020a03166105a1565b6101f96004803603602081101561026b57600080fd5b5035600160a060020a031661068b565b6101f96004803603602081101561029157600080fd5b5035600160a060020a03166106a8565b6102a96106c5565b60408051600160a060020a039092168252519081900360200190f35b6102a96106da565b61020b600480360360208110156102e357600080fd5b5035600160a060020a03166106e9565b6101f9610704565b6103036107b5565b6040805161ffff9092168252519081900360200190f35b6101f96107c6565b61032a610832565b6040805160ff9092168252519081900360200190f35b61020b6004803603602081101561035657600080fd5b5035600160a060020a0316610846565b6101f96004803603602081101561037c57600080fd5b5035600160a060020a0316610859565b61032a610876565b61020b600480360360208110156103aa57600080fd5b5035600160a060020a0316610884565b6101f9600480360360408110156103d057600080fd5b50600160a060020a0381358116916020013516610897565b6101f961094a565b6101f9610b86565b6101f9610bf7565b6101f9610d53565b610410610d5c565b60408051918252519081900360200190f35b61032a610d62565b6101f9610d85565b6101f9610d8e565b6101f9610e1f565b61044b33610846565b151561045657600080fd5b61045e610e28565b565b60005460a060020a900460ff161561047757600080fd5b61048033610884565b151561048b57600080fd5b600160065460a060020a900460ff1660038111156104a557fe5b146104af57600080fd5b600680546002919060a060020a60ff02191660a060020a835b0217905550565b600190565b6000600160065460a060020a900460ff1660038111156104f057fe5b148015610506575060065460a860020a900460ff165b905090565b60005460a060020a900460ff161561052257600080fd5b600554620100009004600160a060020a0316331461053f57600080fd5b600160065460a060020a900460ff16600381111561055957fe5b1461056357600080fd5b60065460a860020a900460ff161561057a57600080fd5b6006805475ff000000000000000000000000000000000000000000191660a860020a179055565b6105aa33610846565b15156105b557600080fd5b600060065460a060020a900460ff1660038111156105cf57fe5b146105d957600080fd5b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051610688928492600160a060020a03909116916370a0823191602480820192602092909190829003018186803b15801561064357600080fd5b505afa158015610657573d6000803e3d6000fd5b505050506040513d602081101561066d57600080fd5b5051600154600160a060020a0316919063ffffffff610eee16565b50565b61069433610884565b151561069f57600080fd5b61068881610fa6565b6106b133610846565b15156106bc57600080fd5b61068881610fb7565b600554620100009004600160a060020a031690565b600654600160a060020a031690565b60006106fc60028363ffffffff610fc816565b90505b919050565b60005460a060020a900460ff161561071b57600080fd5b61072433610884565b151561072f57600080fd5b600360065460Line truncated
|
||||
"functionHashes": {
|
||||
"activateMiner()": "b2a32cd5",
|
||||
"addCoreTeam(address)": "2e6b6849",
|
||||
"addSupervisor(address)": "29d10b6e",
|
||||
"addSystem(address)": "74be7592",
|
||||
"deactivateMiner()": "9e614ca0",
|
||||
"getCategory()": "80258e47",
|
||||
"getCurrentDay()": "3e6968b6",
|
||||
"getCurrentYear()": "ce41607a",
|
||||
"getCurrentYearSupply()": "cdfd0f64",
|
||||
"getMiner()": "302c11ca",
|
||||
"getMinerType()": "4969ae70",
|
||||
"getReferral()": "329b1c92",
|
||||
"isAlgoMiner()": "1777fb4b",
|
||||
"isCoreTeam(address)": "608d3d3d",
|
||||
"isMining()": "19a74ab3",
|
||||
"isSupervisor(address)": "81a24459",
|
||||
"isSystem(address)": "34cdcf26",
|
||||
"migrateMiner(address)": "231d4e2a",
|
||||
"mine()": "99f4b251",
|
||||
"pauseMining()": "162f986d",
|
||||
"renounceCoreTeam()": "d43acc79",
|
||||
"renounceSupervisor()": "be952494",
|
||||
"renounceSystem()": "e9d61859",
|
||||
"resetMiner(address,address)": "8329138f",
|
||||
"resumeMining()": "427534a4",
|
||||
"startMining()": "21b79d98",
|
||||
"stopAndRemoveOwnership()": "363aa6c7",
|
||||
"stopMining()": "da408679",
|
||||
"terminate()": "0c08bf88"
|
||||
},
|
||||
"gasEstimates": {
|
||||
"creation": {
|
||||
"codeDepositCost": "912600",
|
||||
"executionCost": "infinite",
|
||||
"totalCost": "infinite"
|
||||
},
|
||||
"external": {
|
||||
"activateMiner()": "infinite",
|
||||
"addCoreTeam(address)": "infinite",
|
||||
"addSupervisor(address)": "infinite",
|
||||
"addSystem(address)": "infinite",
|
||||
"deactivateMiner()": "infinite",
|
||||
"getCategory()": "474",
|
||||
"getCurrentDay()": "581",
|
||||
"getCurrentYear()": "473",
|
||||
"getCurrentYearSupply()": "514",
|
||||
"getMiner()": "635",
|
||||
"getMinerType()": "501",
|
||||
"getReferral()": "646",
|
||||
"isAlgoMiner()": "300",
|
||||
"isCoreTeam(address)": "infinite",
|
||||
"isMining()": "880",
|
||||
"isSupervisor(address)": "infinite",
|
||||
"isSystem(address)": "infinite",
|
||||
"migrateMiner(address)": "infinite",
|
||||
"mine()": "infinite",
|
||||
"pauseMining()": "infinite",
|
||||
"renounceCoreTeam()": "infinite",
|
||||
"renounceSupervisor()": "infinite",
|
||||
"renounceSystem()": "infinite",
|
||||
"resetMiner(address,address)": "infinite",
|
||||
"resumeMining()": "infinite",
|
||||
"startMining()": "21741",
|
||||
"stopAndRemoveOwnership()": "infinite",
|
||||
"stopMining()": "21695",
|
||||
"terminate()": "infinite"
|
||||
}
|
||||
}
|
||||
}
|
||||
+11930
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
||||
[{"constant":false,"inputs":[],"name":"terminate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isCoreTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceCoreTeam","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"minerAddress","type":"address"}],"name":"transferToMiner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"poolType","type":"uint8"},{"name":"tokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
|
||||
+1
@@ -0,0 +1 @@
|
||||
608060405234801561001057600080fd5b506040516040806107e88339810180604052604081101561003057600080fd5b5080516020909101516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a03841617905561007f906401000000006100a3810204565b6003805483919060ff19166001838181111561009757fe5b0217905550505061014c565b6100bb6002826401000000006105c76100be82021704565b50565b600160a060020a03811615156100d357600080fd5b6100e68282640100000000610115810204565b156100f057600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561012c57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61068d8061015b6000396000f3fe608060405234801561001057600080fd5b506004361061005a5760e060020a60003504630c08bf88811461005f5780632e6b684914610069578063608d3d3d1461008f578063d43acc79146100c9578063fe4028bb146100d1575b600080fd5b6100676100f7565b005b6100676004803603602081101561007f57600080fd5b5035600160a060020a0316610115565b6100b5600480360360208110156100a557600080fd5b5035600160a060020a0316610135565b604080519115158252519081900360200190f35b610067610150565b610067600480360360208110156100e757600080fd5b5035600160a060020a0316610159565b61010033610135565b151561010b57600080fd5b610113610320565b565b61011e33610135565b151561012957600080fd5b610132816103e6565b50565b600061014860028363ffffffff6103f716565b90505b919050565b6101133361042e565b60005474010000000000000000000000000000000000000000900460ff161561018157600080fd5b61018a33610135565b151561019557600080fd5b600160a060020a03811660009081526004602052604090205460ff16156101bb57600080fd5b600081905080600160a060020a0316631777fb4b6040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156101fc57600080fd5b505afa158015610210573d6000803e3d6000fd5b505050506040513d602081101561022657600080fd5b5051151561023357600080fd5b600081600160a060020a03166380258e476040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561027157600080fd5b505afa158015610285573d6000803e3d6000fd5b505050506040513d602081101561029b57600080fd5b50519050600560ff821611156102b057600080fd5b60006102bb8261043f565b9050600160035460ff1660018111156102d057fe5b14156102e0576064600a82020490505b600160a060020a038085166000908152600460205260409020805460ff191660019081179091555461031a9116858363ffffffff6104f116565b50505050565b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a08231916024808301926020929190829003018186803b15801561038457600080fd5b505afa158015610398573d6000803e3d6000fd5b505050506040513d60208110156103ae57600080fd5b5051905060008111156103de576000546001546103de91600160a060020a0391821691168363ffffffff6104f116565b610132610590565b61013260028263ffffffff6105c716565b6000600160a060020a038216151561040e57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61013260028263ffffffff61061516565b600060ff8216151561045c575069152d02c7e14af680000061014b565b8160ff1660011415610479575069d3c21bcecceda100000061014b565b8160ff166002141561049757506a01a784379d99db4200000061014b565b8160ff16600314156104b557506a027b46536c66c8e300000061014b565b8160ff16600414156104d357506a034f086f3b33b68400000061014b565b8160ff166005141561014b57506a0422ca8b0a00a42500000061014b565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561055457600080fd5b505af1158015610568573d6000803e3d6000fd5b505050506040513d602081101561057e57600080fd5b5051151561058b57600080fd5b505050565b6000805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600160a060020a03811615156105dc57600080fd5b6105e682826103f7565b156105f057600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a038116151561062a57600080fd5b61063482826103f7565b151561063f57600080fd5b600160a060020a0316600090815260209190915260409020805460ff1916905556fea165627a7a72305820da6d23ac8f4b151242d9a9cc936a0d9469d337bb92eddce5cc529e4f80d49b290029
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
{
|
||||
"abi": [
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "terminate",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "addCoreTeam",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isCoreTeam",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "renounceCoreTeam",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "minerAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "transferToMiner",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"name": "poolType",
|
||||
"type": "uint8"
|
||||
},
|
||||
{
|
||||
"name": "tokenAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
}
|
||||
],
|
||||
"bytecode": "608060405234801561001057600080fd5b506040516040806107e88339810180604052604081101561003057600080fd5b5080516020909101516000805433600160a060020a0319918216811760a060020a60ff02191690925560018054909116600160a060020a03841617905561007f906401000000006100a3810204565b6003805483919060ff19166001838181111561009757fe5b0217905550505061014c565b6100bb6002826401000000006105c76100be82021704565b50565b600160a060020a03811615156100d357600080fd5b6100e68282640100000000610115810204565b156100f057600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a038216151561012c57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61068d8061015b6000396000f3fe608060405234801561001057600080fd5b506004361061005a5760e060020a60003504630c08bf88811461005f5780632e6b684914610069578063608d3d3d1461008f578063d43acc79146100c9578063fe4028bb146100d1575b600080fd5b6100676100f7565b005b6100676004803603602081101561007f57600080fd5b5035600160a060020a0316610115565b6100b5600480360360208110156100a557600080fd5b5035600160a060020a0316610135565b604080519115158252519081900360200190f35b610067610150565b610067600480360360208110156100e757600080fd5b5035600160a060020a0316610159565b61010033610135565b151561010b57600080fd5b610113610320565b565b61011e33610135565b151561012957600080fd5b610132816103e6565b50565b600061014860028363ffffffff6103f716565b90505b919050565b6101133361042e565b60005474010000000000000000000000000000000000000000900460ff161561018157600080fd5b61018a33610135565b151561019557600080fd5b600160a060020a03811660009081526004602052604090205460ff16156101bb57600080fd5b600081905080600160a060020a0316631777fb4b6040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156101fc57600080fd5b505afa158015610210573d6000803e3d6000fd5b505050506040513d602081101561022657600080fd5b5051151561023357600080fd5b600081600160a060020a03166380258e476040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561027157600080fd5b505afa158015610285573d6000803e3d6000fd5b505050506040513d602081101561029b57600080fd5b50519050600560ff821611156102b057600080fd5b60006102bb8261043f565b9050600160035460ff1660018111156102d057fe5b14156102e0576064600a82020490505b600160a060020a038085166000908152600460205260409020805460ff191660019081179091555461031a9116858363ffffffff6104f116565b50505050565b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a08231916024808301926020929190829003018186803b15801561038457600080fd5b505afa158015610398573d6000803e3d6000fd5b505050506040513d60208110156103ae57600080fd5b5051905060008111156103de576000546001546103de91600160a060020a0391821691168363ffffffff6104f116565b610132610590565b61013260028263ffffffff6105c716565b6000600160a060020a038216151561040e57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b61013260028263ffffffff61061516565b600060ff8216151561045c575069152d02c7e14af680000061014b565b8160ff1660011415610479575069d3c21bcecceda100000061014b565b8160ff166002141561049757506a01a784379d99db4200000061014b565b8160ff16600314156104b557506a027b46536c66c8e300000061014b565b8160ff16600414156104d357506a034f086f3b33b68400000061014b565b8160ff166005141561014b57506a0422ca8b0a00a42500000061014b565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561055457600080fd5b505af1158015610568573d6000803e3d6000fd5b505050506040513d602081101561057e57600080fd5b5051151561058b57600080fd5b505050565b6000805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600160a060020a03811615156105dc57600080fd5b6105e682826103f7565b156105f057600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a038116151561062a57600080fd5b61063482826103f7565b151561063f57600080fd5b600160a060020a0316600090815260209190915260409020805460ff1916905556fea165627a7a72305820da6d23ac8f4b151242d9a9cc936a0d9469d337bb92eddce5cc529e4f80d49b290029",
|
||||
"functionHashes": {
|
||||
"addCoreTeam(address)": "2e6b6849",
|
||||
"isCoreTeam(address)": "608d3d3d",
|
||||
"renounceCoreTeam()": "d43acc79",
|
||||
"terminate()": "0c08bf88",
|
||||
"transferToMiner(address)": "fe4028bb"
|
||||
},
|
||||
"gasEstimates": {
|
||||
"creation": {
|
||||
"codeDepositCost": "335400",
|
||||
"executionCost": "infinite",
|
||||
"totalCost": "infinite"
|
||||
},
|
||||
"external": {
|
||||
"addCoreTeam(address)": "infinite",
|
||||
"isCoreTeam(address)": "infinite",
|
||||
"renounceCoreTeam()": "infinite",
|
||||
"terminate()": "infinite",
|
||||
"transferToMiner(address)": "infinite"
|
||||
}
|
||||
}
|
||||
}
|
||||
+555
@@ -0,0 +1,555 @@
|
||||
{
|
||||
"name": "algo-token-distribution",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"ansi-regex": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
|
||||
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||
},
|
||||
"bindings": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
||||
"requires": {
|
||||
"file-uri-to-path": "1.0.0"
|
||||
}
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"camelcase": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
|
||||
"integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0="
|
||||
},
|
||||
"cliui": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz",
|
||||
"integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==",
|
||||
"requires": {
|
||||
"string-width": "^2.1.1",
|
||||
"strip-ansi": "^4.0.0",
|
||||
"wrap-ansi": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
||||
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
|
||||
},
|
||||
"command-exists": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.8.tgz",
|
||||
"integrity": "sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw=="
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"cross-spawn": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
|
||||
"integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
|
||||
"requires": {
|
||||
"lru-cache": "^4.0.1",
|
||||
"shebang-command": "^1.2.0",
|
||||
"which": "^1.2.9"
|
||||
}
|
||||
},
|
||||
"decamelize": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
|
||||
},
|
||||
"execa": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz",
|
||||
"integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=",
|
||||
"requires": {
|
||||
"cross-spawn": "^5.0.1",
|
||||
"get-stream": "^3.0.0",
|
||||
"is-stream": "^1.1.0",
|
||||
"npm-run-path": "^2.0.0",
|
||||
"p-finally": "^1.0.0",
|
||||
"signal-exit": "^3.0.0",
|
||||
"strip-eof": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
|
||||
},
|
||||
"find-up": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
|
||||
"integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
|
||||
"requires": {
|
||||
"locate-path": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "0.30.0",
|
||||
"resolved": "http://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz",
|
||||
"integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
"jsonfile": "^2.1.0",
|
||||
"klaw": "^1.0.0",
|
||||
"path-is-absolute": "^1.0.0",
|
||||
"rimraf": "^2.2.8"
|
||||
}
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
},
|
||||
"get-caller-file": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
|
||||
"integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
|
||||
},
|
||||
"get-stream": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
|
||||
"integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ="
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
|
||||
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.1.15",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz",
|
||||
"integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA=="
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"requires": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
|
||||
},
|
||||
"invert-kv": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
|
||||
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
|
||||
},
|
||||
"is-stream": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
|
||||
},
|
||||
"isexe": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
|
||||
"integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
},
|
||||
"keccak": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz",
|
||||
"integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==",
|
||||
"requires": {
|
||||
"bindings": "^1.2.1",
|
||||
"inherits": "^2.0.3",
|
||||
"nan": "^2.2.1",
|
||||
"safe-buffer": "^5.1.0"
|
||||
}
|
||||
},
|
||||
"klaw": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz",
|
||||
"integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.9"
|
||||
}
|
||||
},
|
||||
"lcid": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
|
||||
"integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
|
||||
"requires": {
|
||||
"invert-kv": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"locate-path": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
|
||||
"integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
|
||||
"requires": {
|
||||
"p-locate": "^2.0.0",
|
||||
"path-exists": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "4.1.5",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
|
||||
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
|
||||
"requires": {
|
||||
"pseudomap": "^1.0.2",
|
||||
"yallist": "^2.1.2"
|
||||
}
|
||||
},
|
||||
"mem": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz",
|
||||
"integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=",
|
||||
"requires": {
|
||||
"mimic-fn": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"memorystream": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
|
||||
"integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI="
|
||||
},
|
||||
"mimic-fn": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
|
||||
"integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"nan": {
|
||||
"version": "2.12.1",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz",
|
||||
"integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw=="
|
||||
},
|
||||
"npm-run-path": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
|
||||
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
|
||||
"requires": {
|
||||
"path-key": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
|
||||
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"openzeppelin-solidity": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-2.1.3.tgz",
|
||||
"integrity": "sha512-Zz595xw6w4ZrNU3JJJTlPd8bHFbHv5OkJlkqsM2i+NBs6CzImoHI3dZ+nmhkfR+p52cGXKmayAGbnfdCum1SMg=="
|
||||
},
|
||||
"os-locale": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz",
|
||||
"integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==",
|
||||
"requires": {
|
||||
"execa": "^0.7.0",
|
||||
"lcid": "^1.0.0",
|
||||
"mem": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
|
||||
},
|
||||
"p-finally": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
||||
"integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4="
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
|
||||
"integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
|
||||
"requires": {
|
||||
"p-try": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"p-locate": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
|
||||
"integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
|
||||
"requires": {
|
||||
"p-limit": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"p-try": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
|
||||
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M="
|
||||
},
|
||||
"path-exists": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||
},
|
||||
"path-key": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
|
||||
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A="
|
||||
},
|
||||
"pseudomap": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
|
||||
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
|
||||
},
|
||||
"require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
|
||||
},
|
||||
"require-from-string": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
|
||||
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="
|
||||
},
|
||||
"require-main-filename": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
|
||||
"integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.6.3",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
|
||||
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
|
||||
"integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg=="
|
||||
},
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
||||
},
|
||||
"shebang-command": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
|
||||
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
|
||||
"requires": {
|
||||
"shebang-regex": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"shebang-regex": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
|
||||
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM="
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
|
||||
},
|
||||
"solc": {
|
||||
"version": "0.5.4",
|
||||
"resolved": "https://registry.npmjs.org/solc/-/solc-0.5.4.tgz",
|
||||
"integrity": "sha512-Jz3yz2mct0AYzR83/jBgxDqrLXTHhYUg2G2PVJbMMt5Vu+8e3Of1Mn3nvjPw5mh46jrzt8l4fBN7vHqG5ZF0cw==",
|
||||
"requires": {
|
||||
"command-exists": "^1.2.8",
|
||||
"fs-extra": "^0.30.0",
|
||||
"keccak": "^1.0.2",
|
||||
"memorystream": "^0.3.1",
|
||||
"require-from-string": "^2.0.0",
|
||||
"semver": "^5.5.0",
|
||||
"tmp": "0.0.33",
|
||||
"yargs": "^11.0.0"
|
||||
}
|
||||
},
|
||||
"string-width": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
||||
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
|
||||
"requires": {
|
||||
"is-fullwidth-code-point": "^2.0.0",
|
||||
"strip-ansi": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
||||
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
||||
"requires": {
|
||||
"ansi-regex": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"strip-eof": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
|
||||
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8="
|
||||
},
|
||||
"tmp": {
|
||||
"version": "0.0.33",
|
||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
|
||||
"integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
|
||||
"requires": {
|
||||
"os-tmpdir": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"which": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"which-module": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
|
||||
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
|
||||
},
|
||||
"wrap-ansi": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
|
||||
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
|
||||
"requires": {
|
||||
"string-width": "^1.0.1",
|
||||
"strip-ansi": "^3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
|
||||
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
|
||||
"requires": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
||||
"requires": {
|
||||
"code-point-at": "^1.0.0",
|
||||
"is-fullwidth-code-point": "^1.0.0",
|
||||
"strip-ansi": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
||||
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
||||
"requires": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"y18n": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
|
||||
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
|
||||
},
|
||||
"yallist": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
|
||||
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
|
||||
},
|
||||
"yargs": {
|
||||
"version": "11.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz",
|
||||
"integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==",
|
||||
"requires": {
|
||||
"cliui": "^4.0.0",
|
||||
"decamelize": "^1.1.1",
|
||||
"find-up": "^2.1.0",
|
||||
"get-caller-file": "^1.0.1",
|
||||
"os-locale": "^2.0.0",
|
||||
"require-directory": "^2.1.1",
|
||||
"require-main-filename": "^1.0.1",
|
||||
"set-blocking": "^2.0.0",
|
||||
"string-width": "^2.0.0",
|
||||
"which-module": "^2.0.0",
|
||||
"y18n": "^3.2.1",
|
||||
"yargs-parser": "^9.0.2"
|
||||
}
|
||||
},
|
||||
"yargs-parser": {
|
||||
"version": "9.0.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz",
|
||||
"integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=",
|
||||
"requires": {
|
||||
"camelcase": "^4.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "algo-token-distribution",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"openzeppelin-solidity": "2.1.3",
|
||||
"solc": "0.5.4"
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
|
||||
<PackageReference Include="xunit" Version="2.3.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
|
||||
<PackageReference Include="Nethereum.Web3" Version="2.5.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\algo-erc20-token\src\AdvancedAlgos.AlgoToken.AlgoErc20Token\AdvancedAlgos.AlgoToken.AlgoErc20Token.csproj" />
|
||||
<ProjectReference Include="..\..\..\framework\src\AdvancedAlgos.AlgoToken.Framework.Ethereum.IntegrationTest\AdvancedAlgos.AlgoToken.Framework.Ethereum.IntegrationTest.csproj" />
|
||||
<ProjectReference Include="..\..\..\framework\src\AdvancedAlgos.AlgoToken.Framework.Ethereum\AdvancedAlgos.AlgoToken.Framework.Ethereum.csproj" />
|
||||
<ProjectReference Include="..\..\src\AdvancedAlgos.AlgoToken.AlgoTokenDistribution\AdvancedAlgos.AlgoToken.AlgoTokenDistribution.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
+219
@@ -0,0 +1,219 @@
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoErc20Token;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum.Exceptions;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum.IntegrationTest;
|
||||
using Nethereum.RPC.Accounts;
|
||||
using Nethereum.Web3;
|
||||
using Nethereum.Web3.Accounts;
|
||||
using Xunit;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
|
||||
{
|
||||
public class AlgoFeesTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task MinerRegistrationTest()
|
||||
{
|
||||
EthNetwork.UseDefaultTestNet();
|
||||
|
||||
var prefundedAccount = new Account(EthNetwork.Instance.PrefundedPrivateKey);
|
||||
|
||||
var tokenOwnerAccount = EthAccountFactory.Create();
|
||||
var coreTeamAccount = EthAccountFactory.Create();
|
||||
|
||||
await EthNetwork.Instance.RefillAsync(tokenOwnerAccount);
|
||||
await EthNetwork.Instance.RefillAsync(coreTeamAccount);
|
||||
|
||||
// Create the ERC20 token...
|
||||
var token = new AlgoTokenV1(EthNetwork.Instance.GetWeb3(tokenOwnerAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await token.DeployAsync();
|
||||
|
||||
// Create a fees...
|
||||
var fees1 = new AlgoFees(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await fees1.DeployAsync(token.ContractAddress);
|
||||
|
||||
// Create some miners...
|
||||
var minerAccounts = new IAccount[3];
|
||||
var referralAccounts = new IAccount[3];
|
||||
AlgoMiner[] miners = new AlgoMiner[3];
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
// Create an account for the miner and the referral...
|
||||
minerAccounts[i] = EthAccountFactory.Create();
|
||||
referralAccounts[i] = EthAccountFactory.Create();
|
||||
|
||||
// Create the miner...
|
||||
miners[i] = new AlgoMiner(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await miners[i].DeployAsync(0, 2, minerAccounts[i].Address, referralAccounts[i].Address, token.ContractAddress);
|
||||
}
|
||||
|
||||
// Register a miner...
|
||||
await fees1.RegisterMinerAsync(miners[0].ContractAddress);
|
||||
|
||||
Assert.Equal(1, await fees1.GetMinerCountAsync());
|
||||
Assert.Equal(miners[0].ContractAddress, await fees1.GetMinerByIndexAsync(0));
|
||||
|
||||
// Remove the only registered miner.
|
||||
await fees1.UnregisterMinerAsync(miners[0].ContractAddress);
|
||||
|
||||
Assert.Equal(0, await fees1.GetMinerCountAsync());
|
||||
|
||||
// Register the 3 miners and ensure they are registered...
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
await fees1.RegisterMinerAsync(miners[i].ContractAddress);
|
||||
}
|
||||
|
||||
Assert.Equal(3, await fees1.GetMinerCountAsync());
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Assert.Equal(miners[i].ContractAddress, await fees1.GetMinerByIndexAsync(i));
|
||||
}
|
||||
|
||||
// Remove the 2nd miner and check...
|
||||
await fees1.UnregisterMinerAsync(miners[1].ContractAddress);
|
||||
|
||||
Assert.Equal(2, await fees1.GetMinerCountAsync());
|
||||
Assert.Equal(miners[0].ContractAddress, await fees1.GetMinerByIndexAsync(0));
|
||||
Assert.Equal(miners[2].ContractAddress, await fees1.GetMinerByIndexAsync(1));
|
||||
|
||||
// Add the removed miner back...
|
||||
await fees1.RegisterMinerAsync(miners[1].ContractAddress);
|
||||
|
||||
Assert.Equal(3, await fees1.GetMinerCountAsync());
|
||||
Assert.Equal(miners[0].ContractAddress, await fees1.GetMinerByIndexAsync(0));
|
||||
Assert.Equal(miners[2].ContractAddress, await fees1.GetMinerByIndexAsync(1));
|
||||
Assert.Equal(miners[1].ContractAddress, await fees1.GetMinerByIndexAsync(2));
|
||||
|
||||
// Remove the latest miner...
|
||||
await fees1.UnregisterMinerAsync(miners[1].ContractAddress);
|
||||
|
||||
Assert.Equal(2, await fees1.GetMinerCountAsync());
|
||||
Assert.Equal(miners[0].ContractAddress, await fees1.GetMinerByIndexAsync(0));
|
||||
Assert.Equal(miners[2].ContractAddress, await fees1.GetMinerByIndexAsync(1));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task MineTest()
|
||||
{
|
||||
EthNetwork.UseDefaultTestNet();
|
||||
|
||||
var prefundedAccount = new Account(EthNetwork.Instance.PrefundedPrivateKey);
|
||||
|
||||
var tokenOwnerAccount = EthAccountFactory.Create();
|
||||
var systemAccount = EthAccountFactory.Create();
|
||||
var coreTeamAccount = EthAccountFactory.Create();
|
||||
|
||||
await EthNetwork.Instance.RefillAsync(tokenOwnerAccount);
|
||||
await EthNetwork.Instance.RefillAsync(systemAccount);
|
||||
await EthNetwork.Instance.RefillAsync(coreTeamAccount);
|
||||
|
||||
// Create the ERC20 token...
|
||||
var token = new AlgoTokenV1(EthNetwork.Instance.GetWeb3(tokenOwnerAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await token.DeployAsync();
|
||||
|
||||
// Create a fees...
|
||||
var fees1 = new AlgoFees(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await fees1.DeployAsync(token.ContractAddress);
|
||||
|
||||
// Register the system account...
|
||||
await fees1.AddSystemAsync(systemAccount.Address);
|
||||
|
||||
// Transfer some tokens to the fees...
|
||||
await token.TransferAsync(fees1.ContractAddress, 151.Algo());
|
||||
|
||||
// Create one miner per category...
|
||||
var minerAccounts = new IAccount[6];
|
||||
var referralAccounts = new IAccount[6];
|
||||
var miners = new AlgoMiner[6];
|
||||
|
||||
for (byte i = 0; i <= 5; i++)
|
||||
{
|
||||
// Create an account for the miner and the referral...
|
||||
minerAccounts[i] = EthAccountFactory.Create();
|
||||
referralAccounts[i] = EthAccountFactory.Create();
|
||||
await EthNetwork.Instance.RefillAsync(minerAccounts[i]);
|
||||
|
||||
// Create the miner as "NonPoolBased" so it can be activated...
|
||||
miners[i] = new AlgoMiner(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await miners[i].DeployAsync(1, i, minerAccounts[i].Address, referralAccounts[i].Address, token.ContractAddress);
|
||||
|
||||
// Activate the miner...
|
||||
await miners[i].ActivateMinerAsync();
|
||||
|
||||
// Start mining...
|
||||
{
|
||||
var miner = new AlgoMiner(miners[i].ContractAddress, EthNetwork.Instance.GetWeb3(minerAccounts[i]), EthNetwork.Instance.GasPriceProvider);
|
||||
await miner.StartMiningAsync();
|
||||
}
|
||||
|
||||
// Register a miner...
|
||||
await fees1.RegisterMinerAsync(miners[i].ContractAddress);
|
||||
}
|
||||
|
||||
// Mine the fees...
|
||||
{
|
||||
var fees = new AlgoFees(fees1.ContractAddress, EthNetwork.Instance.GetWeb3(systemAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await fees.MineAsync();
|
||||
}
|
||||
|
||||
// Ensure the miners received the payment from the fees...
|
||||
var balance0 = await token.BalanceOfAsync(minerAccounts[0].Address);
|
||||
var balance1 = await token.BalanceOfAsync(minerAccounts[1].Address);
|
||||
var balance2 = await token.BalanceOfAsync(minerAccounts[2].Address);
|
||||
var balance3 = await token.BalanceOfAsync(minerAccounts[3].Address);
|
||||
var balance4 = await token.BalanceOfAsync(minerAccounts[4].Address);
|
||||
var balance5 = await token.BalanceOfAsync(minerAccounts[5].Address);
|
||||
|
||||
Assert.Equal(1.Algo(), balance0);
|
||||
Assert.Equal(10.Algo(), balance1);
|
||||
Assert.Equal(20.Algo(), balance2);
|
||||
Assert.Equal(30.Algo(), balance3);
|
||||
Assert.Equal(40.Algo(), balance4);
|
||||
Assert.Equal(50.Algo(), balance5);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TerminateTest()
|
||||
{
|
||||
EthNetwork.UseDefaultTestNet();
|
||||
|
||||
var prefundedAccount = new Account(EthNetwork.Instance.PrefundedPrivateKey);
|
||||
|
||||
var tokenOwnerAccount = EthAccountFactory.Create();
|
||||
var coreTeamAccount = EthAccountFactory.Create();
|
||||
|
||||
await EthNetwork.Instance.RefillAsync(tokenOwnerAccount);
|
||||
await EthNetwork.Instance.RefillAsync(coreTeamAccount);
|
||||
|
||||
// Create the ERC20 token...
|
||||
var token = new AlgoTokenV1(EthNetwork.Instance.GetWeb3(tokenOwnerAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await token.DeployAsync();
|
||||
|
||||
// Store the current balance of the token owner...
|
||||
var tokenOwnerAccountBalance = await token.BalanceOfAsync(tokenOwnerAccount.Address);
|
||||
|
||||
// Create a fees...
|
||||
var fees1 = new AlgoFees(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await fees1.DeployAsync(token.ContractAddress);
|
||||
|
||||
// Transfer some tokens to the fees...
|
||||
await token.TransferAsync(fees1.ContractAddress, 100.Algo());
|
||||
|
||||
// Ensure the receiver got the tokens...
|
||||
Assert.Equal(100.Algo(), await token.BalanceOfAsync(fees1.ContractAddress));
|
||||
|
||||
// Terminate the contract.
|
||||
await fees1.TerminateAsync();
|
||||
|
||||
// Ensure the contract returned all the tokens...
|
||||
Assert.Equal(0, await token.BalanceOfAsync(fees1.ContractAddress));
|
||||
Assert.Equal(100.Algo(), await token.BalanceOfAsync(coreTeamAccount.Address));
|
||||
}
|
||||
}
|
||||
}
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoErc20Token;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum.Exceptions;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum.IntegrationTest;
|
||||
using Nethereum.Web3;
|
||||
using Nethereum.Web3.Accounts;
|
||||
using Xunit;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
|
||||
{
|
||||
public class AlgoMinerTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task PoolBasedMinerBasicWorkfloWTest()
|
||||
{
|
||||
EthNetwork.UseDefaultTestNet();
|
||||
|
||||
var prefundedAccount = new Account(EthNetwork.Instance.PrefundedPrivateKey);
|
||||
|
||||
var tokenOwnerAccount = EthAccountFactory.Create();
|
||||
var systemAccount = EthAccountFactory.Create();
|
||||
var coreTeamAccount = EthAccountFactory.Create();
|
||||
var supervisorAccount = EthAccountFactory.Create();
|
||||
var minerAccount = EthAccountFactory.Create();
|
||||
var referralAccount = EthAccountFactory.Create();
|
||||
|
||||
await EthNetwork.Instance.RefillAsync(tokenOwnerAccount);
|
||||
await EthNetwork.Instance.RefillAsync(systemAccount);
|
||||
await EthNetwork.Instance.RefillAsync(coreTeamAccount);
|
||||
await EthNetwork.Instance.RefillAsync(supervisorAccount);
|
||||
await EthNetwork.Instance.RefillAsync(minerAccount);
|
||||
|
||||
// Create the ERC20 token...
|
||||
var token = new AlgoTokenV1(EthNetwork.Instance.GetWeb3(tokenOwnerAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await token.DeployAsync();
|
||||
|
||||
// Create the pools to transfer the proper number of tokens to the miners...
|
||||
var pool1 = new AlgoPool(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await pool1.DeployAsync(0, token.ContractAddress);
|
||||
var pool2 = new AlgoPool(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await pool2.DeployAsync(1, token.ContractAddress);
|
||||
|
||||
// Transfer some tokens to the pools...
|
||||
await token.TransferAsync(pool1.ContractAddress, 100.MAlgo());
|
||||
await token.TransferAsync(pool2.ContractAddress, 100.MAlgo());
|
||||
|
||||
// Create a miner category 2...
|
||||
var miner1 = new AlgoMiner(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await miner1.DeployAsync(0, 2, minerAccount.Address, referralAccount.Address, token.ContractAddress);
|
||||
|
||||
// Add roles to the miner...
|
||||
await miner1.AddSystemAsync(systemAccount.Address);
|
||||
await miner1.AddSupervisorAsync(supervisorAccount.Address);
|
||||
|
||||
// Transfer tokens to the miner...
|
||||
await pool1.TransferToMinerAsync(miner1.ContractAddress);
|
||||
await pool2.TransferToMinerAsync(miner1.ContractAddress);
|
||||
|
||||
// Ensure the miner received the tokens according to its category 2.
|
||||
Assert.Equal(2.MAlgo() + 2.MAlgo() * 10 / 100, await token.BalanceOfAsync(miner1.ContractAddress));
|
||||
|
||||
// Activate the miner...
|
||||
await miner1.ActivateMinerAsync();
|
||||
|
||||
// Start mining...
|
||||
miner1.Bind(EthNetwork.Instance.GetWeb3(minerAccount));
|
||||
await miner1.StartMiningAsync();
|
||||
|
||||
// Mine 5 days...
|
||||
miner1.Bind(EthNetwork.Instance.GetWeb3(systemAccount));
|
||||
|
||||
var paymentPerDay = 2.MAlgo() / 2 / 365;
|
||||
BigInteger expectedMinerBalance = 0;
|
||||
BigInteger expectedReferralBalance = 0;
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
await miner1.MineAsync();
|
||||
expectedMinerBalance += paymentPerDay;
|
||||
expectedReferralBalance += paymentPerDay * 10 / 100;
|
||||
|
||||
Assert.Equal(expectedMinerBalance, await token.BalanceOfAsync(minerAccount.Address));
|
||||
Assert.Equal(expectedReferralBalance, await token.BalanceOfAsync(referralAccount.Address));
|
||||
}
|
||||
|
||||
// Pause the miner...
|
||||
miner1.Bind(EthNetwork.Instance.GetWeb3(supervisorAccount));
|
||||
await miner1.PauseMiningAsync();
|
||||
|
||||
// Try to mine one day...
|
||||
miner1.Bind(EthNetwork.Instance.GetWeb3(systemAccount));
|
||||
await Assert.ThrowsAsync<TransactionRejectedException>(
|
||||
() => miner1.MineAsync());
|
||||
|
||||
// Ensure the balance is not changed...
|
||||
Assert.Equal(expectedMinerBalance, await token.BalanceOfAsync(minerAccount.Address));
|
||||
|
||||
// Resume the miner...
|
||||
miner1.Bind(EthNetwork.Instance.GetWeb3(supervisorAccount));
|
||||
await miner1.ResumeMiningAsync();
|
||||
|
||||
// Mine one day...
|
||||
miner1.Bind(EthNetwork.Instance.GetWeb3(coreTeamAccount));
|
||||
await miner1.MineAsync();
|
||||
expectedMinerBalance += paymentPerDay;
|
||||
expectedReferralBalance += paymentPerDay * 10 / 100;
|
||||
|
||||
Assert.Equal(expectedMinerBalance, await token.BalanceOfAsync(minerAccount.Address));
|
||||
Assert.Equal(expectedReferralBalance, await token.BalanceOfAsync(referralAccount.Address));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TerminateTest()
|
||||
{
|
||||
EthNetwork.UseDefaultTestNet();
|
||||
|
||||
var prefundedAccount = new Account(EthNetwork.Instance.PrefundedPrivateKey);
|
||||
|
||||
var tokenOwnerAccount = EthAccountFactory.Create();
|
||||
var coreTeamAccount = EthAccountFactory.Create();
|
||||
var minerAccount = EthAccountFactory.Create();
|
||||
var referralAccount = EthAccountFactory.Create();
|
||||
|
||||
await EthNetwork.Instance.RefillAsync(tokenOwnerAccount);
|
||||
await EthNetwork.Instance.RefillAsync(coreTeamAccount);
|
||||
|
||||
// Create the ERC20 token...
|
||||
var token = new AlgoTokenV1(EthNetwork.Instance.GetWeb3(tokenOwnerAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await token.DeployAsync();
|
||||
|
||||
// Store the current balance of the token owner...
|
||||
var tokenOwnerAccountBalance = await token.BalanceOfAsync(tokenOwnerAccount.Address);
|
||||
|
||||
// Create a miner...
|
||||
var miner1 = new AlgoMiner(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await miner1.DeployAsync(0, 2, minerAccount.Address, referralAccount.Address, token.ContractAddress);
|
||||
|
||||
// Transfer some tokens to the miner...
|
||||
await token.TransferAsync(miner1.ContractAddress, 100.Algo());
|
||||
|
||||
// Ensure the receiver got the tokens...
|
||||
Assert.Equal(100.Algo(), await token.BalanceOfAsync(miner1.ContractAddress));
|
||||
|
||||
// Terminate the contract.
|
||||
await miner1.TerminateAsync();
|
||||
|
||||
// Ensure the contract returned all the tokens...
|
||||
Assert.Equal(0, await token.BalanceOfAsync(miner1.ContractAddress));
|
||||
Assert.Equal(100.Algo(), await token.BalanceOfAsync(coreTeamAccount.Address));
|
||||
}
|
||||
}
|
||||
}
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoErc20Token;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum.Exceptions;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum.IntegrationTest;
|
||||
using Nethereum.RPC.Accounts;
|
||||
using Nethereum.Web3;
|
||||
using Nethereum.Web3.Accounts;
|
||||
using Xunit;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests
|
||||
{
|
||||
public class AlgoPoolTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task MinerPoolTransferToMinerTest()
|
||||
{
|
||||
EthNetwork.UseDefaultTestNet();
|
||||
|
||||
var prefundedAccount = new Account(EthNetwork.Instance.PrefundedPrivateKey);
|
||||
|
||||
var tokenOwnerAccount = EthAccountFactory.Create();
|
||||
var coreTeamAccount = EthAccountFactory.Create();
|
||||
var minerAccounts = new IAccount[6];
|
||||
var referralAccounts = new IAccount[6];
|
||||
|
||||
await EthNetwork.Instance.RefillAsync(tokenOwnerAccount);
|
||||
await EthNetwork.Instance.RefillAsync(coreTeamAccount);
|
||||
|
||||
// Create the ERC20 token...
|
||||
var token = new AlgoTokenV1(EthNetwork.Instance.GetWeb3(tokenOwnerAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await token.DeployAsync();
|
||||
|
||||
// Create a pool...
|
||||
var pool1 = new AlgoPool(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await pool1.DeployAsync(0, token.ContractAddress);
|
||||
|
||||
// Transfer some tokens to the pool...
|
||||
await token.TransferAsync(pool1.ContractAddress, 100.MAlgo());
|
||||
|
||||
// Create miners for each category...
|
||||
AlgoMiner[] miners = new AlgoMiner[6];
|
||||
|
||||
for (byte i = 0; i <= 5; i++)
|
||||
{
|
||||
// Create an account for the miner and the referral...
|
||||
minerAccounts[i] = EthAccountFactory.Create();
|
||||
referralAccounts[i] = EthAccountFactory.Create();
|
||||
|
||||
// Create the miner...
|
||||
miners[i] = new AlgoMiner(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await miners[i].DeployAsync(0, i, minerAccounts[i].Address, referralAccounts[i].Address, token.ContractAddress);
|
||||
}
|
||||
|
||||
// Transfer tokens from the pool to the miners...
|
||||
for (int i = 0; i <= 5; i++)
|
||||
{
|
||||
await pool1.TransferToMinerAsync(miners[i].ContractAddress);
|
||||
}
|
||||
|
||||
// Ensure each miner received the proper amount of tokens according its category...
|
||||
Assert.Equal(100000.Algo(), await token.BalanceOfAsync(miners[0].ContractAddress));
|
||||
Assert.Equal(1.MAlgo(), await token.BalanceOfAsync(miners[1].ContractAddress));
|
||||
Assert.Equal(2.MAlgo(), await token.BalanceOfAsync(miners[2].ContractAddress));
|
||||
Assert.Equal(3.MAlgo(), await token.BalanceOfAsync(miners[3].ContractAddress));
|
||||
Assert.Equal(4.MAlgo(), await token.BalanceOfAsync(miners[4].ContractAddress));
|
||||
Assert.Equal(5.MAlgo(), await token.BalanceOfAsync(miners[5].ContractAddress));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ReferralPoolTransferToMinerTest()
|
||||
{
|
||||
EthNetwork.UseDefaultTestNet();
|
||||
|
||||
var prefundedAccount = new Account(EthNetwork.Instance.PrefundedPrivateKey);
|
||||
|
||||
var tokenOwnerAccount = EthAccountFactory.Create();
|
||||
var coreTeamAccount = EthAccountFactory.Create();
|
||||
var minerAccounts = new IAccount[6];
|
||||
var referralAccounts = new IAccount[6];
|
||||
|
||||
await EthNetwork.Instance.RefillAsync(tokenOwnerAccount);
|
||||
await EthNetwork.Instance.RefillAsync(coreTeamAccount);
|
||||
|
||||
// Create the ERC20 token...
|
||||
var token = new AlgoTokenV1(EthNetwork.Instance.GetWeb3(tokenOwnerAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await token.DeployAsync();
|
||||
|
||||
// Create a pool...
|
||||
var pool1 = new AlgoPool(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await pool1.DeployAsync(1, token.ContractAddress);
|
||||
|
||||
// Transfer some tokens to the pool...
|
||||
await token.TransferAsync(pool1.ContractAddress, 100.MAlgo());
|
||||
|
||||
// Create miners for each category...
|
||||
AlgoMiner[] miners = new AlgoMiner[6];
|
||||
|
||||
for (byte i = 0; i <= 5; i++)
|
||||
{
|
||||
// Create an account for the miner and the referral...
|
||||
minerAccounts[i] = EthAccountFactory.Create();
|
||||
referralAccounts[i] = EthAccountFactory.Create();
|
||||
|
||||
// Create the miner...
|
||||
miners[i] = new AlgoMiner(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await miners[i].DeployAsync(0, i, minerAccounts[i].Address, referralAccounts[i].Address, token.ContractAddress);
|
||||
}
|
||||
|
||||
// Transfer tokens from the pool to the miners...
|
||||
for (int i = 0; i <= 5; i++)
|
||||
{
|
||||
await pool1.TransferToMinerAsync(miners[i].ContractAddress);
|
||||
}
|
||||
|
||||
// Ensure each miner received the proper amount of tokens according its category...
|
||||
Assert.Equal(100000.Algo() * 10 / 100, await token.BalanceOfAsync(miners[0].ContractAddress));
|
||||
Assert.Equal(1.MAlgo() * 10 / 100, await token.BalanceOfAsync(miners[1].ContractAddress));
|
||||
Assert.Equal(2.MAlgo() * 10 / 100, await token.BalanceOfAsync(miners[2].ContractAddress));
|
||||
Assert.Equal(3.MAlgo() * 10 / 100, await token.BalanceOfAsync(miners[3].ContractAddress));
|
||||
Assert.Equal(4.MAlgo() * 10 / 100, await token.BalanceOfAsync(miners[4].ContractAddress));
|
||||
Assert.Equal(5.MAlgo() * 10 / 100, await token.BalanceOfAsync(miners[5].ContractAddress));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TerminateTest()
|
||||
{
|
||||
EthNetwork.UseDefaultTestNet();
|
||||
|
||||
var prefundedAccount = new Account(EthNetwork.Instance.PrefundedPrivateKey);
|
||||
|
||||
var tokenOwnerAccount = EthAccountFactory.Create();
|
||||
var coreTeamAccount = EthAccountFactory.Create();
|
||||
|
||||
await EthNetwork.Instance.RefillAsync(tokenOwnerAccount);
|
||||
await EthNetwork.Instance.RefillAsync(coreTeamAccount);
|
||||
|
||||
// Create the ERC20 token...
|
||||
var token = new AlgoTokenV1(EthNetwork.Instance.GetWeb3(tokenOwnerAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await token.DeployAsync();
|
||||
|
||||
// Store the current balance of the token owner...
|
||||
var tokenOwnerAccountBalance = await token.BalanceOfAsync(tokenOwnerAccount.Address);
|
||||
|
||||
// Create a pool...
|
||||
var pool1 = new AlgoPool(EthNetwork.Instance.GetWeb3(coreTeamAccount), EthNetwork.Instance.GasPriceProvider);
|
||||
await pool1.DeployAsync(0, token.ContractAddress);
|
||||
|
||||
// Transfer some tokens to the pool...
|
||||
await token.TransferAsync(pool1.ContractAddress, 100.Algo());
|
||||
|
||||
// Ensure the receiver got the tokens...
|
||||
Assert.Equal(100.Algo(), await token.BalanceOfAsync(pool1.ContractAddress));
|
||||
|
||||
// Terminate the contract.
|
||||
await pool1.TerminateAsync();
|
||||
|
||||
// Ensure the contract returned all the tokens...
|
||||
Assert.Equal(0, await token.BalanceOfAsync(pool1.ContractAddress));
|
||||
Assert.Equal(100.Algo(), await token.BalanceOfAsync(coreTeamAccount.Address));
|
||||
}
|
||||
}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution.Algorithms;
|
||||
using Xunit;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenDistribution.IntegrationTests.Algorithms
|
||||
{
|
||||
public class FeesDistributionAlgorithmTests
|
||||
{
|
||||
[Fact]
|
||||
public void TestDistributionAlgorithm1()
|
||||
{
|
||||
var miners = new long[] { 100, 100, 100, 100, 100, 100 };
|
||||
var fees = FeesDistributionAlgorithm.Distribute(151000, miners);
|
||||
|
||||
Assert.Equal(10, fees[0]);
|
||||
Assert.Equal(100, fees[1]);
|
||||
Assert.Equal(200, fees[2]);
|
||||
Assert.Equal(300, fees[3]);
|
||||
Assert.Equal(400, fees[4]);
|
||||
Assert.Equal(500, fees[5]);
|
||||
|
||||
Assert.Equal(151000, GetTotalAmount(miners, fees));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestDistributionAlgorithm2()
|
||||
{
|
||||
var miners = new long[] { 100, 100, 0, 100, 100, 100 };
|
||||
var fees = FeesDistributionAlgorithm.Distribute(131000, miners);
|
||||
|
||||
Assert.Equal(10, fees[0]);
|
||||
Assert.Equal(100, fees[1]);
|
||||
Assert.Equal(0, fees[2]);
|
||||
Assert.Equal(300, fees[3]);
|
||||
Assert.Equal(400, fees[4]);
|
||||
Assert.Equal(500, fees[5]);
|
||||
|
||||
Assert.Equal(131000, GetTotalAmount(miners, fees));
|
||||
}
|
||||
|
||||
private static decimal GetTotalAmount(long[] miners, decimal[] fees)
|
||||
{
|
||||
decimal totalAmount = 0;
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
totalAmount += miners[i] * fees[i];
|
||||
}
|
||||
|
||||
return totalAmount;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,418 @@
|
||||
# AlgoToken Playground
|
||||
|
||||
## Building the application
|
||||
|
||||
1. Download and install the netcore 2.1 SDK from <https://dotnet.microsoft.com/download>
|
||||
1. Build the application running the proper build script located in the `build` directory (`/labs/algo-token-playground/build`) according to your OS
|
||||
1. The compiled binaries will be located in the `release/{platform}` directory
|
||||
1. Once the application is compiled, the generated binaries do not require the netcore SDK to run. All dependencies, including the netcore runtime, are included in the generated directory.
|
||||
|
||||
## Running the application
|
||||
|
||||
* Run the application by executing proper binary file for your OS. The file name is `AdvancedAlgos.AlgoToken.AlgoTokenPlayground` plus the `.exe` extension on Windows.
|
||||
|
||||
## Using the application
|
||||
|
||||
### Environment
|
||||
|
||||
By default the application is configured to run using the following configuration:
|
||||
|
||||
* Eth Network URL: `http://127.0.0.1:8545`
|
||||
* Gas Price: `20Gwei`
|
||||
|
||||
You can check the configuration by running the command `list-env`.
|
||||
|
||||
* Use the command `set-network <url>` to change the current network.
|
||||
* Use the command `set-gasprice <value>` to change the gas price used for the transactions. The value is expected in Gweis.
|
||||
|
||||
### Using Ganache to emulate a local testnet
|
||||
|
||||
You can emulate a local testnet by installing Ganache in your machine.
|
||||
|
||||
* Download and install the Ganache application from <https://truffleframework.com/ganache>
|
||||
* Ensure you set the port to 8545, which is the default port for GETH nodes
|
||||
* Ensure you disable the setting "ERROR ON TRANSACTION FAILURE" to emulate the behavior of the GETH client
|
||||
* Ensure you disable the setting "LOCK ACCOUNTS" to avoid locking the prefunded accounts
|
||||
* If you prefer the command line version, you need to install nodejs and then you can use the scripts located in `/labs/tools/ganache-cli-setup` to install and run the application
|
||||
* The Windows version of the script expect the directory `C:\Temp` to be available for the Ganache DB
|
||||
* The Linux version of the script expect the directory `ganache-db` to be available in the current directory for the Ganache DB
|
||||
* You can change the Ganache DB directory by using the `--db` switch
|
||||
|
||||
### Managing accounts
|
||||
|
||||
#### Creating a new account
|
||||
|
||||
Use the `new-account [-n <account_name>]` command to create a new account.
|
||||
|
||||
The optional `-n` switch let you set a friendly name for the new account, later can be used as an alias for the account address when is necessary.
|
||||
|
||||
>Example: `new-account -n miner_1_account`
|
||||
|
||||
#### Importing an existing account
|
||||
|
||||
Use the command `import-account <private_key> [-n <account_name>]` to import an existing account.
|
||||
|
||||
>Example: `import-account 0936af475d2701538aad321f87e0a51f2b297634653393e8cab7290a674009a5 -n prefunded`
|
||||
|
||||
#### Selecting an account for singing transactions
|
||||
|
||||
Before executing any transaction, you need to set the account to be used for signing the transaction.
|
||||
|
||||
Use the `set-account <account>` command to set the signing account. All subsequent transactions will be signed using this account.
|
||||
|
||||
>Example: `set-account miner_1_account`
|
||||
|
||||
The `new-account` and `import-account` commands will set the current account automatically.
|
||||
|
||||
Notice that the current account name is shown in the command prompt.
|
||||
|
||||
#### Listing the accounts registered in the playground
|
||||
|
||||
The `list-accounts` command shows the list of accounts registered in the Playground.
|
||||
|
||||
>Example: `list-accounts`
|
||||
|
||||
### Ether management
|
||||
|
||||
Before using an account to sing a transaction you need to send some ethers to that account.
|
||||
|
||||
#### Transfer ethers to an account
|
||||
|
||||
Use the `eth-transfer <to> <value>` command to transfer ethers to an account:
|
||||
* `to`: the destination account address (or name if the account is registered in the playground)
|
||||
* `value`: the amount to transfer. By default this value is expected in weis, you can specify the following suffixes to use a different unit:
|
||||
* `wei`: base unit
|
||||
* `gwei`: 1000000000 weis
|
||||
* `ether` or `eth`: 1000000000000000000 weis
|
||||
* `mether` or `m`: 1000000000000000000000000 weis or 1M eth
|
||||
|
||||
>Example: `eth-transfer miner_1_account 1eth`
|
||||
|
||||
#### Getting the balance of an account
|
||||
|
||||
Use the `eth-getbalance <account>` command to get the balance of the specified account.
|
||||
|
||||
>Example: `eth-getbalance miner_1_account`
|
||||
|
||||
### Using aliases
|
||||
|
||||
The playground support aliases for account or contract addresses, in every place where an address is expected, the name given to the account or the contract can be used in place. Notice that this is an internal feature of the playground, neither accounts or contracts register this name in Ethereum.
|
||||
|
||||
Some commands allow you to specify an alias, for example when an account is created or when a contract is deployed.
|
||||
|
||||
Usually the `-n <account_name>` switch is the standard way to create an alias for an address. If you omit the switch the command will set an alias automatically.
|
||||
|
||||
Valid chars for alias identifiers are any char except reserved chars.
|
||||
|
||||
### Working with contracts
|
||||
|
||||
#### Deploying contracts
|
||||
|
||||
Ensure the current account is set before invoking a transaction (see `set-account` command).
|
||||
|
||||
Every contract provides an specific command to deploy a new instance of the contract, the pattern used by the playground is `deploy-<contract_name>`, followed by the constructor parameters if they are required by the contract. Also the `-n <account_name>` switch is avaible to create an alias for the new instance address.
|
||||
|
||||
To list the contracts created during the playground session use the command `list-contracts`.
|
||||
|
||||
#### Invoking a transactional operation
|
||||
|
||||
In order to invoke transactional operations, the pattern used is:
|
||||
|
||||
`<contract>.<operation> <parameters>`
|
||||
|
||||
Where `contract` is the contract address or an alias, the `operation` is the function you are calling, and `<parameters>` is the list of parameters required by the operation, separated by spaces.
|
||||
|
||||
String type parameters can be enclosed in double quotes, but is not mandatory, unless the string contains a reserved char.
|
||||
|
||||
#### Invoking a call function
|
||||
|
||||
The invoke syntax is the same used for transactional operations, the only difference is that the current account is not used, since the call functions do not need to be signed.
|
||||
|
||||
#### Creating an alias for an contract address
|
||||
|
||||
Use the command `register-contract <address> <name>` to create an alias for an existing contract address:
|
||||
* `address`: the address of the contract
|
||||
* `name`: the alias name for the specified contract address
|
||||
|
||||
## Algo Contracts
|
||||
|
||||
The detailed specification of the following contracts can be found in the "Smart Contracts Requirements / Specifications" document.
|
||||
|
||||
The goal of this document is to describe the commands available in the playground. For the behavior/business rules check the mentioned document.
|
||||
|
||||
### AlgoToken
|
||||
|
||||
AlgoToken is an standard ERC20 token contract. All available functions belong the ERC20 specification.
|
||||
|
||||
The following commands are supported for the `AlgoToken` contract:
|
||||
|
||||
#### deploy-algotoken
|
||||
|
||||
`deploy-algotoken [-n <contract_name>]`
|
||||
|
||||
Creates a new instance of the `AlgoToken` contract.
|
||||
|
||||
>Example: `deploy-algotoken -n token`
|
||||
|
||||
#### algotoken-transfer
|
||||
|
||||
`<contract>.algotoken-transfer <to> <value>`
|
||||
|
||||
Transfer tokens to the specified address:
|
||||
* `to`: the destination account address
|
||||
* `value`: the amount to transfer
|
||||
|
||||
*These parameters follow the same rules listed in the `eth-transfer` command.*
|
||||
|
||||
>Example: `token.algotoken-transfer dev_pool 100m`
|
||||
|
||||
#### algotoken-balanceof
|
||||
|
||||
`<contract>.algotoken-balanceof <owner>`
|
||||
|
||||
Get the balance for the specified address:
|
||||
* `owner`: the account address to check
|
||||
|
||||
>Example: `token.algotoken-balanceof dev_pool`
|
||||
|
||||
#### algotoken-pause
|
||||
|
||||
`<contract>.algotoken-pause`
|
||||
|
||||
Pauses the token. All transactions will be suspended.
|
||||
|
||||
>Example: `token.algotoken-pause`
|
||||
|
||||
#### algotoken-unpause
|
||||
|
||||
`<contract>.algotoken-unpause`
|
||||
|
||||
Unpauses the token. All transactions will be resumed.
|
||||
|
||||
>Example: `token.algotoken-unpause`
|
||||
|
||||
### AlgoPool
|
||||
|
||||
The following commands are supported for the `AlgoPool` contract:
|
||||
|
||||
#### deploy-algopool
|
||||
|
||||
`deploy-algopool <poolType> <tokenAddress> [-n <contract_name>]`
|
||||
|
||||
Creates a new instance of the `AlgoPool` contract.
|
||||
* `poolType`: the type of pool (uint8: 0 = MinerPool, 1 = ReferralPool)
|
||||
* `tokenAddress`: the address of the AlgoToken contract
|
||||
|
||||
>Example: `deploy-algopool 0 token -n dev_pool`
|
||||
|
||||
#### algopool-transfertominer
|
||||
|
||||
`<contract>.algopool-transfertominer <minerAddress>`
|
||||
|
||||
Transfer tokens from the AlgoPool balance to the AlgoMiner balance. The amount of tokens to be transfered is determined by the AlgoMiner category (see the specification document).
|
||||
* `minerAddress`: the address of the AlgoMiner contract
|
||||
|
||||
>Example: `dev_pool.algopool-transfertominer miner_1`
|
||||
|
||||
#### algopool-terminate
|
||||
|
||||
`<contract>.algopool-terminate`
|
||||
|
||||
Terminates the contract and return its balance to the creator.
|
||||
|
||||
>Example: `dev_pool.algopool-terminate`
|
||||
|
||||
### AlgoMiner
|
||||
|
||||
The following commands are supported for the `AlgoMiner` contract:
|
||||
|
||||
#### deploy-algominer
|
||||
|
||||
`deploy-algominer <minerType> <category> <minerAccountAddress> <referralAccountAddress> <tokenAddress> [-n <contract_name>]`
|
||||
|
||||
Creates a new instance of the `AlgoPool` contract.
|
||||
* `minerType`: the type of miner (uint8: 0 = PoolBased, 1 = NonPoolBased)
|
||||
* `category`: the category of miner (uint8: valid from 0 to 5)
|
||||
* `minerAccountAddress`: the address of the miner's owner
|
||||
* `referralAccountAddress`: the address of the referral
|
||||
* `tokenAddress`: the address of the AlgoToken contract
|
||||
|
||||
>Example: `deploy-algominer 0 2 miner_1_account referral_1_account token -n miner_1`
|
||||
|
||||
#### algominer-activateminer
|
||||
|
||||
`<contract>.algominer-activateminer`
|
||||
|
||||
Activates the miner.
|
||||
|
||||
>Example: `miner_1.algominer-activateminer`
|
||||
|
||||
#### algominer-deactivateminer
|
||||
|
||||
`<contract>.algominer-deactivateminer`
|
||||
|
||||
Deactivates the miner.
|
||||
|
||||
>Example: `miner_1.algominer-deactivateminer`
|
||||
|
||||
#### algominer-migrateminer
|
||||
|
||||
`<contract>.algominer-migrateminer <newMinerAddress>`
|
||||
|
||||
Transfer all tokens from this AlgoMiner another AlgoMiner. The miner must be deactivated before running this operation
|
||||
* `newMinerAddress`: the address of the new AlgoMiner contract
|
||||
|
||||
>Example: `miner_1.algominer-migrateminer miner_2`
|
||||
|
||||
#### algominer-pausemining
|
||||
|
||||
`<contract>.algominer-pausemining`
|
||||
|
||||
Pauses the miner.
|
||||
|
||||
>Example: `miner_1.algominer-pausemining`
|
||||
|
||||
#### algominer-resumemining
|
||||
|
||||
`<contract>.algominer-resumemining`
|
||||
|
||||
Resumes the miner.
|
||||
|
||||
>Example: `miner_1.algominer-resumemining`
|
||||
|
||||
#### algominer-stopandremoveownership
|
||||
|
||||
`<contract>.algominer-stopandremoveownership`
|
||||
|
||||
Sets the miner to the stopped state and remove the ownership, a new owner and referral will be assigned using the `resetMiner` operation.
|
||||
|
||||
>Example: `miner_1.algominer-stopandremoveownership`
|
||||
|
||||
#### algominer-resetminer
|
||||
|
||||
`<contract>.algominer-resetminer <newOwnerAddress> <newReferralAddress>`
|
||||
|
||||
Resets the miner.
|
||||
* `newOwnerAddress`: the address of the new owner
|
||||
* `newReferralAddress`: the address of the new referral
|
||||
|
||||
>Example: `miner_1.algominer-resetminer`
|
||||
|
||||
#### algominer-startmining
|
||||
|
||||
`<contract>.algominer-startmining`
|
||||
|
||||
Starts the miner (used by the owner).
|
||||
|
||||
>Example: `miner_1.algominer-startmining`
|
||||
|
||||
#### algominer-stopmining
|
||||
|
||||
`<contract>.algominer-stopmining`
|
||||
|
||||
Stops the miner (used by the owner).
|
||||
|
||||
>Example: `miner_1.algominer-stopmining`
|
||||
|
||||
#### algominer-mine
|
||||
|
||||
`<contract>.algominer-mine`
|
||||
|
||||
This operation is executed by the system to request a payment from the AlgoMiner to the owner. The amount to pay is computed using the rules specified in the "Smart Contracts Requirements / Specifications" document.
|
||||
|
||||
>Example: `miner_1.algominer-mine`
|
||||
|
||||
#### algominer-terminate
|
||||
|
||||
`<contract>.algominer-terminate`
|
||||
|
||||
Terminates the contract and return its balance to the creator.
|
||||
|
||||
>Example: `miner_1.algominer-terminate`
|
||||
|
||||
#### algominer-addsystem
|
||||
|
||||
`<contract>.algominer-addsystem <account>`
|
||||
|
||||
Adds the specified account to the "System" role.
|
||||
* `account`: the address of account to be added to the role.
|
||||
|
||||
>Example: `miner_1.algominer-addsystem 0x862f8938949e4A1aA82Cd427d87E4fc76940e7a1`
|
||||
|
||||
#### algominer-addcoreteam
|
||||
|
||||
`<contract>.algominer-addcoreteam <account>`
|
||||
|
||||
Adds the specified account to the "Core Team" role.
|
||||
* `account`: the address of account to be added to the role.
|
||||
|
||||
>Example: `miner_1.algominer-addcoreteam 0x862f8938949e4A1aA82Cd427d87E4fc76940e7a1`
|
||||
|
||||
#### algominer-addsupervisor
|
||||
|
||||
`<contract>.algominer-addsupervisor <account>`
|
||||
|
||||
Adds the specified account to the "Supervisor" role.
|
||||
* `account`: the address of account to be added to the role.
|
||||
|
||||
>Example: `miner_1.algominer-addsupervisor 0x862f8938949e4A1aA82Cd427d87E4fc76940e7a1`
|
||||
|
||||
### AlgoFees
|
||||
|
||||
The following commands are supported for the `AlgoFees` contract:
|
||||
|
||||
#### deploy-algofees
|
||||
|
||||
`deploy-algofees <tokenAddress> [-n <contract_name>]`
|
||||
|
||||
Creates a new instance of the `AlgoFees` contract.
|
||||
* `tokenAddress`: the address of the AlgoToken contract
|
||||
|
||||
>Example: `deploy-algofees token -n fees1`
|
||||
|
||||
#### algofees-registerminer
|
||||
|
||||
`<contract>.algofees-registerminer <minerAddress>`
|
||||
|
||||
Registers a miner with the AlgoFees.
|
||||
* `minerAddress`: the address of the AlgoMiner contract
|
||||
|
||||
>Example: `fees1.algofees-registerminer miner_0`
|
||||
|
||||
#### algofees-unregisterminer
|
||||
|
||||
`<contract>.algofees-unregisterminer <minerAddress>`
|
||||
|
||||
Unregisters a miner from the AlgoFees.
|
||||
* `minerAddress`: the address of the AlgoMiner contract
|
||||
|
||||
>Example: `fees1.algofees-unregisterminer miner_0`
|
||||
|
||||
#### algofees-mine
|
||||
|
||||
`<contract>.algofees-mine`
|
||||
|
||||
This operation is executed by the system to request a payment from the AlgoFees to registered miners. The amount to pay is computed using the rules specified in the "Smart Contracts Requirements / Specifications" document.
|
||||
|
||||
>Example: `fees1.algofees-mine`
|
||||
|
||||
#### algominer-terminate
|
||||
|
||||
`<contract>.algofees-terminate`
|
||||
|
||||
Terminates the contract and return its balance to the creator.
|
||||
|
||||
>Example: `algofees.algofees-terminate`
|
||||
|
||||
### System commands
|
||||
|
||||
#### reset
|
||||
|
||||
Resets the current playground instance, removing all aliases created.
|
||||
|
||||
>Example: `reset`
|
||||
|
||||
### Notes
|
||||
|
||||
* Reserved chars: the following chars are reserved chars and cannot be used in identifiers or strings not enclosed in quotes: "space" ":" "/" "-" "." ","
|
||||
* Commands, operations and identifiers are case insensitive
|
||||
@@ -0,0 +1,61 @@
|
||||
new-account -n miner_0_account
|
||||
new-account -n ref_0_account
|
||||
new-account -n miner_1_account
|
||||
new-account -n ref_1_account
|
||||
new-account -n miner_2_account
|
||||
new-account -n ref_2_account
|
||||
new-account -n miner_3_account
|
||||
new-account -n ref_3_account
|
||||
new-account -n miner_4_account
|
||||
new-account -n ref_4_account
|
||||
new-account -n miner_5_account
|
||||
new-account -n ref_5_account
|
||||
import-account 0936af475d2701538aad321f87e0a51f2b297634653393e8cab7290a674009a5 -n prefunded
|
||||
eth-transfer miner_0_account 1eth
|
||||
eth-transfer miner_1_account 1eth
|
||||
eth-transfer miner_2_account 1eth
|
||||
eth-transfer miner_3_account 1eth
|
||||
eth-transfer miner_4_account 1eth
|
||||
eth-transfer miner_5_account 1eth
|
||||
deploy-algotoken -n token
|
||||
deploy-algominer 1 0 miner_0_account ref_0_account token -n miner_0
|
||||
deploy-algominer 1 1 miner_1_account ref_1_account token -n miner_1
|
||||
deploy-algominer 1 2 miner_2_account ref_2_account token -n miner_2
|
||||
deploy-algominer 1 3 miner_3_account ref_3_account token -n miner_3
|
||||
deploy-algominer 1 4 miner_4_account ref_4_account token -n miner_4
|
||||
deploy-algominer 1 5 miner_5_account ref_5_account token -n miner_5
|
||||
miner_0.algominer-activateminer
|
||||
miner_1.algominer-activateminer
|
||||
miner_2.algominer-activateminer
|
||||
miner_3.algominer-activateminer
|
||||
miner_4.algominer-activateminer
|
||||
miner_5.algominer-activateminer
|
||||
set-account miner_0_account
|
||||
miner_0.algominer-startmining
|
||||
set-account miner_1_account
|
||||
miner_1.algominer-startmining
|
||||
set-account miner_2_account
|
||||
miner_2.algominer-startmining
|
||||
set-account miner_3_account
|
||||
miner_3.algominer-startmining
|
||||
set-account miner_4_account
|
||||
miner_4.algominer-startmining
|
||||
set-account miner_5_account
|
||||
miner_5.algominer-startmining
|
||||
set-account prefunded
|
||||
deploy-algofees token -n fees1
|
||||
token.algotoken-transfer fees1 151eth
|
||||
token.algotoken-balanceof fees1
|
||||
fees1.algofees-registerminer miner_0
|
||||
fees1.algofees-registerminer miner_1
|
||||
fees1.algofees-registerminer miner_2
|
||||
fees1.algofees-registerminer miner_3
|
||||
fees1.algofees-registerminer miner_4
|
||||
fees1.algofees-registerminer miner_5
|
||||
fees1.algofees-mine
|
||||
token.algotoken-balanceof miner_0_account
|
||||
token.algotoken-balanceof miner_1_account
|
||||
token.algotoken-balanceof miner_2_account
|
||||
token.algotoken-balanceof miner_3_account
|
||||
token.algotoken-balanceof miner_4_account
|
||||
token.algotoken-balanceof miner_5_account
|
||||
@@ -0,0 +1 @@
|
||||
dotnet publish ../src/AdvancedAlgos.AlgoToken.AlgoTokenPlayground/AdvancedAlgos.AlgoToken.AlgoTokenPlayground.csproj -c Release -o ../../build/release/osx-x64 --self-contained -r osx-x64
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
dotnet publish ../src/AdvancedAlgos.AlgoToken.AlgoTokenPlayground/AdvancedAlgos.AlgoToken.AlgoTokenPlayground.csproj -c Release -o ../../build/release/osx-x64 --self-contained -r osx-x64
|
||||
@@ -0,0 +1 @@
|
||||
dotnet publish ../src/AdvancedAlgos.AlgoToken.AlgoTokenPlayground/AdvancedAlgos.AlgoToken.AlgoTokenPlayground.csproj -c Release -o ../../build/release/win-x64 --self-contained -r win-x64
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
dotnet publish ../src/AdvancedAlgos.AlgoToken.AlgoTokenPlayground/AdvancedAlgos.AlgoToken.AlgoTokenPlayground.csproj -c Release -o ../../build/release/win-x64 --self-contained -r win-x64
|
||||
@@ -0,0 +1,26 @@
|
||||
new-account -n miner_1_account
|
||||
new-account -n ref_1_account
|
||||
import-account 0936af475d2701538aad321f87e0a51f2b297634653393e8cab7290a674009a5 -n prefunded
|
||||
eth-transfer miner_1_account 1eth
|
||||
eth-getbalance miner_1_account
|
||||
deploy-algotoken -n token
|
||||
deploy-algopool 0 token -n dev_pool
|
||||
deploy-algopool 1 token -n ref_pool
|
||||
token.algotoken-transfer dev_pool 100m
|
||||
token.algotoken-transfer ref_pool 100m
|
||||
token.algotoken-balanceof dev_pool
|
||||
token.algotoken-balanceof ref_pool
|
||||
deploy-algominer 0 2 miner_1_account ref_1_account token -n miner_1
|
||||
dev_pool.algopool-transfertominer miner_1
|
||||
ref_pool.algopool-transfertominer miner_1
|
||||
token.algotoken-balanceof miner_1
|
||||
miner_1.algominer-activateminer
|
||||
set-account miner_1_account
|
||||
miner_1.algominer-startmining
|
||||
set-account prefunded
|
||||
miner_1.algominer-mine
|
||||
token.algotoken-balanceof miner_1_account
|
||||
token.algotoken-balanceof ref_1_account
|
||||
miner_1.algominer-mine
|
||||
token.algotoken-balanceof miner_1_account
|
||||
token.algotoken-balanceof ref_1_account
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Nethereum.Web3" Version="2.5.1" />
|
||||
<PackageReference Include="Sprache" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\algo-erc20-token\src\AdvancedAlgos.AlgoToken.AlgoErc20Token\AdvancedAlgos.AlgoToken.AlgoErc20Token.csproj" />
|
||||
<ProjectReference Include="..\..\..\algo-token-distribution\src\AdvancedAlgos.AlgoToken.AlgoTokenDistribution\AdvancedAlgos.AlgoToken.AlgoTokenDistribution.csproj" />
|
||||
<ProjectReference Include="..\..\..\framework\src\AdvancedAlgos.AlgoToken.Framework.Ethereum\AdvancedAlgos.AlgoToken.Framework.Ethereum.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AccountManagement
|
||||
{
|
||||
public static class AccountCounter
|
||||
{
|
||||
private static long _count = 0;
|
||||
|
||||
public static long Next()
|
||||
{
|
||||
Interlocked.Increment(ref _count);
|
||||
return _count;
|
||||
}
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum;
|
||||
using Nethereum.Web3.Accounts;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AccountManagement
|
||||
{
|
||||
public class ImportAccountCommand : ICommand
|
||||
{
|
||||
private const string DEFAULT_NAME_FORMAT = "account#{0}";
|
||||
|
||||
public string Name { get; set; }
|
||||
public string PrivateKey { get; set; }
|
||||
|
||||
public Task ExecuteAsync(RuntimeContext context)
|
||||
{
|
||||
string name = string.IsNullOrWhiteSpace(Name) ?
|
||||
string.Format(CultureInfo.InvariantCulture, DEFAULT_NAME_FORMAT, AccountCounter.Next()) : Name;
|
||||
|
||||
if (context.Accounts.ContainsKey(name)) throw new Exception($"The name '{name}' already exists.");
|
||||
|
||||
var ethAccountDescriptor = new EthAccountDescriptor(name, new Account(PrivateKey));
|
||||
|
||||
context.Accounts.Add(name, ethAccountDescriptor);
|
||||
context.CurrentAccount = ethAccountDescriptor;
|
||||
|
||||
Console.WriteLine("Account imported:");
|
||||
Console.WriteLine($"- Name: '{name}'.");
|
||||
Console.WriteLine($"- Address: '{ethAccountDescriptor.Account.Address}'.");
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AccountManagement
|
||||
{
|
||||
public class ListAccountsCommand : ICommand
|
||||
{
|
||||
public Task ExecuteAsync(RuntimeContext context)
|
||||
{
|
||||
foreach (var ethAccountDescriptor in context.Accounts.Values)
|
||||
{
|
||||
Console.WriteLine($"- {ethAccountDescriptor.Name}:{ethAccountDescriptor.Account.Address}");
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using AdvancedAlgos.AlgoToken.Framework.Ethereum;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AccountManagement
|
||||
{
|
||||
public class NewAccountCommand : ICommand
|
||||
{
|
||||
private const string DEFAULT_NAME_FORMAT = "account#{0}";
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public Task ExecuteAsync(RuntimeContext context)
|
||||
{
|
||||
string name = string.IsNullOrWhiteSpace(Name) ?
|
||||
string.Format(CultureInfo.InvariantCulture, DEFAULT_NAME_FORMAT, AccountCounter.Next()) : Name;
|
||||
|
||||
if (context.Accounts.ContainsKey(name)) throw new Exception($"The name '{name}' already exists.");
|
||||
|
||||
var ethAccountDescriptor = new EthAccountDescriptor(name, EthAccountFactory.Create());
|
||||
|
||||
context.Accounts.Add(name, ethAccountDescriptor);
|
||||
context.CurrentAccount = ethAccountDescriptor;
|
||||
|
||||
Console.WriteLine("New account created:");
|
||||
Console.WriteLine($"- Name: '{name}'.");
|
||||
Console.WriteLine($"- Address: '{ethAccountDescriptor.Account.Address}'.");
|
||||
Console.WriteLine($"- Private Key: '{ethAccountDescriptor.Account.PrivateKey}'.");
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AccountManagement
|
||||
{
|
||||
public class SetAccountCommand : ICommand
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public Task ExecuteAsync(RuntimeContext context)
|
||||
{
|
||||
if (!context.Accounts.ContainsKey(Name)) throw new Exception($"Account '{Name}' not found.");
|
||||
|
||||
context.CurrentAccount = context.Accounts[Name];
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoFeesContract
|
||||
{
|
||||
public class AlgoFeesDeployCommand : DeployContractCommand
|
||||
{
|
||||
public override string DefaultName => "AlgoFees";
|
||||
|
||||
public string TokenAddress { get; set; }
|
||||
|
||||
protected override async Task<TransactionReceipt> DeployContractAsync(RuntimeContext context, Web3 web3)
|
||||
{
|
||||
var algoFees = new AlgoFees(web3, context.GasPriceProvider);
|
||||
return await algoFees.DeployAsync(context.ResolveContractReference(TokenAddress));
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoFeesContract
|
||||
{
|
||||
public class AlgoFeesMineCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoFees = new AlgoFees(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoFees.MineAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoFeesContract
|
||||
{
|
||||
public class AlgoFeesRegisterMinerCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
public string MinerAddress { get; set; }
|
||||
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoFees = new AlgoFees(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoFees.RegisterMinerAsync(context.ResolveContractReference(MinerAddress));
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoFeesContract
|
||||
{
|
||||
public class AlgoFeesTerminateCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoFees = new AlgoFees(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoFees.TerminateAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoFeesContract
|
||||
{
|
||||
public class AlgoFeesUnregisterMinerCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
public string MinerAddress { get; set; }
|
||||
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoFees = new AlgoFees(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoFees.UnregisterMinerAsync(context.ResolveContractReference(MinerAddress));
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerActivateMinerCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.ActivateMinerAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerAddCoreTeamCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
public string Account { get; set; }
|
||||
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.AddCoreTeamAsync(context.ResolveAccountReference(Account));
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerAddSupervisorCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
public string Account { get; set; }
|
||||
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.AddSupervisorAsync(context.ResolveAccountReference(Account));
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerAddSystemCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
public string Account { get; set; }
|
||||
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.AddSystemAsync(context.ResolveAccountReference(Account));
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerDeactivateMinerCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.DeactivateMinerAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerDeployCommand : DeployContractCommand
|
||||
{
|
||||
public override string DefaultName => "AlgoMiner";
|
||||
|
||||
public byte MinerType { get; set; }
|
||||
public byte Category { get; set; }
|
||||
public string MinerAccountAddress { get; set; }
|
||||
public string ReferralAccountAddress { get; set; }
|
||||
public string TokenAddress { get; set; }
|
||||
|
||||
protected override async Task<TransactionReceipt> DeployContractAsync(RuntimeContext context, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(web3, context.GasPriceProvider);
|
||||
return await algoMiner.DeployAsync(
|
||||
MinerType,
|
||||
Category,
|
||||
context.ResolveAccountReference(MinerAccountAddress),
|
||||
context.ResolveAccountReference(ReferralAccountAddress),
|
||||
context.ResolveContractReference(TokenAddress));
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerMigrateMinerCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
public string NewMinerAddress { get; set; }
|
||||
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.MigrateMinerAsync(context.ResolveContractReference(NewMinerAddress));
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerMineCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.MineAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerPauseMiningCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.PauseMiningAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerResetMinerCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
public string NewOwnerAddress { get; set; }
|
||||
public string NewReferralAddress { get; set; }
|
||||
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.ResetMinerAsync(
|
||||
context.ResolveAccountReference(NewOwnerAddress),
|
||||
context.ResolveAccountReference(NewReferralAddress));
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerResumeMiningCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.ResumeMiningAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerStartMiningCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.StartMiningAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerStopAndRemoveOwnershipCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.StopAndRemoveOwnershipAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerStopMiningCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.StopMiningAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoMinerContract
|
||||
{
|
||||
public class AlgoMinerTerminateCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoMiner = new AlgoMiner(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoMiner.TerminateAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoPoolContract
|
||||
{
|
||||
public class AlgoPoolDeployCommand : DeployContractCommand
|
||||
{
|
||||
public override string DefaultName => "AlgoPool";
|
||||
|
||||
public byte PoolType { get; set; }
|
||||
public string TokenAddress { get; set; }
|
||||
|
||||
protected override async Task<TransactionReceipt> DeployContractAsync(RuntimeContext context, Web3 web3)
|
||||
{
|
||||
var algoPool = new AlgoPool(web3, context.GasPriceProvider);
|
||||
return await algoPool.DeployAsync(PoolType, context.ResolveContractReference(TokenAddress));
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoPoolContract
|
||||
{
|
||||
public class AlgoPoolTerminateCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoPool = new AlgoPool(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoPool.TerminateAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenDistribution;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoPoolContract
|
||||
{
|
||||
public class AlgoPoolTransferToMinerCommand : EthInvokeTransactionalFunctionCommand
|
||||
{
|
||||
public string MinerAddress { get; set; }
|
||||
|
||||
protected override async Task<TransactionReceipt> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoPool = new AlgoPool(contractAddress, web3, context.GasPriceProvider);
|
||||
|
||||
return await algoPool.TransferToMinerAsync(context.ResolveContractReference(MinerAddress));
|
||||
}
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AdvancedAlgos.AlgoToken.AlgoErc20Token;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.ContractManagement;
|
||||
using AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Runtime;
|
||||
using Nethereum.RPC.Eth.DTOs;
|
||||
using Nethereum.Web3;
|
||||
|
||||
namespace AdvancedAlgos.AlgoToken.AlgoTokenPlayground.Commands.AlgoTokenContract
|
||||
{
|
||||
public class AlgoTokenBalanceOfCommand : EthInvokeCallFunctionCommand
|
||||
{
|
||||
public string OwnerAddress { get; set; }
|
||||
|
||||
protected override async Task<object> ExecuteAsync(RuntimeContext context, string contractAddress, Web3 web3)
|
||||
{
|
||||
var algoToken = new AlgoTokenV1(contractAddress, web3, context.GasPriceProvider);
|
||||
return await algoToken.BalanceOfAsync(context.ResolveAccountOrContractReference(OwnerAddress));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 153 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user