Transaction Hash:
Block:
14138768 at Feb-04-2022 09:45:49 AM +UTC
Transaction Fee:
0.003457933740944085 ETH
$6.50
Gas Used:
56,955 Gas / 60.713435887 Gwei
Emitted Events:
165 |
PrimeDeployable.Unlocked( owner=[Sender] 0x4db9c5bdbfc5b5bebc9a345297d7c786fafaf6d3, value=33415463467540574284791, periodsLeft=0 )
|
166 |
PrimeDeployable.Unlocked( owner=[Sender] 0x4db9c5bdbfc5b5bebc9a345297d7c786fafaf6d3, value=675792001183970856109531, periodsLeft=0 )
|
167 |
PrimeDeployable.Unlocked( owner=[Sender] 0x4db9c5bdbfc5b5bebc9a345297d7c786fafaf6d3, value=737245930031876138441771, periodsLeft=0 )
|
Account State Difference:
Address | Before | After | State Difference | ||
---|---|---|---|---|---|
0x1aD91ee0...dA6B45836
Miner
| (Hiveon Pool) | 9,112.299329601490592425 Eth | 9,112.299443511490592425 Eth | 0.00011391 | |
0x4Db9c5bD...6faFAF6D3 |
0.470211641392048421 Eth
Nonce: 101
|
0.466753707651104336 Eth
Nonce: 102
| 0.003457933740944085 | ||
0xdeF1da03...ec623116d |
Execution Trace
PrimeDeployable.CALL( )
{"LicenseRef-Blockwell-Smart-License.sol":{"content":"// SPDX-License-Identifier: LicenseRef-Blockwell-Smart-License\n/*\n\nBLOCKWELL SMART LICENSE\n\nEveryone is permitted to copy and distribute verbatim copies of this license\ndocument, but changing it is not allowed.\n\n\nPREAMBLE\n\nBlockwell provides a blockchain platform designed to make cryptocurrency fast,\neasy and low cost. It enables anyone to tokenize, monetize, analyze and scale\ntheir business with blockchain. Users who deploy smart contracts on\nBlockwell’s blockchain agree to do so on the terms and conditions of this\nBlockwell Smart License, unless otherwise expressly agreed in writing with\nBlockwell.\n\nThe Blockwell Smart License is an evolved version of GNU General Public\nLicense version 2. The extent of the modification is to reflect Blockwell’s\nintention to require its users to send a minting and system transfer fee to\nthe Blockwell network each time a smart contract is deployed (or token is\ncreated). These fees will then be distributed among Blockwell token holders\nand to contributors that build and support the Blockwell ecosystem.\n\nYou can create a token on the Blockwell network at:\nhttps://app.blockwell.ai/prime\n\nThe accompanying source code can be used in accordance with the terms of this\nLicense, using the following arguments, with the bracketed arguments being\ncontractually mandated by this license:\n\ntokenName, tokenSymbol, tokenDecimals, tokenSupply, founderWallet,\n[0xda0f00d92086E50099742B6bfB0230c942DdA4cC],\n[0xda0f00d92086E50099742B6bfB0230c942DdA4cC], [20], attorneyWallet,\nattorneyAndLegalEmailAddress\n\nThe precise terms and conditions for copying, distribution, deployment and\nmodification follow.\n\n\nTERMS AND CONDITIONS FOR COPYING, DISTRIBUTION, DEPLOYMENT AND MODIFICATION\n\n0. This License applies to any program or other work which contains a notice\n placed by the copyright holder saying it may be distributed under the terms\n of this License. The \"Program\", below, refers to any such program or work,\n and a \"work based on the Program\" means either the Program or any\n derivative work under copyright law: that is to say, a work containing the\n Program or a portion of it, either verbatim or with modifications and/or\n translated into another language. (Hereinafter, translation is included\n without limitation in the term \"modification\".) Each licensee is addressed\n as \"you\".\n\n Activities other than copying, distribution, deployment and modification are\n not covered by this License; they are outside its scope. The act of running\n the Program is not restricted, and the output from the Program is covered only\n if its contents constitute a work based on the Program (independent of having\n been made by running the Program). Whether that is true depends on what the\n Program does.\n\n1. You may copy and distribute verbatim copies of the Program\u0027s source code as\n you receive it, in any medium, provided that you conspicuously and\n appropriately publish on each copy an appropriate copyright notice and\n disclaimer of warranty; keep intact all the notices that refer to this\n License and to the absence of any warranty; and give any other recipients\n of the Program a copy of this License along with the Program.\n\n You may charge a fee for the physical act of transferring a copy, and you may\n at your option offer warranty protection in exchange for a fee.\n\n2. You may modify your copy or copies of the Program or any portion of it,\n thus forming a work based on the Program, and copy and distribute such\n modifications or work under the terms of Section 1 above, provided that you\n also meet all of these conditions:\n\na) You must cause the modified files to carry prominent notices stating that\n you changed the files.\n\nb) You must cause any work that you distribute or publish, that in whole or in\n part contains or is derived from the Program or any part thereof, to be\n licensed as a whole to all third parties under the terms of this License.\n\nc) You must cause Blockwell Fee Wallet\n “0xda0f00d92086E50099742B6bfB0230c942DdA4cC” to receive 2% of the total\n supply of tokens each and every any time tokens are created on the\n Blockchain network. This can be achieved using the current version of the\n source code to which this License attaches by setting the “feeAccount”\n parameter to Blockwell Fee Wallet\n “0xda0f00d92086E50099742B6bfB0230c942DdA4cC”, and the “feePercentageTenths”\n parameter to “20” when deploying.\n\nd) You must add Blockwell’s wallet\n “0xda0f00d92086E50099742B6bfB0230c942DdA4cC” as a BW Admin, and you must\n not restrict the abilities of a BW Admin in any derivative works. This can\n be achieved using the current version of the source code to which this\n License attaches by setting the “bwAdmin” parameter to Blockwell’s wallet\n “0xda0f00d92086E50099742B6bfB0230c942DdA4cC” when deploying.\n\n These requirements apply to the modified work as a whole. If identifiable\n sections of that work are not derived from the Program, and can be reasonably\n considered independent and separate works in themselves, then this License,\n and its terms, do not apply to those sections when you distribute them as\n separate works. But when you distribute the same sections as part of a whole\n which is a work based on the Program, the distribution of the whole must be on\n the terms of this License, whose permissions for other licensees extend to the\n entire whole, and thus to each and every part regardless of who wrote it.\n\n Thus, it is not the intent of this section to claim rights or contest your\n rights to work written entirely by you; rather, the intent is to exercise the\n right to control the distribution of derivative or collective works based on\n the Program.\n\n In addition, mere aggregation of another work not based on the Program with\n the Program (or with a work based on the Program) on a volume of a storage or\n distribution medium does not bring the other work under the scope of this\n License.\n\n3. You may copy and distribute the Program (or a work based on it, under\n Section 2) in object code or executable form under the terms of Sections 1\n and 2 above provided that you also make good faith and reasonable attempts\n to make available the complete corresponding machine-readable source code,\n which must be distributed under the terms of Sections 1 and 2 above.\n\n The source code for a work means the preferred form of the work for making\n modifications to it. For an executable work, complete source code means all\n the source code for all modules it contains, plus any associated interface\n definition files, plus the scripts used to control compilation and\n installation of the executable. However, as a special exception, the source\n code distributed need not include anything that is normally distributed (in\n either source or binary form) with the major components (compiler, kernel, and\n so on) of the operating system on which the executable runs, unless that\n component itself accompanies the executable.\n\n If distribution of executable or object code is made by offering access to\n copy from a designated place, then offering equivalent access to copy the\n source code from the same place counts as distribution of the source code,\n even though third parties are not compelled to copy the source along with the\n object code.\n\n Distribution and execution of executable or object code as part of existing\n smart contracts on the blockchain in the normal operation of the blockchain\n network (miners, node hosts, infrastructure providers and so on) is excepted\n from the requirement to make available the source code as set out in this\n clause.\n\n4. You may not copy, modify, sublicense, or distribute the Program except as\n expressly provided under this License. Any attempt otherwise to copy,\n modify, sublicense or distribute the Program is void, and will\n automatically terminate your rights under this License. However, parties\n who have received copies, or rights, from you under this License will not\n have their licenses terminated so long as such parties remain in full\n compliance.\n\n5. You are not required to accept this License, since you have not signed it.\n However, nothing else grants you permission to modify or distribute the\n Program or its derivative works. These actions are prohibited by law if you\n do not accept this License. Therefore, by modifying or distributing the\n Program (or any work based on the Program), you indicate your acceptance of\n this License to do so, and all its terms and conditions for copying,\n distributing or modifying the Program or works based on it.\n\n6. Each time you redistribute the Program (or any work based on the Program),\n the recipient automatically receives a license from the original licensor\n to copy, distribute or modify the Program subject to these terms and\n conditions. You may not impose any further restrictions on the recipients\u0027\n exercise of the rights granted herein. You are not responsible for\n enforcing compliance by third parties to this License.\n\n7. If, as a consequence of a court judgment or allegation of patent\n infringement or for any other reason (not limited to patent issues),\n conditions are imposed on you (whether by court order, agreement or\n otherwise) that contradict the conditions of this License, they do not\n excuse you from the conditions of this License. If you cannot distribute so\n as to satisfy simultaneously your obligations under this License and any\n other pertinent obligations, then as a consequence you may not distribute\n the Program at all. For example, if a patent license would not permit\n royalty-free redistribution of the Program by all those who receive copies\n directly or indirectly through you, then the only way you could satisfy\n both it and this License would be to refrain entirely from distribution of\n the Program.\n\n If any portion of this section is held invalid or unenforceable under any\n particular circumstance, the balance of the section is intended to apply and\n the section as a whole is intended to apply in other circumstances.\n\n It is not the purpose of this section to induce you to infringe any patents or\n other property right claims or to contest validity of any such claims; this\n section has the sole purpose of protecting the integrity of the free software\n distribution system, which is implemented by public license practices. Many\n people have made generous contributions to the wide range of software\n distributed through that system in reliance on consistent application of that\n system; it is up to the author/donor to decide if he or she is willing to\n distribute software through any other system and a licensee cannot impose that\n choice.\n\n This section is intended to make thoroughly clear what is believed to be a\n consequence of the rest of this License.\n\n8. Blockwell may publish revised and/or new versions of the Blockwell License\n from time to time. Such new versions will be similar in spirit to the\n present version, but may differ in detail to address new problems or\n concerns.\n\n\nNO WARRANTY\n\n9. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE\n LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\n OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND,\n EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE\n ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM AND YOUR USE\n OF THE SOURCE CODE INCLUDING AS TO ITS COMPLIANCE WITH ANY APPLICABLE LAW\n IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL\n NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL\n ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES\n ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT\n LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES\n SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE\n WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN\n ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n\nEND OF TERMS AND CONDITIONS\n\n*/\n\npragma solidity ^0.6.10;\n\ncontract NoContract {\n\n}\n"},"PrimeDeployable.sol":{"content":"// SPDX-License-Identifier: LicenseRef-Blockwell-Smart-License\n\n/*\n __ _\n / / ___ ____ _____(_)________ ____\n / / / _ \\/ __ \\/ ___/ / ___/ __ \\/ __ \\\n / /___/ __/ /_/ / / / / /__/ /_/ / / / /\n/_____/\\___/ .___/_/ /_/\\___/\\____/_/ /_/\n /_/\n\nL3P was born on 17th March, 2021. You can relive its first day by using this link:\n\nhttps://youtu.be/uvC-dGaUD_I\n\nLepricon is a player-owned and governed hyper-casual gaming platform with\nelements of DeFi powered by its utility token, L3P, itself controlled by this\nvery contract.\n\nWe created L3P because we believe in the inevitable merging of the gaming and\nblockchain industries, where game economies and currencies are owned and run\nby the players who play them. Check back in 2030, and you will see we were\nright.\n\nJosh Galloway - Stephen Browne - Phil Ingram\n\n*/\npragma solidity ^0.6.10;\n\nimport \"./_PrimeToken.sol\";\n\n/**\n * @dev Extended constructor for added user groups and deployment fees.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\ncontract PrimeDeployable is PrimeToken {\n constructor(\n string memory _name,\n string memory _symbol,\n uint8 _decimals,\n uint256 _totalSupply,\n address owner,\n address bwAdmin,\n address feeAccount,\n uint256 feePercentageTenths,\n address attorney,\n string memory _attorneyEmail\n ) public PrimeToken(_name, _symbol, _decimals, _totalSupply) {\n _addBwAdmin(bwAdmin);\n _addAdmin(owner);\n if (attorney != address(0x0)) {\n _addAttorney(attorney);\n }\n attorneyEmail = _attorneyEmail;\n\n // Percentage should be in tenths, so 1% would be 10\n if (feePercentageTenths \u003e 0) {\n uint256 fee = totalTokenSupply.mul(feePercentageTenths).div(1000);\n balances[owner] = totalTokenSupply.sub(fee);\n emit Transfer(address(0), owner, balances[owner]);\n\n balances[feeAccount] = fee;\n emit Transfer(address(0), feeAccount, fee);\n } else {\n balances[owner] = totalTokenSupply;\n emit Transfer(address(0), owner, totalTokenSupply);\n }\n }\n\n function init(address) internal override {\n // Skip the original init function\n }\n}\n"},"_BlockwellQuill.sol":{"content":"// SPDX-License-Identifier: LicenseRef-Blockwell-Smart-License\npragma solidity ^0.6.10;\n\n/**\n * @dev Blockwell Quill, storing arbitrary data associated with accounts.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\nlibrary BlockwellQuill {\n struct Data {\n mapping(address =\u003e bytes) data;\n }\n\n /**\n * @dev Set data on the account.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function set(\n Data storage data,\n address account,\n bytes memory value\n ) internal {\n require(account != address(0));\n data.data[account] = value;\n }\n\n /**\n * @dev Get data on the account.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function get(Data storage data, address account) internal view returns (bytes memory) {\n require(account != address(0));\n return data.data[account];\n }\n\n /**\n * @dev Convert and set string data on the account.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function setString(\n Data storage data,\n address account,\n string memory value\n ) internal {\n data.data[address(account)] = bytes(value);\n }\n\n /**\n * @dev Get and convert string data on the account.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function getString(Data storage data, address account) internal view returns (string memory) {\n return string(data.data[address(account)]);\n }\n\n /**\n * @dev Convert and set uint256 data on the account.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function setUint256(\n Data storage data,\n address account,\n uint256 value\n ) internal {\n data.data[address(account)] = abi.encodePacked(value);\n }\n\n /**\n * @dev Get and convert uint256 data on the account.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function getUint256(Data storage data, address account) internal view returns (uint256) {\n uint256 ret;\n bytes memory source = data.data[address(account)];\n assembly {\n ret := mload(add(source, 32))\n }\n return ret;\n }\n\n /**\n * @dev Convert and set address data on the account.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function setAddress(\n Data storage data,\n address account,\n address value\n ) internal {\n data.data[address(account)] = abi.encodePacked(value);\n }\n\n /**\n * @dev Get and convert address data on the account.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function getAddress(Data storage data, address account) internal view returns (address) {\n address ret;\n bytes memory source = data.data[address(account)];\n assembly {\n ret := mload(add(source, 20))\n }\n return ret;\n }\n}\n"},"_Groups.sol":{"content":"// SPDX-License-Identifier: LicenseRef-Blockwell-Smart-License\npragma solidity ^0.6.10;\n\n/**\n * @dev Unified system for arbitrary user groups.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\nlibrary Groups {\n struct MemberMap {\n mapping(address =\u003e bool) members;\n }\n\n struct GroupMap {\n mapping(uint8 =\u003e MemberMap) groups;\n }\n\n /**\n * @dev Add an account to a group\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function add(\n GroupMap storage map,\n uint8 groupId,\n address account\n ) internal {\n MemberMap storage group = map.groups[groupId];\n require(account != address(0));\n require(!groupContains(group, account));\n\n group.members[account] = true;\n }\n\n /**\n * @dev Remove an account from a group\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function remove(\n GroupMap storage map,\n uint8 groupId,\n address account\n ) internal {\n MemberMap storage group = map.groups[groupId];\n require(account != address(0));\n require(groupContains(group, account));\n\n group.members[account] = false;\n }\n\n /**\n * @dev Returns true if the account is in the group\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n * @return bool\n */\n function contains(\n GroupMap storage map,\n uint8 groupId,\n address account\n ) internal view returns (bool) {\n MemberMap storage group = map.groups[groupId];\n return groupContains(group, account);\n }\n\n function groupContains(MemberMap storage group, address account) internal view returns (bool) {\n require(account != address(0));\n return group.members[account];\n }\n}\n"},"_Pausable.sol":{"content":"// SPDX-License-Identifier: LicenseRef-Blockwell-Smart-License\npragma solidity ^0.6.10;\n\n/**\n * @dev Pausing logic that includes whether the pause was initiated by an attorney.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\ncontract Pausable {\n struct PauseState {\n bool paused;\n bool pausedByAttorney;\n }\n\n PauseState private pauseState;\n\n event Paused(address account, bool attorney);\n event Unpaused(address account);\n\n constructor() internal {\n pauseState = PauseState(false, false);\n }\n\n modifier whenNotPaused() {\n require(!pauseState.paused);\n _;\n }\n\n modifier whenPaused() {\n require(pauseState.paused);\n _;\n }\n\n function paused() public view returns (bool) {\n return pauseState.paused;\n }\n\n /**\n * @dev Check if the pause was initiated by an attorney.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function pausedByAttorney() public view returns (bool) {\n return pauseState.paused \u0026\u0026 pauseState.pausedByAttorney;\n }\n\n /**\n * @dev Internal logic for pausing the contract.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function _pause(bool attorney) internal {\n pauseState.paused = true;\n pauseState.pausedByAttorney = attorney;\n emit Paused(msg.sender, attorney);\n }\n\n /**\n * @dev Internal logic for unpausing the contract.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function _unpause() internal {\n pauseState.paused = false;\n pauseState.pausedByAttorney = false;\n emit Unpaused(msg.sender);\n }\n}\n"},"_PrimeToken.sol":{"content":"// SPDX-License-Identifier: LicenseRef-Blockwell-Smart-License\npragma solidity ^0.6.10;\n\nimport \"./_TokenGroups.sol\";\nimport \"./__SafeMath.sol\";\nimport \"./_Voting.sol\";\nimport \"./__Erc20.sol\";\nimport \"./_BlockwellQuill.sol\";\nimport \"./_Type.sol\";\n\n/**\n * Blockwell Prime Token\n */\ncontract PrimeToken is Erc20, TokenGroups, Type, Voting {\n using SafeMath for uint256;\n using BlockwellQuill for BlockwellQuill.Data;\n\n /**\n * @dev Stores data for individual token locks used by transferAndLock.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n struct Lock {\n uint256 value;\n uint64 expiration;\n uint32 periodLength;\n uint16 periods;\n }\n\n mapping(address =\u003e uint256) internal balances;\n\n mapping(address =\u003e mapping(address =\u003e uint256)) private allowed;\n\n mapping(address =\u003e Lock[]) locks;\n\n string public name;\n string public symbol;\n uint8 public decimals;\n uint256 public unlockTime;\n uint256 public transferLockTime;\n string public attorneyEmail;\n\n uint256 internal totalTokenSupply;\n\n uint256 public swapNonce;\n\n bool public suggestionsRestricted = false;\n bool public requireBalanceForVote = false;\n bool public requireBalanceForCreateSuggestion = false;\n uint256 public voteCost;\n\n BlockwellQuill.Data bwQuill1;\n BlockwellQuill.Data bwAddress1;\n\n event SetNewUnlockTime(uint256 unlockTime);\n event MultiTransferPrevented(address indexed from, address indexed to, uint256 value);\n\n event Locked(\n address indexed owner,\n uint256 value,\n uint64 expiration,\n uint32 periodLength,\n uint16 periodCount\n );\n event Unlocked(address indexed owner, uint256 value, uint16 periodsLeft);\n\n event SwapToChain(\n string toChain,\n address indexed from,\n address indexed to,\n bytes32 indexed swapId,\n uint256 value\n );\n event SwapFromChain(\n string fromChain,\n address indexed from,\n address indexed to,\n bytes32 indexed swapId,\n uint256 value\n );\n\n event BwQuillSet(uint8 indexed index, address indexed account, string value);\n event BwAddressSet(uint8 indexed index, address indexed account, address value);\n\n event Payment(address indexed from, address indexed to, uint256 value, uint256 order);\n\n constructor(\n string memory _name,\n string memory _symbol,\n uint8 _decimals,\n uint256 _totalSupply\n ) public {\n require(_totalSupply \u003e 0);\n\n name = _name;\n symbol = _symbol;\n decimals = _decimals;\n\n totalTokenSupply = _totalSupply;\n\n init(msg.sender);\n bwtype = PRIME;\n bwver = 45;\n }\n\n function init(address sender) internal virtual {\n _addBwAdmin(sender);\n _addAdmin(sender);\n\n balances[sender] = totalTokenSupply;\n emit Transfer(address(0), sender, totalTokenSupply);\n }\n\n /**\n * @dev Allow only when the contract is unlocked, or if the sender is an admin, an attorney, or whitelisted.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n modifier whenUnlocked() {\n require(\n now \u003e unlockTime || isAdmin(msg.sender) || isAttorney(msg.sender) || isWhitelisted(msg.sender)\n );\n _;\n }\n\n /**\n * @dev Set a quill 1 value for an account.\n *\n * dapp https://app.blockwell.ai/125sz0\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function setBwQuill1(address account, string memory value) public onlyAdminOrAttorney {\n bwQuill1.setString(account, value);\n emit BwQuillSet(1, account, value);\n }\n\n /**\n * @dev Get a quill 1 value for any account.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function getBwQuill1(address account) public view returns (string memory) {\n return bwQuill1.getString(account);\n }\n\n /**\n * @dev Set quill address 1 value for an account.\n *\n * dapp https://app.blockwell.ai/7rvk5o\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function setBwAddress1(address account, address value) public onlyAdminOrAttorney {\n bwAddress1.setAddress(account, value);\n emit BwAddressSet(1, account, value);\n }\n\n /**\n * @dev Get quill address 1 value for any account.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function getBwAddress1(address account) public view returns (address) {\n return bwAddress1.getAddress(account);\n }\n\n /**\n * @dev Configure how users can vote.\n *\n * dapp https://app.blockwell.ai/48ruoc\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function configureVoting(\n bool restrictSuggestions,\n bool balanceForVote,\n bool balanceForCreateSuggestion,\n uint256 cost,\n bool oneVote\n ) public onlyAdminOrAttorney {\n suggestionsRestricted = restrictSuggestions;\n requireBalanceForVote = balanceForVote;\n requireBalanceForCreateSuggestion = balanceForCreateSuggestion;\n voteCost = cost;\n oneVotePerAccount = oneVote;\n }\n\n /**\n * @dev Update the email address for this token\u0027s assigned attorney.\n *\n * dapp https://app.blockwell.ai/zsrmai\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function setAttorneyEmail(string memory email) public onlyAdminOrAttorney {\n attorneyEmail = email;\n }\n\n /**\n * @dev Pause the contract, preventing transfers.\n *\n * dapp https://app.blockwell.ai/5zdyx7\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function pause() public whenNotPaused {\n bool attorney = isAttorney(msg.sender);\n require(attorney || isAdmin(msg.sender));\n\n _pause(attorney);\n }\n\n /**\n * @dev Resume the contract.\n *\n * If the contract was originally paused by an attorney, only an attorney can resume.\n *\n * dapp https://app.blockwell.ai/5nwjwj\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function unpause() public whenPaused {\n if (!isAttorney(msg.sender)) {\n require(isAdmin(msg.sender));\n require(!pausedByAttorney());\n }\n _unpause();\n }\n\n /**\n * @dev Lock the contract if not already locked until the given time.\n *\n * dapp https://app.blockwell.ai/d4uchl\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function setUnlockTime(uint256 timestamp) public onlyAdminOrAttorney {\n unlockTime = timestamp;\n emit SetNewUnlockTime(unlockTime);\n }\n\n /**\n * @dev Total number of tokens.\n */\n function totalSupply() public view override returns (uint256) {\n return totalTokenSupply;\n }\n\n /**\n * @dev Get account balance.\n */\n function balanceOf(address account) public view override returns (uint256) {\n return balances[account];\n }\n\n /**\n * @dev Get allowance for an owner-spender pair.\n */\n function allowance(address owner, address spender) public view override returns (uint256) {\n return allowed[owner][spender];\n }\n\n /**\n * @dev Transfer tokens.\n *\n * dapp https://app.blockwell.ai/u5v1lq\n */\n function transfer(address to, uint256 value) public override whenNotPaused whenUnlocked returns (bool) {\n _transfer(msg.sender, to, value);\n return true;\n }\n\n /**\n * @dev Make multiple token transfers with one transaction.\n * @param to Array of addresses to transfer to.\n * @param value Array of amounts to be transferred.\n *\n * dapp https://app.blockwell.ai/jzjy5x\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function multiTransfer(address[] calldata to, uint256[] calldata value)\n public\n whenNotPaused\n onlyBundler\n returns (bool)\n {\n require(to.length \u003e 0);\n require(value.length == to.length);\n\n for (uint256 i = 0; i \u003c to.length; i++) {\n if (!isFrozen(to[i])) {\n _transfer(msg.sender, to[i], value[i]);\n } else {\n emit MultiTransferPrevented(msg.sender, to[i], value[i]);\n }\n }\n\n return true;\n }\n\n /**\n * @dev Approve a spender to transfer the given amount of the sender\u0027s tokens.\n *\n * dapp https://app.blockwell.ai/rftj01\n */\n function approve(address spender, uint256 value)\n public\n override\n isNotFrozen\n whenNotPaused\n whenUnlocked\n returns (bool)\n {\n require(spender != address(0));\n\n allowed[msg.sender][spender] = value;\n emit Approval(msg.sender, spender, value);\n return true;\n }\n\n /**\n * @dev Transfer tokens from an account the sender has been approved to send from.\n *\n * dapp https://app.blockwell.ai/p03b2c\n */\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) public override whenNotPaused whenUnlocked returns (bool) {\n allowed[from][msg.sender] = allowed[from][msg.sender].sub(value);\n _transfer(from, to, value);\n return true;\n }\n\n /**\n * @dev Transfer tokens from one address to multiple others.\n * @param from Address to send from.\n * @param to Array of addresses to transfer to.\n * @param value Array of amounts to be transferred.\n *\n * dapp https://app.blockwell.ai/mnxpe4\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function multiTransferFrom(\n address from,\n address[] calldata to,\n uint256[] calldata value\n ) public whenNotPaused onlyBundler returns (bool) {\n require(to.length \u003e 0);\n require(value.length == to.length);\n\n for (uint256 i = 0; i \u003c to.length; i++) {\n if (!isFrozen(to[i])) {\n allowed[from][msg.sender] = allowed[from][msg.sender].sub(value[i]);\n _transfer(from, to[i], value[i]);\n } else {\n emit MultiTransferPrevented(from, to[i], value[i]);\n }\n }\n\n return true;\n }\n\n /**\n * @dev Increase the amount of tokens a spender can transfer from the sender\u0027s account.\n *\n * dapp https://app.blockwell.ai/xr9xi3\n */\n function increaseAllowance(address spender, uint256 addedValue)\n public\n isNotFrozen\n whenNotPaused\n whenUnlocked\n returns (bool)\n {\n require(spender != address(0));\n\n allowed[msg.sender][spender] = allowed[msg.sender][spender].add(addedValue);\n emit Approval(msg.sender, spender, allowed[msg.sender][spender]);\n return true;\n }\n\n /**\n * @dev Decrease the amount of tokens a spender can transfer from the sender\u0027s account.\n *\n * dapp https://app.blockwell.ai/hnogar\n */\n function decreaseAllowance(address spender, uint256 subtractedValue)\n public\n isNotFrozen\n whenNotPaused\n whenUnlocked\n returns (bool)\n {\n require(spender != address(0));\n\n allowed[msg.sender][spender] = allowed[msg.sender][spender].sub(subtractedValue);\n emit Approval(msg.sender, spender, allowed[msg.sender][spender]);\n return true;\n }\n\n /**\n * @dev Lists all the locks for the given account as an array, with [value1, expiration1, value2, expiration2, ...]\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function locksOf(address account) public view returns (uint256[] memory) {\n Lock[] storage userLocks = locks[account];\n\n uint256[] memory lockArray = new uint256[](userLocks.length * 4);\n\n for (uint256 i = 0; i \u003c userLocks.length; i++) {\n uint256 pos = 4 * i;\n lockArray[pos] = userLocks[i].value;\n lockArray[pos + 1] = userLocks[i].expiration;\n lockArray[pos + 2] = userLocks[i].periodLength;\n lockArray[pos + 3] = userLocks[i].periods;\n }\n\n return lockArray;\n }\n\n /**\n * @dev Unlocks all expired locks.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function unlock() public returns (bool) {\n Lock[] storage list = locks[msg.sender];\n if (list.length == 0) {\n return true;\n }\n\n for (uint256 i = 0; i \u003c list.length; ) {\n Lock storage lock = list[i];\n if (lock.expiration \u003c block.timestamp) {\n // Less than 2 means it\u0027s the last period (1), or periods are not used (0)\n if (lock.periods \u003c 2) {\n emit Unlocked(msg.sender, lock.value, 0);\n\n if (i \u003c list.length - 1) {\n list[i] = list[list.length - 1];\n }\n list.pop();\n } else {\n uint256 value;\n uint256 diff = block.timestamp.sub(lock.expiration);\n uint16 periodsPassed = 1 + uint16(diff.div(lock.periodLength));\n if (periodsPassed \u003e= lock.periods) {\n periodsPassed = lock.periods;\n value = lock.value;\n emit Unlocked(msg.sender, value, 0);\n if (i \u003c list.length - 1) {\n list[i] = list[list.length - 1];\n }\n list.pop();\n } else {\n value = lock.value.div(lock.periods) * periodsPassed;\n\n lock.periods -= periodsPassed;\n lock.value = lock.value.sub(value);\n lock.expiration =\n lock.expiration +\n uint32(uint256(lock.periodLength).mul(periodsPassed));\n emit Unlocked(msg.sender, value, lock.periods);\n i++;\n }\n }\n } else {\n i++;\n }\n }\n\n return true;\n }\n\n /**\n * @dev Gets the unlocked balance of the specified address.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function unlockedBalanceOf(address account) public view returns (uint256) {\n return balances[account].sub(totalLocked(account));\n }\n\n /**\n * @dev Gets the total usable tokens for an account, including tokens that could be unlocked.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function availableBalanceOf(address account) external view returns (uint256) {\n return balances[account].sub(totalLocked(account)).add(totalUnlockable(account));\n }\n\n /**\n * @dev Transfers tokens and locks them for lockTime.\n *\n * dapp https://app.blockwell.ai/x2aiar\n * dapp https://app.blockwell.ai/x2tnj5\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function transferAndLock(\n address to,\n uint256 value,\n uint32 lockTime,\n uint32 periodLength,\n uint16 periods\n ) public returns (bool) {\n uint64 expires = uint64(block.timestamp.add(lockTime));\n Lock memory newLock = Lock(value, expires, periodLength, periods);\n locks[to].push(newLock);\n\n transfer(to, value);\n emit Locked(to, value, expires, periodLength, periods);\n\n return true;\n }\n\n /**\n * @dev Transfer and lock to multiple accounts with a single transaction.\n *\n * dapp https://app.blockwell.ai/57s696\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function multiTransferAndLock(\n address[] calldata to,\n uint256[] calldata value,\n uint32 lockTime,\n uint32 periodLength,\n uint16 periods\n ) public whenNotPaused onlyBundler returns (bool) {\n require(to.length \u003e 0);\n require(value.length == to.length);\n\n for (uint256 i = 0; i \u003c to.length; i++) {\n if (!isFrozen(to[i])) {\n transferAndLock(to[i], value[i], lockTime, periodLength, periods);\n } else {\n emit MultiTransferPrevented(msg.sender, to[i], value[i]);\n }\n }\n\n return true;\n }\n\n /**\n * @dev Gets the total amount of locked tokens in the given account.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function totalLocked(address account) public view returns (uint256) {\n uint256 total = 0;\n for (uint256 i = 0; i \u003c locks[account].length; i++) {\n total = total.add(locks[account][i].value);\n }\n\n return total;\n }\n\n /**\n * @dev Gets the amount of tokens that can currently be unlocked.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function totalUnlockable(address account) public view returns (uint256) {\n Lock[] storage userLocks = locks[account];\n uint256 total = 0;\n for (uint256 i = 0; i \u003c userLocks.length; i++) {\n Lock storage lock = userLocks[i];\n if (lock.expiration \u003c block.timestamp) {\n if (lock.periods \u003c 2) {\n total = total.add(lock.value);\n } else {\n uint256 value;\n uint256 diff = block.timestamp.sub(lock.expiration);\n uint16 periodsPassed = 1 + uint16(diff.div(lock.periodLength));\n if (periodsPassed \u003e lock.periods) {\n periodsPassed = lock.periods;\n value = lock.value;\n } else {\n value = lock.value.div(lock.periods) * periodsPassed;\n }\n\n total = total.add(value);\n }\n }\n }\n\n return total;\n }\n\n /**\n * @dev Withdraw any tokens the contract itself is holding.\n *\n * dapp https://app.blockwell.ai/0id2my\n */\n function withdrawTokens() public whenNotPaused {\n require(isAdmin(msg.sender));\n _transfer(address(this), msg.sender, balanceOf(address(this)));\n }\n\n /**\n * @dev Gets an incrementing nonce for generating swap IDs.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function getSwapNonce() internal returns (uint256) {\n return ++swapNonce;\n }\n\n /**\n * @dev Initiates a swap to another chain. Transfers the tokens to this contract and emits an event\n * indicating the request to swap.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function swapToChain(\n string memory chain,\n address to,\n uint256 value\n ) public whenNotPaused whenUnlocked {\n bytes32 swapId =\n keccak256(abi.encodePacked(getSwapNonce(), msg.sender, to, address(this), chain, value));\n\n _transfer(msg.sender, address(this), value);\n emit SwapToChain(chain, msg.sender, to, swapId, value);\n }\n\n /**\n * @dev Completes a swap from another chain, called by a swapper account.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function swapFromChain(\n string memory fromChain,\n address from,\n address to,\n bytes32 swapId,\n uint256 value\n ) public whenNotPaused onlySwapper {\n _transfer(address(this), to, value);\n\n emit SwapFromChain(fromChain, from, to, swapId, value);\n }\n\n /**\n * @dev Create a new suggestion for voting.\n *\n * dapp https://app.blockwell.ai/q9mxct\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function createSuggestion(string memory text) public {\n if (suggestionsRestricted) {\n require(isAdmin(msg.sender) || isDelegate(msg.sender));\n } else if (requireBalanceForCreateSuggestion) {\n require(balanceOf(msg.sender) \u003e 0);\n }\n _createSuggestion(text);\n }\n\n /**\n * @dev Vote on a suggestion.\n *\n * dapp https://app.blockwell.ai/0l98rj\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function vote(uint256 suggestionId, string memory comment) public {\n if (requireBalanceForVote) {\n require(balanceOf(msg.sender) \u003e 0);\n }\n\n if (voteCost \u003e 0) {\n _transfer(msg.sender, address(this), voteCost);\n }\n\n _vote(msg.sender, suggestionId, 1, comment);\n }\n\n /**\n * @dev Cast multiple votes on a suggestion.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function multiVote(\n uint256 suggestionId,\n uint256 votes,\n string memory comment\n ) public {\n require(!oneVotePerAccount);\n\n if (requireBalanceForVote) {\n require(balanceOf(msg.sender) \u003e 0);\n }\n\n if (voteCost \u003e 0) {\n _transfer(msg.sender, address(this), voteCost.mul(votes));\n }\n\n _vote(msg.sender, suggestionId, votes, comment);\n }\n\n /**\n * @dev Transfer tokens and include an order number for external reference.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function payment(\n address to,\n uint256 value,\n uint256 order\n ) public whenNotPaused whenUnlocked returns (bool) {\n _transfer(msg.sender, to, value);\n\n emit Payment(msg.sender, to, value, order);\n return true;\n }\n\n /**\n * @dev Base method for transferring tokens.\n */\n function _transfer(\n address from,\n address to,\n uint256 value\n ) internal {\n require(to != address(0));\n require(!isFrozen(from));\n require(!isFrozen(to));\n\n unlock();\n\n require(value \u003c= unlockedBalanceOf(from));\n\n balances[from] = balances[from].sub(value);\n balances[to] = balances[to].add(value);\n emit Transfer(from, to, value);\n }\n}\n"},"_TokenGroups.sol":{"content":"// SPDX-License-Identifier: LicenseRef-Blockwell-Smart-License\npragma solidity ^0.6.10;\n\nimport \"./_Pausable.sol\";\nimport \"./_Groups.sol\";\n\n/**\n * @dev User groups for Prime Token.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\ncontract TokenGroups is Pausable {\n uint8 public constant ADMIN = 1;\n uint8 public constant ATTORNEY = 2;\n uint8 public constant BUNDLER = 3;\n uint8 public constant WHITELIST = 4;\n uint8 public constant FROZEN = 5;\n uint8 public constant BW_ADMIN = 6;\n uint8 public constant SWAPPER = 7;\n uint8 public constant DELEGATE = 8;\n\n using Groups for Groups.GroupMap;\n\n Groups.GroupMap groups;\n\n event AddedToGroup(uint8 indexed groupId, address indexed account);\n event RemovedFromGroup(uint8 indexed groupId, address indexed account);\n\n event BwAddedAttorney(address indexed account);\n event BwRemovedAttorney(address indexed account);\n event BwRemovedAdmin(address indexed account);\n\n modifier onlyAdminOrAttorney() {\n require(isAdmin(msg.sender) || isAttorney(msg.sender));\n _;\n }\n\n // ATTORNEY\n\n // dapp https://app.blockwell.ai/0tezcv\n function _addAttorney(address account) internal {\n _add(ATTORNEY, account);\n }\n\n function addAttorney(address account) public whenNotPaused onlyAdminOrAttorney {\n _add(ATTORNEY, account);\n }\n\n /**\n * @dev Allows BW admins to add an attorney to the contract in emergency cases.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function bwAddAttorney(address account) public onlyBwAdmin {\n _add(ATTORNEY, account);\n emit BwAddedAttorney(account);\n }\n\n // dapp https://app.blockwell.ai/7qtyz4\n function removeAttorney(address account) public whenNotPaused onlyAdminOrAttorney {\n _remove(ATTORNEY, account);\n }\n\n /**\n * @dev Allows BW admins to remove an attorney from the contract in emergency cases.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function bwRemoveAttorney(address account) public onlyBwAdmin {\n _remove(ATTORNEY, account);\n emit BwRemovedAttorney(account);\n }\n\n function isAttorney(address account) public view returns (bool) {\n return _contains(ATTORNEY, account);\n }\n\n // ADMIN\n\n function _addAdmin(address account) internal {\n _add(ADMIN, account);\n }\n\n // dapp https://app.blockwell.ai/mtzj2e\n function addAdmin(address account) public whenNotPaused onlyAdminOrAttorney {\n _addAdmin(account);\n }\n\n // dapp https://app.blockwell.ai/40pc9e\n function removeAdmin(address account) public whenNotPaused onlyAdminOrAttorney {\n _remove(ADMIN, account);\n }\n\n /**\n * @dev Allows BW admins to remove an admin from the contract in emergency cases.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function bwRemoveAdmin(address account) public onlyBwAdmin {\n _remove(ADMIN, account);\n emit BwRemovedAdmin(account);\n }\n\n function isAdmin(address account) public view returns (bool) {\n return _contains(ADMIN, account);\n }\n\n // BUNDLER\n\n // dapp https://app.blockwell.ai/i8sxu0\n function addBundler(address account) public onlyAdminOrAttorney {\n _add(BUNDLER, account);\n }\n\n // dapp https://app.blockwell.ai/z72enu\n function removeBundler(address account) public onlyAdminOrAttorney {\n _remove(BUNDLER, account);\n }\n\n function isBundler(address account) public view returns (bool) {\n return _contains(BUNDLER, account);\n }\n\n modifier onlyBundler() {\n require(isBundler(msg.sender));\n _;\n }\n\n // SWAPPER\n\n // dapp https://app.blockwell.ai/amcwpf\n function addSwapper(address account) public onlyAdminOrAttorney {\n _addSwapper(account);\n }\n\n function _addSwapper(address account) internal {\n _add(SWAPPER, account);\n }\n\n function removeSwapper(address account) public onlyAdminOrAttorney {\n _remove(SWAPPER, account);\n }\n\n function isSwapper(address account) public view returns (bool) {\n return _contains(SWAPPER, account);\n }\n\n modifier onlySwapper() {\n require(isSwapper(msg.sender));\n _;\n }\n\n // WHITELIST\n\n // dapp https://app.blockwell.ai/y4c4n2\n function addToWhitelist(address account) public onlyAdminOrAttorney {\n _add(WHITELIST, account);\n }\n\n // dapp https://app.blockwell.ai/n4408a\n function removeFromWhitelist(address account) public onlyAdminOrAttorney {\n _remove(WHITELIST, account);\n }\n\n function isWhitelisted(address account) public view returns (bool) {\n return _contains(WHITELIST, account);\n }\n\n // BW_ADMIN\n\n function _addBwAdmin(address account) internal {\n _add(BW_ADMIN, account);\n }\n\n function addBwAdmin(address account) public onlyBwAdmin {\n _addBwAdmin(account);\n }\n\n function renounceBwAdmin() public {\n _remove(BW_ADMIN, msg.sender);\n }\n\n function isBwAdmin(address account) public view returns (bool) {\n return _contains(BW_ADMIN, account);\n }\n\n modifier onlyBwAdmin() {\n require(isBwAdmin(msg.sender));\n _;\n }\n\n // FROZEN\n\n function _freeze(address account) internal {\n _add(FROZEN, account);\n }\n\n // dapp https://app.blockwell.ai/0ldfpw\n function freeze(address account) public onlyAdminOrAttorney {\n _freeze(account);\n }\n\n function _unfreeze(address account) internal {\n _remove(FROZEN, account);\n }\n\n // dapp https://app.blockwell.ai/qcwqg6\n function unfreeze(address account) public onlyAdminOrAttorney {\n _unfreeze(account);\n }\n\n /**\n * @dev Freeze multiple accounts with a single transaction.\n *\n * dapp https://app.blockwell.ai/t0rw3c\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function multiFreeze(address[] calldata account) public onlyAdminOrAttorney {\n require(account.length \u003e 0);\n\n for (uint256 i = 0; i \u003c account.length; i++) {\n _freeze(account[i]);\n }\n }\n\n /**\n * @dev Unfreeze multiple accounts with a single transaction.\n *\n * dapp https://app.blockwell.ai/7updhm\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function multiUnfreeze(address[] calldata account) public onlyAdminOrAttorney {\n require(account.length \u003e 0);\n\n for (uint256 i = 0; i \u003c account.length; i++) {\n _unfreeze(account[i]);\n }\n }\n\n function isFrozen(address account) public view returns (bool) {\n return _contains(FROZEN, account);\n }\n\n modifier isNotFrozen() {\n require(!isFrozen(msg.sender));\n _;\n }\n\n // DELEGATE\n\n // dapp https://app.blockwell.ai/cpyysz\n function addDelegate(address account) public onlyAdminOrAttorney {\n _add(DELEGATE, account);\n }\n\n // dapp https://app.blockwell.ai/a0j2al\n function removeDelegate(address account) public onlyAdminOrAttorney {\n _remove(DELEGATE, account);\n }\n\n function isDelegate(address account) public view returns (bool) {\n return _contains(DELEGATE, account);\n }\n\n // Internal functions\n\n function _add(uint8 groupId, address account) internal {\n groups.add(groupId, account);\n emit AddedToGroup(groupId, account);\n }\n\n function _remove(uint8 groupId, address account) internal {\n groups.remove(groupId, account);\n emit RemovedFromGroup(groupId, account);\n }\n\n function _contains(uint8 groupId, address account) internal view returns (bool) {\n return groups.contains(groupId, account);\n }\n}\n"},"_Type.sol":{"content":"// SPDX-License-Identifier: LicenseRef-Blockwell-Smart-License\npragma solidity \u003e=0.4.25;\n\n/**\n * @dev Contract type mapping.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\ncontract Type {\n uint256 constant PRIME = 1;\n\n uint256 public bwtype;\n uint256 public bwver;\n}\n"},"_Voting.sol":{"content":"// SPDX-License-Identifier: LicenseRef-Blockwell-Smart-License\npragma solidity ^0.6.10;\n\nimport \"./__SafeMath.sol\";\n\n/**\n * @dev Suggestions and Voting for token-holders.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\ncontract Voting {\n using SafeMath for uint256;\n\n struct Suggestion {\n uint256 votes;\n bool created;\n address creator;\n string text;\n }\n\n // This stores how many votes a user has cast on a suggestion\n mapping(uint256 =\u003e mapping(address =\u003e uint256)) private voted;\n\n // This map stores the suggestions, and they\u0027re retrieved using their ID number\n mapping(uint256 =\u003e Suggestion) internal suggestions;\n\n // This keeps track of the number of suggestions in the system\n uint256 public suggestionCount;\n\n // If true, a wallet can only vote on a suggestion once\n bool public oneVotePerAccount = true;\n\n event SuggestionCreated(uint256 suggestionId, string text);\n event Votes(\n address voter,\n uint256 indexed suggestionId,\n uint256 votes,\n uint256 totalVotes,\n string comment\n );\n\n /**\n * @dev Gets the number of votes a suggestion has received.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function getVotes(uint256 suggestionId) public view returns (uint256) {\n return suggestions[suggestionId].votes;\n }\n\n /**\n * @dev Gets the number of votes for every suggestion in the contract.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function getAllVotes() public view returns (uint256[] memory) {\n uint256[] memory votes = new uint256[](suggestionCount);\n\n for (uint256 i = 0; i \u003c suggestionCount; i++) {\n votes[i] = suggestions[i].votes;\n }\n\n return votes;\n }\n\n /**\n * @dev Gets the text of a suggestion.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function getSuggestionText(uint256 suggestionId) public view returns (string memory) {\n return suggestions[suggestionId].text;\n }\n\n /**\n * @dev Gets whether or not an account has voted for a suggestion.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function hasVoted(address account, uint256 suggestionId) public view returns (bool) {\n return voted[suggestionId][account] \u003e 0;\n }\n\n /**\n * @dev Gets the number of votes an account has cast towards a suggestion.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function getAccountVotes(address account, uint256 suggestionId) public view returns (uint256) {\n return voted[suggestionId][account];\n }\n\n /**\n * @dev Gets the creator of a suggestion.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function getSuggestionCreator(uint256 suggestionId) public view returns (address) {\n return suggestions[suggestionId].creator;\n }\n\n /**\n * @dev Gets the creator for every suggestion in the contract.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function getAllSuggestionCreators() public view returns (address[] memory) {\n address[] memory creators = new address[](suggestionCount);\n\n for (uint256 i = 0; i \u003c suggestionCount; i++) {\n creators[i] = suggestions[i].creator;\n }\n\n return creators;\n }\n\n /**\n * @dev Internal logic for creating a suggestion.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function _createSuggestion(string memory text) internal {\n // The ID is just based on the suggestion count, so the IDs go 0, 1, 2, etc.\n uint256 suggestionId = suggestionCount++;\n\n // Starts at 0 votes\n suggestions[suggestionId] = Suggestion(0, true, msg.sender, text);\n\n emit SuggestionCreated(suggestionId, text);\n }\n\n /**\n * @dev Internal logic for voting.\n *\n * Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)\n */\n function _vote(\n address account,\n uint256 suggestionId,\n uint256 votes,\n string memory comment\n ) internal returns (uint256) {\n if (oneVotePerAccount) {\n require(!hasVoted(account, suggestionId));\n require(votes == 1);\n }\n Suggestion storage sugg = suggestions[suggestionId];\n require(sugg.created);\n\n voted[suggestionId][account] = voted[suggestionId][account].add(votes);\n sugg.votes = sugg.votes.add(votes);\n\n emit Votes(account, suggestionId, votes, sugg.votes, comment);\n\n return sugg.votes;\n }\n}\n"},"__Erc20.sol":{"content":"// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.6.10;\n\ninterface Erc20 {\n function totalSupply() external view returns (uint256);\n\n function balanceOf(address who) external view returns (uint256);\n\n function transfer(address to, uint256 value) external returns (bool);\n\n function allowance(address owner, address spender) external view returns (uint256);\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool);\n\n function approve(address spender, uint256 value) external returns (bool);\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"},"__SafeMath.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.6.10;\n\n/**\n * @title SafeMath\n * @dev Math operations with safety checks that revert on error\n *\n * Originally from https://github.com/OpenZeppelin/openzeppelin-contracts\n * Copyright (c) 2016-2020 zOS Global Limited\n */\nlibrary SafeMath {\n /**\n * @dev Multiplies two numbers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring \u0027a\u0027 not being zero, but the\n // benefit is lost if \u0027b\u0027 is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Integer division of two numbers truncating the quotient, reverts on division by zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n // Solidity only automatically asserts when dividing by 0\n require(b \u003e 0);\n uint256 c = a / b;\n // assert(a == b * c + a % b); // There is no case in which this doesn\u0027t hold\n\n return c;\n }\n\n /**\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b \u003c= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two numbers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c \u003e= a);\n\n return c;\n }\n\n /**\n * @dev Divides two numbers and returns the remainder (unsigned integer modulo),\n * reverts when dividing by zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b != 0);\n return a % b;\n }\n}\n"}}