diff --git a/.gitignore b/.gitignore index 73b9748..0baadfc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,14 @@ +# Dependencies node_modules -repos -aragon-ganache + nohup.out -ipfs-cache package-lock.json + +# build +repos build flattened_contracts + +# snapshot +aragon-ganache +ipfs-cache \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index b993178..fa32516 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,8 @@ notifications: node_js: - '8' install: - - npm install - - travis_wait 60 npm run get-repos - - npm run start-ganache-bg && npm run gen + - travis_wait 60 npm install + - npm run start before_script: - npm prune before_deploy: echo 'Starting publish to NPM' diff --git a/index.js b/index.js index f376be0..cf1e891 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,6 @@ module.exports = { // ENS is deterministically deployed to this address ens: '0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1', - ConsoleReporter: require('./src/reporters/ConsoleReporter'), commands: { devchain: require('./src/commands/devchain'), }, diff --git a/package.json b/package.json index 220c45b..1ddbd05 100644 --- a/package.json +++ b/package.json @@ -7,14 +7,19 @@ "aragen": "./src/cli.js" }, "scripts": { - "start": "npm run start-ganache-bg && npm run get-repos && npm run gen", - "start:local": "npm run start-ganache-bg && npm run link-repos && npm run gen", - "gen": "scripts/deploy-base && scripts/publish-apps && scripts/publish-templates", + "postinstall": "npm run gen", + "start": "npm run start-ganache-bg && npm run deploy", + "start:local": "npm run start-ganache-bg && npm run link-repos && npm run deploy", + "deploy": "npm run deploy-base && npm run publish-client && npm run publish-core-apps && npm run publish-templates", "start-ganache": "scripts/start-ganache", "start-ganache-bg": "scripts/start-ganache-bg", - "get-repos": "scripts/get-repos", + "gen": "scripts/get-repos", "link-repos": "scripts/link-repos", - "deploy-base": "scripts/deploy-base" + "deploy-base": "scripts/deploy-base", + "publish-client": "scripts/publish-client", + "publish-core-apps": "scripts/publish-core-apps", + "publish-open-enterprise": "scripts/publish-open-enterprise", + "publish-templates": "scripts/publish-templates" }, "files": [ "index.js", @@ -36,34 +41,25 @@ }, "homepage": "https://github.com/aragon/aragen#readme", "dependencies": { + "@aragon/cli-utils": "^0.0.3", "@babel/polyfill": "^7.0.0", "chalk": "^2.1.0", - "figures": "^3.0.0", - "ganache-core": "2.5.3", + "ganache-core": "^2.5.7", "listr": "^0.14.3", "ncp": "^2.0.0", "rimraf": "^2.6.2", - "web3": "1.0.0-beta.35", - "yargs": "^12.0.0" + "web3": "^1.2.0", + "yargs": "^13.2.4" }, "devDependencies": { - "@aragon/cli": "^5.0.0", + "@aragon/cli": "^6.0.0", "@aragon/id": "^2.0.0", "@aragon/os": "^4.2.0", "eth-ens-namehash": "^2.0.8", - "ganache-cli": "~6.2.0", + "ganache-cli": "^6.4.2", "truffle": "4.1.14" }, "publishConfig": { "access": "public" - }, - "greenkeeper": { - "ignore": [ - "ganache-core", - "ganache-cli", - "truffle", - "web3", - "yargs" - ] } } diff --git a/readme.md b/readme.md index 1c02c8d..8b64f67 100644 --- a/readme.md +++ b/readme.md @@ -1,12 +1,14 @@ -# AraGen [![Build Status](https://travis-ci.org/aragon/aragen.svg?branch=master)](https://travis-ci.org/aragon/aragen) [![npm](https://img.shields.io/npm/v/@aragon/aragen.svg?style=for-the-badge)](https://www.npmjs.com/package/@aragon/aragen) [![Greenkeeper badge](https://badges.greenkeeper.io/aragon/aragen.svg)](https://greenkeeper.io/) +# AraGen [![Build Status](https://travis-ci.org/aragon/aragen.svg?branch=master)](https://travis-ci.org/aragon/aragen) [![npm](https://img.shields.io/npm/v/@aragon/aragen.svg?style=for-the-badge)](https://www.npmjs.com/package/@aragon/aragen) Generate an Aragon environment ### Requirements + - `npm` - `git` ### How to + ``` npm i npm start @@ -14,7 +16,7 @@ npm start Yes, you are done. Happy hacking 🔥🦅! -If you happen to stop ganache, just: +If you happen to stop ganache, just: ``` npm run start-ganache @@ -42,7 +44,10 @@ npx aragen devchain If you wish to access from code, for example to run ganache-core directly: ```js -const aragonSnapshot = path.resolve(require.resolve('@aragon/aragen'), '../aragon-ganache') +const aragonSnapshot = path.resolve( + require.resolve('@aragon/aragen'), + '../aragon-ganache' +) ``` ### CI diff --git a/scripts/deploy-base b/scripts/deploy-base index 4523343..bf5905d 100755 --- a/scripts/deploy-base +++ b/scripts/deploy-base @@ -8,7 +8,7 @@ sleep 2; # let the people read echo "Deploying ENS instance" npx truffle compile; -DEPLOYED_ENS=$(npx truffle exec --network rpc scripts/deploy-test-ens.js | tail -n 1) +DEPLOYED_ENS=$(npx truffle exec --network rpc scripts/deploy/test-ens.js | tail -n 1) if [ "${ENS}" = "${DEPLOYED_ENS}" ]; then echo "ENS deployed $DEPLOYED_ENS" else @@ -19,7 +19,7 @@ else fi echo "Deploying APM registry to aragonpm.eth and open.aragonpm.eth" -npx truffle exec --network rpc scripts/deploy-apm-open.js +npx truffle exec --network rpc scripts/deploy/apm-open.js echo "Deploying aragonID registry to aragonpm.eth" -npx truffle exec --network rpc scripts/deploy-beta-aragonid.js; +npx truffle exec --network rpc scripts/deploy/beta-aragonid.js; diff --git a/scripts/deploy-apm-open.js b/scripts/deploy/apm-open.js similarity index 98% rename from scripts/deploy-apm-open.js rename to scripts/deploy/apm-open.js index 175decf..c019d2d 100644 --- a/scripts/deploy-apm-open.js +++ b/scripts/deploy/apm-open.js @@ -1,7 +1,7 @@ const namehash = require('eth-ens-namehash').hash const keccak256 = require('js-sha3').keccak_256 -const deployAPM = require('./deploy-apm') +const deployAPM = require('./apm') const globalArtifacts = this.artifacts // Not injected unless called directly via truffle const globalWeb3 = this.web3 // Not injected unless called directly via truffle diff --git a/scripts/deploy-apm.js b/scripts/deploy/apm.js similarity index 96% rename from scripts/deploy-apm.js rename to scripts/deploy/apm.js index 1a5f4b9..f9dec8f 100644 --- a/scripts/deploy-apm.js +++ b/scripts/deploy/apm.js @@ -1,10 +1,10 @@ const namehash = require('eth-ens-namehash').hash const keccak256 = require('js-sha3').keccak_256 -const deployENS = require('./deploy-test-ens') -const deployDaoFactory = require('./deploy-daofactory') +const deployENS = require('./test-ens') +const deployDaoFactory = require('./daofactory') const logDeploy = require('@aragon/os/scripts/helpers/deploy-logger') -const getAccounts = require('./helpers/get-accounts') +const getAccounts = require('@aragon/os/scripts/helpers/get-accounts') const globalArtifacts = this.artifacts // Not injected unless called directly via truffle const globalWeb3 = this.web3 // Not injected unless called directly via truffle diff --git a/scripts/deploy-beta-aragonid.js b/scripts/deploy/beta-aragonid.js similarity index 77% rename from scripts/deploy-beta-aragonid.js rename to scripts/deploy/beta-aragonid.js index bd45984..e2d1b0e 100644 --- a/scripts/deploy-beta-aragonid.js +++ b/scripts/deploy/beta-aragonid.js @@ -1,7 +1,7 @@ const namehash = require('eth-ens-namehash').hash const keccak256 = require('js-sha3').keccak_256 const logDeploy = require('@aragon/os/scripts/helpers/deploy-logger') -const getAccounts = require('./helpers/get-accounts') +const getAccounts = require('@aragon/os/scripts/helpers/get-accounts') const globalArtifacts = this.artifacts // Not injected unless called directly via truffle const globalWeb3 = this.web3 // Not injected unless called directly via truffle @@ -9,7 +9,7 @@ const defaultOwner = process.env.OWNER const defaultENSAddress = process.env.ENS const tld = namehash('eth') -const label = '0x'+keccak256('aragonid') +const label = '0x' + keccak256('aragonid') const node = namehash('aragonid.eth') module.exports = async ( @@ -19,11 +19,13 @@ module.exports = async ( web3 = globalWeb3, ensAddress = defaultENSAddress, owner = defaultOwner, - verbose = true + verbose = true, } = {} ) => { const log = (...args) => { - if (verbose) { console.log(...args) } + if (verbose) { + console.log(...args) + } } const accounts = await getAccounts(web3) @@ -32,14 +34,20 @@ module.exports = async ( const FIFSResolvingRegistrar = artifacts.require('FIFSResolvingRegistrar') const ENS = artifacts.require('AbstractENS') - const publicResolver = await ENS.at(ensAddress).resolver(namehash('resolver.eth')) - const aragonID = await FIFSResolvingRegistrar.new(ensAddress, publicResolver, node) + const publicResolver = await ENS.at(ensAddress).resolver( + namehash('resolver.eth') + ) + const aragonID = await FIFSResolvingRegistrar.new( + ensAddress, + publicResolver, + node + ) await logDeploy(aragonID, { verbose }) log('assigning ENS name to AragonID') const ens = ENS.at(ensAddress) - if (await ens.owner(node) === accounts[0]) { + if ((await ens.owner(node)) === accounts[0]) { log('Transferring name ownership from deployer to AragonID') await ens.setOwner(node, aragonID.address) } else { @@ -57,7 +65,7 @@ module.exports = async ( if (owner) { log('assigning owner name') - await aragonID.register('0x'+keccak256('owner'), owner) + await aragonID.register('0x' + keccak256('owner'), owner) } log('===========') diff --git a/scripts/deploy-daofactory.js b/scripts/deploy/daofactory.js similarity index 100% rename from scripts/deploy-daofactory.js rename to scripts/deploy/daofactory.js diff --git a/scripts/deploy-test-ens.js b/scripts/deploy/test-ens.js similarity index 95% rename from scripts/deploy-test-ens.js rename to scripts/deploy/test-ens.js index ca32ba9..164298d 100644 --- a/scripts/deploy-test-ens.js +++ b/scripts/deploy/test-ens.js @@ -1,5 +1,5 @@ const logDeploy = require('@aragon/os/scripts/helpers/deploy-logger') -const getAccounts = require('./helpers/get-accounts') +const getAccounts = require('@aragon/os/scripts/helpers/get-accounts') const globalArtifacts = this.artifacts // Not injected unless called directly via truffle const globalWeb3 = this.web3 // Not injected unless called directly via truffle diff --git a/scripts/get-repos b/scripts/get-repos index fe957bd..210e2bf 100755 --- a/scripts/get-repos +++ b/scripts/get-repos @@ -13,7 +13,19 @@ cd aragon-apps; INSTALL_FRONTEND=true npm i; cd ..; -echo "Fetching dao-kits and installing dependencies (this may also take a while 😉)" -git clone https://github.com/aragon/dao-kits.git -b master; -cd dao-kits; +echo "Fetching planning-suite and installing dependencies (this may take a while 😉)" +git clone https://github.com/AutarkLabs/planning-suite.git -b dev; +cd planning-suite; npm i; +cd ..; + +echo "Fetching dao-templates and installing dependencies (this may also take a while 😉)" +git clone https://github.com/aragon/dao-templates.git -b next; +cd dao-templates; +npm i; +cd ..; + +echo "Fetching aragon client and installing dependencies" +git clone https://github.com/aragon/aragon.git -b master; +cd aragon; +npm i; \ No newline at end of file diff --git a/scripts/helpers/get-accounts.js b/scripts/helpers/get-accounts.js deleted file mode 100644 index faed9b8..0000000 --- a/scripts/helpers/get-accounts.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = web3 => ( - new Promise((resolve, reject) => { - web3.eth.getAccounts((err, accounts) => { - if (err) { - return reject(err) - } - resolve(accounts) - }) - }) -) \ No newline at end of file diff --git a/scripts/link-repos b/scripts/link-repos index 766d855..3c4e95c 100755 --- a/scripts/link-repos +++ b/scripts/link-repos @@ -9,4 +9,6 @@ cd repos echo "Linking to local repos" ln -s ../../aragon-apps aragon-apps -ln -s ../../dao-kits dao-kits +ln -s ../../planning-suite planning-suite +ln -s ../../dao-templates dao-templates +ln -s ../../aragon aragon diff --git a/scripts/publish-client b/scripts/publish-client new file mode 100755 index 0000000..330893c --- /dev/null +++ b/scripts/publish-client @@ -0,0 +1,14 @@ +#!/bin/bash + +DIR=$(pwd) +IPFS_CACHE=$DIR/ipfs-cache + +rm -rf $IPFS_CACHE; +mkdir $IPFS_CACHE; + +set -e; +cd repos/aragon; + +npm run build:local; + +aragon apm publish 1.0.0 --only-content --files build --publish-dir $IPFS_CACHE/@aragon/aragon --skip-confirmation --no-propagate-content --no-build; diff --git a/scripts/publish-apps b/scripts/publish-core-apps similarity index 62% rename from scripts/publish-apps rename to scripts/publish-core-apps index 0aa27ea..850cfef 100755 --- a/scripts/publish-apps +++ b/scripts/publish-core-apps @@ -3,15 +3,13 @@ DIR=$(pwd) IPFS_CACHE=$DIR/ipfs-cache -rm -rf $IPFS_CACHE; -mkdir $IPFS_CACHE; - set -e; cd repos/aragon-apps; -LERNA_EXEC_APPS="npx lerna exec --scope=@aragon/apps-finance --scope=@aragon/apps-voting --scope=@aragon/apps-token-manager --scope=@aragon/apps-survey --concurrency=1 --stream" +LERNA_EXEC_APPS="npx lerna exec --scope=@aragon/apps-finance --scope=@aragon/apps-voting --scope=@aragon/apps-token-manager --scope=@aragon/apps-survey --scope=@aragon/future-apps-payroll --concurrency=1 --stream" LERNA_EXEC_APPS_WITHOUT_UI="npx lerna exec --scope=@aragon/apps-vault --scope=@aragon/apps-agent --concurrency=1 --stream" -$LERNA_EXEC_APPS -- "aragon apm publish 1.0.0 --files app/build --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME" -$LERNA_EXEC_APPS_WITHOUT_UI -- "aragon apm publish 1.0.0 --files public --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME" + +$LERNA_EXEC_APPS -- "aragon apm publish 1.0.0 --files app/build --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" +$LERNA_EXEC_APPS_WITHOUT_UI -- "aragon apm publish 1.0.0 --files public --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" diff --git a/scripts/publish-open-enterprise b/scripts/publish-open-enterprise new file mode 100755 index 0000000..3461aac --- /dev/null +++ b/scripts/publish-open-enterprise @@ -0,0 +1,12 @@ +#!/bin/bash + +DIR=$(pwd) +IPFS_CACHE=$DIR/ipfs-cache + +set -e; + +cd repos/planning-suite; + +LERNA_EXEC_APPS="npx lerna exec --scope=@aragon/apps-address-book --scope=@aragon/apps-allocations --scope=@aragon/apps-dot-voting --scope=@aragon/apps-projects --scope=@aragon/apps-rewards --concurrency=1 --stream" + +$LERNA_EXEC_APPS -- "aragon apm publish 1.0.0 --files dist --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" diff --git a/scripts/publish-templates b/scripts/publish-templates index 490443a..dd93fff 100755 --- a/scripts/publish-templates +++ b/scripts/publish-templates @@ -6,8 +6,8 @@ IPFS_CACHE=$DIR/ipfs-cache source scripts/set-env; set -e; -cd repos/dao-kits; +cd repos/dao-templates; -LERNA_EXEC="npx lerna exec --scope=@aragon/kits-bare --scope=@aragon/kits-democracy --scope=@aragon/kits-multisig --scope=@aragon/kits-survey --concurrency=1 --stream" +LERNA_EXEC="npx lerna exec --scope=@aragon/templates-bare --scope=@aragon/templates-company --scope=@aragon/templates-company-board --scope=@aragon/templates-membership --scope=@aragon/templates-reputation --scope=@aragon/templates-trust --concurrency=1 --stream" -$LERNA_EXEC -- "npm run publish:rpc -- --files manifest.json --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME" \ No newline at end of file +$LERNA_EXEC -- "npm run publish:rpc -- --files manifest.json --publish-dir $IPFS_CACHE/\$LERNA_PACKAGE_NAME --skip-confirmation --no-propagate-content" \ No newline at end of file diff --git a/scripts/start-ganache-bg b/scripts/start-ganache-bg index 4d33e18..2805744 100755 --- a/scripts/start-ganache-bg +++ b/scripts/start-ganache-bg @@ -1,9 +1,15 @@ #!/bin/bash -set +e; -kill -9 $(lsof -t -i:8545); -set -e; +ganache_port=8545 +ganache_running() { + nc -z localhost "$ganache_port" &> /dev/null +} -echo "Starting ganache in the background"; +if ganache_running; then + echo "Killing ganache instance at port $ganache_port" + kill -9 $(lsof -t -i:$ganache_port); +fi -nohup npm run start-ganache & +printf "Starting ganache in the background\n\n"; + +nohup npm run start-ganache & \ No newline at end of file diff --git a/src/cli.js b/src/cli.js index 849a6c9..1a9d49a 100755 --- a/src/cli.js +++ b/src/cli.js @@ -1,9 +1,15 @@ #!/usr/bin/env node require('@babel/polyfill') -const ConsoleReporter = require('./reporters/ConsoleReporter') +const ConsoleReporter = require('@aragon/cli-utils/src/reporters/ConsoleReporter') // Set up commands -const cmd = require('yargs').commandDir('./commands') +const cmd = require('yargs') + .strict() + .parserConfiguration({ + 'parse-numbers': false, + }) + .usage(`Usage: aragen [options]`) + .commandDir('./commands') cmd.alias('h', 'help') cmd.alias('v', 'version') diff --git a/src/commands/devchain.js b/src/commands/devchain.js index d6fba4e..a860b8b 100644 --- a/src/commands/devchain.js +++ b/src/commands/devchain.js @@ -9,7 +9,7 @@ const rimraf = require('rimraf') const mkdirp = require('mkdirp') const chalk = require('chalk') const fs = require('fs') -const listrOpts = require('../helpers/listr-options') +const listrOpts = require('@aragon/cli-utils/src/helpers/listr-options') const pjson = require('../../package.json') const { BLOCK_GAS_LIMIT, MNEMONIC } = require('../helpers/ganache-vars') @@ -85,7 +85,7 @@ exports.task = async function({ server.listen(port, err => { if (err) return reject(err) - task.title = `Local chain started at port ${port}` + task.title = `Local chain started at port ${chalk.blue(port)}\n` resolve() }) }) @@ -117,34 +117,36 @@ exports.task = async function({ exports.printAccounts = (reporter, privateKeys) => { const firstAccountComment = - '(this account is used to deploy DAOs, it has more permissions)' + '(account used to deploy DAOs, has more permissions)' const formattedAccounts = privateKeys.map( ({ address, key }, i) => - chalk.bold( - `Address #${i + 1}: ${address} ${ - i === 0 ? firstAccountComment : '' - }\nPrivate key: ` - ) + key + `Address #${i + 1}: ${chalk.green(address)} ${ + i === 0 ? firstAccountComment : '' + }\nPrivate key: ` + + chalk.blue(key) + + '\n' ) reporter.info(`Here are some Ethereum accounts you can use. - The first one will be used for all the actions the CLI performs. + The first one will be used for all the actions the aragonCLI performs. You can use your favorite Ethereum provider or wallet to import their private keys. \n${formattedAccounts.join('\n')}`) } exports.printMnemonic = (reporter, mnemonic) => { reporter.info( - `The accounts were generated from the following mnemonic phrase:\n${mnemonic}\n` + `The accounts were generated from the following mnemonic phrase:\n${chalk.blue( + mnemonic + )}\n` ) } exports.printResetNotice = (reporter, reset) => { if (reset) { reporter.warning(`The devchain was reset, some steps need to be done to prevent issues: - - Reset the application cache in Aragon Core by going to Settings > Troubleshooting. - - If using Metamask: switch to a different network, and then switch back to the 'Private Network' (this will clear the nonce cache and prevent errors when sending transactions) + - Reset the application cache in Aragon Client by going to Settings -> Troubleshooting. + - If using Metamask: switch to a different network, and then switch back to the 'Private Network' (this will clear the nonce cache and prevent errors when sending transactions) `) } } @@ -173,8 +175,10 @@ exports.handler = async ({ exports.printResetNotice(reporter, reset) reporter.info( - `ENS instance deployed at 0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1\n` + 'ENS instance deployed at', + chalk.green('0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1'), + '\n' ) - reporter.info(`Devchain running: ${chalk.bold('http://localhost:' + port)}.`) + reporter.info(`Devchain running: ${chalk.blue('http://localhost:' + port)}.`) } diff --git a/src/helpers/listr-options.js b/src/helpers/listr-options.js deleted file mode 100644 index f5311c8..0000000 --- a/src/helpers/listr-options.js +++ /dev/null @@ -1,19 +0,0 @@ -const ListrRenderer = require('../reporters/ListrRenderer') - -/** - * https://github.com/SamVerschueren/listr#options - * https://github.com/SamVerschueren/listr-update-renderer#options - * https://github.com/SamVerschueren/listr-verbose-renderer#options - * - * @param {boolean} silent Option silent - * @param {boolean} debug Option debug - * @returns {Object} listr options object - */ -function listrOpts(silent, debug) { - return { - renderer: ListrRenderer(silent, debug), - dateFormat: false, - } -} - -module.exports = listrOpts diff --git a/src/reporters/ConsoleReporter.js b/src/reporters/ConsoleReporter.js deleted file mode 100644 index 9b85c45..0000000 --- a/src/reporters/ConsoleReporter.js +++ /dev/null @@ -1,49 +0,0 @@ -const chalk = require('chalk') -const figures = require('figures') - -module.exports = class ConsoleReporter { - constructor(opts = { silent: false }) { - this.silent = opts.silent - } - - message(category = 'info', message) { - if (this.silent) return - - const color = { - debug: 'magenta', - info: 'blue', - warning: 'yellow', - error: 'red', - success: 'green', - }[category] - const symbol = { - debug: figures.pointer, - info: figures.info, - warning: figures.warning, - error: figures.cross, - success: figures.tick, - }[category] - const icon = chalk[color](symbol) - console.log(` ${icon} ${message}`) - } - - debug(message) { - if (global.DEBUG_MODE) this.message('debug', message) - } - - info(message) { - this.message('info', message) - } - - warning(message) { - this.message('warning', message) - } - - error(message) { - this.message('error', message) - } - - success(message) { - this.message('success', message) - } -} diff --git a/src/reporters/ListrRenderer.js b/src/reporters/ListrRenderer.js deleted file mode 100644 index 2bef647..0000000 --- a/src/reporters/ListrRenderer.js +++ /dev/null @@ -1,9 +0,0 @@ -const VerboseRenderer = require('listr-verbose-renderer') -const SilentRenderer = require('listr-silent-renderer') -const UpdateRenderer = require('listr-update-renderer') - -module.exports = function(silent, debug) { - if (debug) return VerboseRenderer - if (silent) return SilentRenderer - return UpdateRenderer -}