BscScan Contracts API

The Contracts API from BscScan — 5 operation(s) for contracts.

OpenAPI Specification

bscscan-contracts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: BscScan Accounts Contracts API
  version: 1.0.0
  description: BscScan is the leading block explorer and analytics platform for BNB Smart Chain (BSC), providing a REST API for querying transactions, token transfers, smart contract ABIs, gas prices, BEP-20 token information, and on-chain statistics. API subscriptions are unified under the Etherscan V2 platform, enabling access to 60+ EVM chains via a single API key using the chainid parameter (BSC chainid=56).
  license:
    name: UNLICENSED
    url: https://docs.bscscan.com/
servers:
- url: https://api.bscscan.com/v2/api
  description: BscScan BNB Smart Chain Mainnet (Etherscan V2, chainid=56)
- url: https://api-testnet.bscscan.com/api
  description: BscScan BNB Smart Chain Testnet
security:
- apiKeyAuth: []
tags:
- name: Contracts
paths:
  /?module=contract&action=getabi:
    get:
      operationId: get-contract-abi-for-verified-contract-source-codes
      externalDocs:
        url: https://docs.bscscan.com/api-endpoints/contracts#get-contract-abi-for-verified-contract-source-codes
      summary: Get Contract ABI for Verified Contract Source Codes
      description: Returns the Contract Application Binary Interface ( ABI ) of a verified smart contract. Find verified contracts ✅on our Verified Contracts Source Code page.
      tags:
      - Contracts
      parameters:
      - in: query
        name: address
        schema:
          $ref: '#/components/schemas/AddressHash'
        required: true
        example: '0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413'
      responses:
        '200':
          description: Operation result.
          content:
            application/json:
              schema:
                oneOf:
                - allOf:
                  - $ref: '#/components/schemas/ResponseOK'
                  - $ref: '#/components/schemas/Result.contract.getabi'
                - $ref: '#/components/schemas/ResponseNOTOK'
              example:
                status: '1'
                message: OK
                result: '[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"proposals","outputs":[{"name":"recipient","type":"address"},{"name":"amount","type":"uint256"},{"name":"description","type":"string"},{"name":"votingDeadline","type":"uint256"},{"name":"open","type":"bool"},{"name":"proposalPassed","type":"bool"},{"name":"proposalHash","type":"bytes32"},{"name":"proposalDeposit","type":"uint256"},{"name":"newCurator","type":"bool"},{"name":"yea","type":"uint256"},{"name":"nay","type":"uint256"},{"name":"creator","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_amount","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"minTokensToCreate","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"rewardAccount","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"daoCreator","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"divisor","outputs":[{"name":"divisor","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"extraBalance","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_proposalID","type":"uint256"},{"name":"_transactionData","type":"bytes"}],"name":"executeProposal","outputs":[{"name":"_success","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":false,"inputs":[],"name":"unblockMe","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"totalRewardToken","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"actualBalance","outputs":[{"name":"_actualBalance","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"closingTime","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"allowedRecipients","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferWithoutReward","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":false,"inputs":[],"name":"refund","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_recipient","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_description","type":"string"},{"name":"_transactionData","type":"bytes"},{"name":"_debatingPeriod","type":"uint256"},{"name":"_newCurator","type":"bool"}],"name":"newProposal","outputs":[{"name":"_proposalID","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"DAOpaidOut","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"minQuorumDivisor","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_newContract","type":"address"}],"name":"newContract","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_recipient","type":"address"},{"name":"_allowed","type":"bool"}],"name":"changeAllowedRecipients","outputs":[{"name":"_success","type":"bool"}],"type":"function"},{"constant":false,"inputs":[],"name":"halveMinQuorum","outputs":[{"name":"_success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"paidOut","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_proposalID","type":"uint256"},{"name":"_newCurator","type":"address"}],"name":"splitDAO","outputs":[{"name":"_success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"DAOrewardAccount","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"proposalDeposit","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"numberOfProposals","outputs":[{"name":"_numberOfProposals","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"lastTimeMinQuorumMet","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_toMembers","type":"bool"}],"name":"retrieveDAOReward","outputs":[{"name":"_success","type":"bool"}],"type":"function"},{"constant":false,"inputs":[],"name":"receiveEther","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"isFueled","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_tokenHolder","type":"address"}],"name":"createTokenProxy","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_proposalID","type":"uint256"}],"name":"getNewDAOAddress","outputs":[{"name":"_newDAO","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_proposalID","type":"uint256"},{"name":"_supportsProposal","type":"bool"}],"name":"vote","outputs":[{"name":"_voteID","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[],"name":"getMyReward","outputs":[{"name":"_success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"rewardToken","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFromWithoutReward","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_proposalDeposit","type":"uint256"}],"name":"changeProposalDeposit","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"blocked","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"curator","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[{"name":"_proposalID","type":"uint256"},{"name":"_recipient","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_transactionData","type":"bytes"}],"name":"checkProposalCode","outputs":[{"name":"_codeChecksOut","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"privateCreation","outputs":[{"name":"","type":"address"}],"type":"function"},{"inputs":[{"name":"_curator","type":"address"},{"name":"_daoCreator","type":"address"},{"name":"_proposalDeposit","type":"uint256"},{"name":"_minTokensToCreate","type":"uint256"},{"name":"_closingTime","type":"uint256"},{"name":"_privateCreation","type":"address"}],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"value","type":"uint256"}],"name":"FuelingToDate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"CreatedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Refund","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"proposalID","type":"uint256"},{"indexed":false,"name":"recipient","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"newCurator","type":"bool"},{"indexed":false,"name":"description","type":"string"}],"name":"ProposalAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"proposalID","type":"uint256"},{"indexed":false,"name":"position","type":"bool"},{"indexed":true,"name":"voter","type":"address"}],"name":"Voted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"proposalID","type":"uint256"},{"indexed":false,"name":"result","type":"bool"},{"indexed":false,"name":"quorum","type":"uint256"}],"name":"ProposalTallied","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_newCurator","type":"address"}],"name":"NewCurator","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_recipient","type":"address"},{"indexed":false,"name":"_allowed","type":"bool"}],"name":"AllowedRecipientChanged","type":"event"}]'
  /?module=contract&action=getsourcecode:
    get:
      operationId: get-contract-source-code-for-verified-contract-source-codes
      externalDocs:
        url: https://docs.bscscan.com/api-endpoints/contracts#get-contract-source-code-for-verified-contract-source-codes
      summary: Get Contract Source Code for Verified Contract Source Codes
      description: 'Returns the Solidity source code of a verified smart contract. 📩 Tip : You can also download a CSV list of verified contracts addresses of which the code publishers have provided a corresponding Open Source license for redistribution.'
      tags:
      - Contracts
      parameters:
      - in: query
        name: address
        schema:
          $ref: '#/components/schemas/AddressHash'
        required: true
        example: '0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413'
      responses:
        '200':
          description: Operation result.
          content:
            application/json:
              schema:
                oneOf:
                - allOf:
                  - $ref: '#/components/schemas/ResponseOK'
                  - $ref: '#/components/schemas/ResultArrayOfObjects'
                - $ref: '#/components/schemas/ResponseNOTOK'
              example:
                status: '1'
                message: OK
                result:
                - SourceCode: "/*\n\n- Bytecode Verification performed was compared on second iteration -\n\nThis file is part of the DAO.\n\nThe DAO is free software: you can redistribute it and/or modify\nit under the terms of the GNU lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThe DAO is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU lesser General Public License for more details.\n\nYou should have received a copy of the GNU lesser General Public License\nalong with the DAO. If not, see <http://www.gnu.org/licenses/>.\n*/\n\n\n/*\nBasic, standardized Token contract with no \"premine\". Defines the functions to\ncheck token balances, send tokens, send tokens on behalf of a 3rd party and the\ncorresponding approval process. Tokens need to be created by a derived\ncontract (e.g. TokenCreation.sol).\n\nThank you ConsenSys, this contract originated from:\nhttps://github.com/ConsenSys/Tokens/blob/master/Token_Contracts/contracts/Standard_Token.sol\nWhich is itself based on the Ethereum standardized contract APIs:\nhttps://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs\n*/\n\n/// @title Standard Token Contract.\n\ncontract TokenInterface {\n mapping (address => uint256) balances;\n mapping (address => mapping (address => uint256)) allowed;\n\n /// Total amount of tokens\n uint256 public totalSupply;\n\n /// @param _owner The address from which the balance will be retrieved\n /// @return The balance\n function balanceOf(address _owner) constant returns (uint256 balance);\n\n /// @notice Send `_amount` tokens to `_to` from `msg.sender`\n /// @param _to The address of the recipient\n /// @param _amount The amount of tokens to be transferred\n /// @return Whether the transfer was successful or not\n function transfer(address _to, uint256 _amount) returns (bool success);\n\n /// @notice Send `_amount` tokens to `_to` from `_from` on the condition it\n /// is approved by `_from`\n /// @param _from The address of the origin of the transfer\n /// @param _to The address of the recipient\n /// @param _amount The amount of tokens to be transferred\n /// @return Whether the transfer was successful or not\n function transferFrom(address _from, address _to, uint256 _amount) returns (bool success);\n\n /// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on\n /// its behalf\n /// @param _spender The address of the account able to transfer the tokens\n /// @param _amount The amount of tokens to be approved for transfer\n /// @return Whether the approval was successful or not\n function approve(address _spender, uint256 _amount) returns (bool success);\n\n /// @param _owner The address of the account owning tokens\n /// @param _spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens of _owner that _spender is allowed\n /// to spend\n function allowance(\n address _owner,\n address _spender\n ) constant returns (uint256 remaining);\n\n event Transfer(address indexed _from, address indexed _to, uint256 _amount);\n event Approval(\n address indexed _owner,\n address indexed _spender,\n uint256 _amount\n );\n}\n\n\ncontract Token is TokenInterface {\n // Protects users by preventing the execution of method calls that\n // inadvertently also transferred ether\n modifier noEther() {if (msg.value > 0) throw; _}\n\n function balanceOf(address _owner) constant returns (uint256 balance) {\n return balances[_owner];\n }\n\n function transfer(address _to, uint256 _amount) noEther returns (bool success) {\n if (balances[msg.sender] >= _amount && _amount > 0) {\n balances[msg.sender] -= _amount;\n balances[_to] += _amount;\n Transfer(msg.sender, _to, _amount);\n return true;\n } else {\n return false;\n }\n }\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _amount\n ) noEther returns (bool success) {\n\n if (balances[_from] >= _amount\n && allowed[_from][msg.sender] >= _amount\n && _amount > 0) {\n\n balances[_to] += _amount;\n balances[_from] -= _amount;\n allowed[_from][msg.sender] -= _amount;\n Transfer(_from, _to, _amount);\n return true;\n } else {\n return false;\n }\n }\n\n function approve(address _spender, uint256 _amount) returns (bool success) {\n allowed[msg.sender][_spender] = _amount;\n Approval(msg.sender, _spender, _amount);\n return true;\n }\n\n function allowance(address _owner, address _spender) constant returns (uint256 remaining) {\n return allowed[_owner][_spender];\n }\n}\n\n\n/*\nThis file is part of the DAO.\n\nThe DAO is free software: you can redistribute it and/or modify\nit under the terms of the GNU lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThe DAO is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU lesser General Public License for more details.\n\nYou should have received a copy of the GNU lesser General Public License\nalong with the DAO. If not, see <http://www.gnu.org/licenses/>.\n*/\n\n\n/*\nBasic account, used by the DAO contract to separately manage both the rewards \nand the extraBalance accounts. \n*/\n\ncontract ManagedAccountInterface {\n // The only address with permission to withdraw from this account\n address public owner;\n // If true, only the owner of the account can receive ether from it\n bool public payOwnerOnly;\n // The sum of ether (in wei) which has been sent to this contract\n uint public accumulatedInput;\n\n /// @notice Sends `_amount` of wei to _recipient\n /// @param _amount The amount of wei to send to `_recipient`\n /// @param _recipient The address to receive `_amount` of wei\n /// @return True if the send completed\n function payOut(address _recipient, uint _amount) returns (bool);\n\n event PayOut(address indexed _recipient, uint _amount);\n}\n\n\ncontract ManagedAccount is ManagedAccountInterface{\n\n // The constructor sets the owner of the account\n function ManagedAccount(address _owner, bool _payOwnerOnly) {\n owner = _owner;\n payOwnerOnly = _payOwnerOnly;\n }\n\n // When the contract receives a transaction without data this is called. \n // It counts the amount of ether it receives and stores it in \n // accumulatedInput.\n function() {\n accumulatedInput += msg.value;\n }\n\n function payOut(address _recipient, uint _amount) returns (bool) {\n if (msg.sender != owner || msg.value > 0 || (payOwnerOnly && _recipient != owner))\n throw;\n if (_recipient.call.value(_amount)()) {\n PayOut(_recipient, _amount);\n return true;\n } else {\n return false;\n }\n }\n}\n/*\nThis file is part of the DAO.\n\nThe DAO is free software: you can redistribute it and/or modify\nit under the terms of the GNU lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThe DAO is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU lesser General Public License for more details.\n\nYou should have received a copy of the GNU lesser General Public License\nalong with the DAO. If not, see <http://www.gnu.org/licenses/>.\n*/\n\n\n/*\n * Token Creation contract, used by the DAO to create its tokens and initialize\n * its ether. Feel free to modify the divisor method to implement different\n * Token Creation parameters\n*/\n\n\ncontract TokenCreationInterface {\n\n // End of token creation, in Unix time\n uint public closingTime;\n // Minimum fueling goal of the token creation, denominated in tokens to\n // be created\n uint public minTokensToCreate;\n // True if the DAO reached its minimum fueling goal, false otherwise\n bool public isFueled;\n // For DAO splits - if privateCreation is 0, then it is a public token\n // creation, otherwise only the address stored in privateCreation is\n // allowed to create tokens\n address public privateCreation;\n // hold extra ether which has been sent after the DAO token\n // creation rate has increased\n ManagedAccount public extraBalance;\n // tracks the amount of wei given from each contributor (used for refund)\n mapping (address => uint256) weiGiven;\n\n /// @dev Constructor setting the minimum fueling goal and the\n /// end of the Token Creation\n /// @param _minTokensToCreate Minimum fueling goal in number of\n /// Tokens to be created\n /// @param _closingTime Date (in Unix time) of the end of the Token Creation\n /// @param _privateCreation Zero means that the creation is public. A\n /// non-zero address represents the only address that can create Tokens\n /// (the address can also create Tokens on behalf of other accounts)\n // This is the constructor: it can not be overloaded so it is commented out\n // function TokenCreation(\n // uint _minTokensTocreate,\n // uint _closingTime,\n // address _privateCreation\n // );\n\n /// @notice Create Token with `_tokenHolder` as the initial owner of the Token\n /// @param _tokenHolder The address of the Tokens's recipient\n /// @return Whether the token creation was successful\n function createTokenProxy(address _tokenHolder) returns (bool success);\n\n /// @notice Refund `msg.sender` in the case the Token Creation did\n /// not reach its minimum fueling goal\n function refund();\n\n /// @return The divisor used to calculate the token creation rate during\n /// the creation phase\n function divisor() constant returns (uint divisor);\n\n event FuelingToDate(uint value);\n event CreatedToken(address indexed to, uint amount);\n event Refund(address indexed to, uint value);\n}\n\n\ncontract TokenCreation is TokenCreationInterface, Token {\n function TokenCreation(\n uint _minTokensToCreate,\n uint _closingTime,\n address _privateCreation) {\n\n closingTime = _closingTime;\n minTokensToCreate = _minTokensToCreate;\n privateCreation = _privateCreation;\n extraBalance = new ManagedAccount(address(this), true);\n }\n\n function createTokenProxy(address _tokenHolder) returns (bool success) {\n if (now < closingTime && msg.value > 0\n && (privateCreation == 0 || privateCreation == msg.sender)) {\n\n uint token = (msg.value * 20) / divisor();\n extraBalance.call.value(msg.value - token)();\n balances[_tokenHolder] += token;\n totalSupply += token;\n weiGiven[_tokenHolder] += msg.value;\n CreatedToken(_tokenHolder, token);\n if (totalSupply >= minTokensToCreate && !isFueled) {\n isFueled = true;\n FuelingToDate(totalSupply);\n }\n return true;\n }\n throw;\n }\n\n function refund() noEther {\n if (now > closingTime && !isFueled) {\n // Get extraBalance - will only succeed when called for the first time\n if (extraBalance.balance >= extraBalance.accumulatedInput())\n extraBalance.payOut(address(this), extraBalance.accumulatedInput());\n\n // Execute refund\n if (msg.sender.call.value(weiGiven[msg.sender])()) {\n Refund(msg.sender, weiGiven[msg.sender]);\n totalSupply -= balances[msg.sender];\n balances[msg.sender] = 0;\n weiGiven[msg.sender] = 0;\n }\n }\n }\n\n function divisor() constant returns (uint divisor) {\n // The number of (base unit) tokens per wei is calculated\n // as `msg.value` * 20 / `divisor`\n // The fueling period starts with a 1:1 ratio\n if (closingTime - 2 weeks > now) {\n return 20;\n // Followed by 10 days with a daily creation rate increase of 5%\n } else if (closingTime - 4 days > now) {\n return (20 + (now - (closingTime - 2 weeks)) / (1 days));\n // The last 4 days there is a constant creation rate ratio of 1:1.5\n } else {\n return 30;\n }\n }\n}\n/*\nThis file is part of the DAO.\n\nThe DAO is free software: you can redistribute it and/or modify\nit under the terms of the GNU lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThe DAO is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU lesser General Public License for more details.\n\nYou should have received a copy of the GNU lesser General Public License\nalong with the DAO. If not, see <http://www.gnu.org/licenses/>.\n*/\n\n\n/*\nStandard smart contract for a Decentralized Autonomous Organization (DAO)\nto automate organizational governance and decision-making.\n*/\n\n\ncontract DAOInterface {\n\n // The amount of days for which people who try to participate in the\n // creation by calling the fallback function will still get their ether back\n uint constant creationGracePeriod = 40 days;\n // The minimum debate period that a generic proposal can have\n uint constant minProposalDebatePeriod = 2 weeks;\n // The minimum debate period that a split proposal can have\n uint constant minSplitDebatePeriod = 1 weeks;\n // Period of days inside which it's possible to execute a DAO split\n uint constant splitExecutionPeriod = 27 days;\n // Period of time after which the minimum Quorum is halved\n uint constant quorumHalvingPeriod = 25 weeks;\n // Period after which a proposal is closed\n // (used in the case `executeProposal` fails because it throws)\n uint constant executeProposalPeriod = 10 days;\n // Denotes the maximum proposal deposit that can be given. It is given as\n // a fraction of total Ether spent plus balance of the DAO\n uint constant maxDepositDivisor = 100;\n\n // Proposals to spend the DAO's ether or to choose a new Curator\n Proposal[] public proposals;\n // The quorum needed for each proposal is partially calculated by\n // totalSupply / minQuorumDivisor\n uint public minQuorumDivisor;\n // The unix time of the last time quorum was reached on a proposal\n uint public lastTimeMinQuorumMet;\n\n // Address of the curator\n address public curator;\n // The whitelist: List of addresses the DAO is allowed to send ether to\n mapping (address => bool) public allowedRecipients;\n\n // Tracks the addresses that own Reward Tokens. Those addresses can only be\n // DAOs that have split from the original DAO. Conceptually, Reward Tokens\n // represent the proportion of the rewards that the DAO has the right to\n // receive. These Reward Tokens are generated when the DAO spends ether.\n mapping (address => uint) public rewardToken;\n // Total supply of rewardToken\n uint public totalRewardToken;\n\n // The account used to manage the rewards which are to be distributed to the\n // DAO Token Holders of this DAO\n ManagedAccount public rewardAccount;\n\n // The account used to manage the rewards which are to be distributed to\n // any DAO that holds Reward Tokens\n ManagedAccount public DAOrewardAccount;\n\n // Amount of rewards (in wei) already paid out to a certain DAO\n mapping (address => uint) public DAOpaidOut;\n\n // Amount of rewards (in wei) already paid out to a certain address\n mapping (address => uint) public paidOut;\n // Map of addresses blocked during a vote (not allowed to transfer DAO\n // tokens). The address points to the proposal ID.\n mapping (address => uint) public blocked;\n\n // The minimum deposit (in wei) required to submit any proposal that is not\n // requesting a new Curator (no deposit is required for splits)\n uint public proposalDeposit;\n\n // the accumulated sum of all current proposal deposits\n uint sumOfProposalDeposits;\n\n // Contract that is able to create a new DAO (with the same code as\n // this one), used for splits\n DAO_Creator public daoCreator;\n\n // A proposal with `newCurator == false` represents a transaction\n // to be issued by this DAO\n // A proposal with `newCurator == true` represents a DAO split\n struct Proposal {\n // The address where the `amount` will go to if the proposal is accepted\n // or if `newCurator` is true, the proposed Curator of\n // the new DAO).\n address recipient;\n // The amount to transfer to `recipient` if the proposal is accepted.\n uint amount;\n // A plain text description of the proposal\n string description;\n // A unix timestamp, denoting the end of the voting period\n uint votingDeadline;\n // True if the proposal's votes have yet to be counted, otherwise False\n bool open;\n // True if quorum has been reached, the votes have been counted, and\n // the majority said yes\n bool proposalPassed;\n // A hash to check validity of a proposal\n bytes32 proposalHash;\n // Deposit in wei the creator added when submitting their proposal. It\n // is taken from the msg.value of a newProposal call.\n uint proposalDeposit;\n // True if this proposal is to assign a new Curator\n bool newCurator;\n // Data needed for splitting the DAO\n SplitData[] splitData;\n // Number of Tokens in favor of the proposal\n uint yea;\n // Number of Tokens opposed to the proposal\n uint nay;\n // Simple mapping to check if a shareholder has voted for it\n mapping (address => bool) votedYes;\n // Simple mapping to check if a shareholder has voted against it\n mapping (address => bool) votedNo;\n // Address of the shareholder who created the proposal\n address creator;\n }\n\n // Used only in the case of a newCurator proposal.\n struct SplitData {\n // The balance of the current DAO minus the deposit at the time of split\n uint splitBalance;\n // The total amount of DAO Tokens in existence at the time of split.\n uint totalSupply;\n // Amount of Reward Tokens owned by the DAO at the time of split.\n uint rewardToken;\n // The new DAO contract created at the time of split.\n DAO newDAO;\n }\n\n // Used to restrict access to certain functions to only DAO Token Holders\n modifier onlyTokenholders {}\n\n /// @dev Constructor setting the Curator and the address\n /// for the contract able to create another DAO as well as the parameters\n /// for the DAO Token Creation\n /// @param _curator The Curator\n /// @param _daoCreator The contract able to (re)create this DAO\n /// @param _proposalDeposit The deposit to be paid for a regular proposal\n /// @param _minTokensToCreate Minimum required wei-equivalent tokens\n /// to be created for a successful DAO Token Creation\n /// @param _closingTime Date (in Unix time) of the end of the DAO Token Creation\n /// @param _privateCreation If zero the DAO Token Creation is open to public, a\n /// non-zero address means that the DAO Token Creation is only for the address\n // This is the constructor: it can not be overloaded so it is commented out\n // function DAO(\n // address _curator,\n // DAO_Creator _daoCreator,\n // uint _proposalDeposit,\n // uint _minTokensToCreate,\n // uint _closingTime,\n // address _privateCreation\n // );\n\n /// @notice Create Token with `msg.sender` as the beneficiary\n /// @return Whether the token creation was successful\n function () returns (bool success);\n\n\n /// @dev This function is used to send ether back\n /// to the DAO, it can also be used to receive payments that should not be\n /// counted as rewards (donations, grants, etc.)\n /// @return Whether the DAO received the ether successfully\n function receiveEther() returns(bool);\n\n /// @notice `msg.sender` creates a proposal to send `_amount` Wei to\n /// `_recipient` with the transaction data `_transactionData`. If\n /// `_newCurator` is true, then this is a proposal that splits the\n /// DAO and sets `_recipient` as the new DAO's Curator.\n /// @param _recipient Address of the recipient of the proposed transaction\n /// @param _amount Amount of wei to be sent with the proposed transaction\n /// @param _description String describing the proposal\n /// @param _transactionData Data of the proposed transaction\n /// @param _debatingPeriod Time used for debating a proposal, at least 2\n /// weeks f

# --- truncated at 32 KB (74 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/bscscan/refs/heads/main/openapi/bscscan-contracts-api-openapi.yml