{
    "contractName": "CoinMachine",
    "abi": [
        {
            "anonymous": false,
            "inputs": [],
            "name": "ExtensionInitialised",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": true,
                    "internalType": "address",
                    "name": "authority",
                    "type": "address"
                }
            ],
            "name": "LogSetAuthority",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": true,
                    "internalType": "address",
                    "name": "owner",
                    "type": "address"
                }
            ],
            "name": "LogSetOwner",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": false,
                    "internalType": "uint256",
                    "name": "activePeriod",
                    "type": "uint256"
                },
                {
                    "indexed": false,
                    "internalType": "uint256",
                    "name": "currentPeriod",
                    "type": "uint256"
                }
            ],
            "name": "PeriodUpdated",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": false,
                    "internalType": "address",
                    "name": "buyer",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "internalType": "uint256",
                    "name": "numTokens",
                    "type": "uint256"
                },
                {
                    "indexed": false,
                    "internalType": "uint256",
                    "name": "totalCost",
                    "type": "uint256"
                }
            ],
            "name": "TokensBought",
            "type": "event"
        },
        {
            "inputs": [],
            "name": "authority",
            "outputs": [
                {
                    "internalType": "contract DSAuthority",
                    "name": "",
                    "type": "address"
                }
            ],
            "stateMutability": "view",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "getColony",
            "outputs": [
                {
                    "internalType": "address",
                    "name": "",
                    "type": "address"
                }
            ],
            "stateMutability": "view",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "getDeprecated",
            "outputs": [
                {
                    "internalType": "bool",
                    "name": "",
                    "type": "bool"
                }
            ],
            "stateMutability": "view",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "owner",
            "outputs": [
                {
                    "internalType": "address",
                    "name": "",
                    "type": "address"
                }
            ],
            "stateMutability": "view",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "contract DSAuthority",
                    "name": "authority_",
                    "type": "address"
                }
            ],
            "name": "setAuthority",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "owner_",
                    "type": "address"
                }
            ],
            "name": "setOwner",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "identifier",
            "outputs": [
                {
                    "internalType": "bytes32",
                    "name": "",
                    "type": "bytes32"
                }
            ],
            "stateMutability": "pure",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "version",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "",
                    "type": "uint256"
                }
            ],
            "stateMutability": "pure",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_colony",
                    "type": "address"
                }
            ],
            "name": "install",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "finishUpgrade",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "bool",
                    "name": "_deprecated",
                    "type": "bool"
                }
            ],
            "name": "deprecate",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "uninstall",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "_purchaseToken",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "_periodLength",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_windowSize",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_targetPerPeriod",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_maxPerPeriod",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_tokensToSell",
                    "type": "uint256"
                },
                {
                    "internalType": "uint256",
                    "name": "_startingPrice",
                    "type": "uint256"
                }
            ],
            "name": "initialise",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [
                {
                    "internalType": "uint256",
                    "name": "_numTokens",
                    "type": "uint256"
                }
            ],
            "name": "buyTokens",
            "outputs": [],
            "stateMutability": "payable",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "updatePeriod",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "getPeriodLength",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "",
                    "type": "uint256"
                }
            ],
            "stateMutability": "view",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "getWindowSize",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "",
                    "type": "uint256"
                }
            ],
            "stateMutability": "view",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "getTargetPerPeriod",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "",
                    "type": "uint256"
                }
            ],
            "stateMutability": "view",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "getMaxPerPeriod",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "",
                    "type": "uint256"
                }
            ],
            "stateMutability": "view",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "getTokensToSell",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "",
                    "type": "uint256"
                }
            ],
            "stateMutability": "view",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "getCurrentPrice",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "",
                    "type": "uint256"
                }
            ],
            "stateMutability": "view",
            "type": "function"
        },
        {
            "inputs": [],
            "name": "getNumAvailable",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "",
                    "type": "uint256"
                }
            ],
            "stateMutability": "view",
            "type": "function"
        }
    ],
    "devdoc": {
        "kind": "dev",
        "methods": {
            "buyTokens(uint256)": {
                "params": {
                    "_numTokens": "The number of tokens to purchase"
                }
            },
            "initialise(address,uint256,uint256,uint256,uint256,uint256,uint256)": {
                "params": {
                    "_maxPerPeriod": "The maximum number of tokens that can be sold per period",
                    "_periodLength": "How long in seconds each period of the sale should last",
                    "_purchaseToken": "The token to receive payments in. Use 0x0 for ether",
                    "_startingPrice": "The sale price to start at, expressed in units of _purchaseToken per token being sold, as a WAD",
                    "_targetPerPeriod": "The number of tokens to aim to sell per period",
                    "_windowSize": "Characteristic number of periods that should be used for the moving average. In the long-term, 86% of the weighting will be in this window size. The higher the number, the slower the price will be to adjust"
                }
            },
            "install(address)": {
                "params": {
                    "_colony": "The colony in which the extension holds permissions"
                }
            }
        },
        "version": 1
    },
    "userdoc": {
        "kind": "user",
        "methods": {
            "buyTokens(uint256)": {
                "notice": "Purchase tokens from Coin Machine."
            },
            "deprecate(bool)": {
                "notice": "Called when deprecating (or undeprecating) the extension"
            },
            "finishUpgrade()": {
                "notice": "Called when upgrading the extension"
            },
            "getCurrentPrice()": {
                "notice": "Get the current price per token"
            },
            "getMaxPerPeriod()": {
                "notice": "Get the maximum number of tokens to sell per period"
            },
            "getNumAvailable()": {
                "notice": "Get the number of remaining tokens for sale this period"
            },
            "getPeriodLength()": {
                "notice": "Get the length of the sale period"
            },
            "getTargetPerPeriod()": {
                "notice": "Get the target number of tokens to sell per period"
            },
            "getTokensToSell()": {
                "notice": "Get the total number of tokens remaining for sale"
            },
            "getWindowSize()": {
                "notice": "Get the size of the averaging window"
            },
            "identifier()": {
                "notice": "Returns the identifier of the extension"
            },
            "initialise(address,uint256,uint256,uint256,uint256,uint256,uint256)": {
                "notice": "Must be called before any sales can be made"
            },
            "install(address)": {
                "notice": "Configures the extension"
            },
            "uninstall()": {
                "notice": "Called when uninstalling the extension"
            },
            "updatePeriod()": {
                "notice": "Bring the token accounting current"
            },
            "version()": {
                "notice": "Returns the version of the extension"
            }
        },
        "version": 1
    }
}