Synthetix – 合成区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Synthetix – 合成区块链毕设代写 是一篇很好的国外资料

Synthetix

Synthetix - 合成 Synthetix - 合成 Synthetix - 合成 Synthetix - 合成 Synthetix - 合成 Synthetix - 合成

Synthetix is a crypto-backed synthetic asset platform.

It is a multi-token system, powered by SNX, the Synthetix Network Token. SNX holders can stake SNX to issue Synths, on-chain synthetic assets via the Mintr dApp The network currently supports an ever growing list of synthetic assets. Please see the list of the deployed contracts on MAIN and TESTNETS Synths can be traded using synthetix.exchange

Synthetix uses a proxy system so that upgrades will not be disruptive to the functionality of the contract. This smooths user interaction, since new functionality will become available without any interruption in their experience. It is also transparent to the community at large, since each upgrade is accompanied by events announcing those upgrades. New releases are managed via the Synthetix Improvement Proposal (SIP) system similar to the EF’s EIPs

Prices are committed on chain by a trusted oracle. Moving to a decentralised oracle is phased in with the first phase completed for all forex prices using Chainlink

Please note that this repository is under development.

For the latest system documentation see docs.synthetix.io

DApps

  • mintr.synthetix.io
  • synthetix.exchange
  • dashboard.synthetix.io

Community

Synthetix - 合成 Synthetix - 合成

For a guide from the community, see synthetix.community


Repo Guide

Branching

A note on the branches used in this repo.

  • master represents the contracts live on mainnet and all testnets.
  • alpha is for the newest version of contracts, and is reserved for deploys to kovan
  • beta is for promoted alpha contracts, and is reserved for deploys to rinkeby
  • release-candidate is for promoted beta contracts, and is reserved for deploys to ropsten

When a new version of the contracts makes its way through all testnets, it eventually becomes promoted in master, with semver reflecting contract changes in the major or minor portion of the version (depending on backwards compatibility). patch changes are simply for changes to the JavaScript interface.

Testing

Synthetix - 合成 Synthetix - 合成 Synthetix - 合成

Please see docs.synthetix.io/contracts/testing for an overview of the automated testing methodologies.

Module Usage

Synthetix - 合成

This repo may be installed via npm install to support both node.js scripting applications and Solidity contract development.

Examples

💯 Please see our walkthrus for code examples in both JavaScript and Solidity: docs.synthetix.io/contracts/walkthrus

Solidity API

All interfaces are available via the path synthetix/contracts/interfaces.

In your code, the key is to use IAddressResolver which can be tied to the immutable proxy: ReadProxyAddressResolver (introduced in SIP-57). You can then fetch Synthetix, FeePool, Depot, et al via IAddressResolver.getAddress(bytes32 name) where name is the bytes32 version of the contract name (case-sensitive). Or you can fetch any synth using IAddressResolver.getSynth(bytes32 synth) where synth is the bytes32 name of the synth (e.g. iETH, sUSD, sDEFI).

E.g.

npm install synthetix

then you can write Solidity as below (using a compiler that links named imports via node_modules):

pragma solidity 0.5.16;  import 'synthetix/contracts/interfaces/IAddressResolver.sol'; import 'synthetix/contracts/interfaces/ISynthetix.sol';   contract MyContract { 	// This should be instantiated with our ReadProxyAddressResolver 	// it's a ReadProxy that won't change, so safe to code it here without a setter 	// see https://docs.synthetix.io/addresses for addresses in mainnet and testnets 	IAddressResolver public synthetixResolver;  	constructor(IAddressResolver _snxResolver) public { 		synthetixResolver = _snxResolver; 	}  	function synthetixIssue() external { 		ISynthetix synthetix = synthetixResolver.getAddress('Synthetix'); 		require(synthetix != address(0), 'Synthetix is missing from Synthetix resolver');  		// Issue for msg.sender = address(MyContract) 		synthetix.issueMaxSynths(); 	}  	function synthetixIssueOnBehalf(address user) external { 		ISynthetix synthetix = synthetixResolver.getAddress('Synthetix'); 		require(synthetix != address(0), 'Synthetix is missing from Synthetix resolver');  		// Note: this will fail if `DelegateApprovals.approveIssueOnBehalf(address(MyContract))` has 		// not yet been invoked by the `user` 		synthetix.issueMaxSynthsOnBehalf(user); 	} }

Node.js API

  • getAST({ source, match = /^contracts// }) Returns the Abstract Syntax Tree (AST) for all compiled sources. Optionally add source to restrict to a single contract source, and set match to an empty regex if you’d like all source ASTs including third party contracts
  • getPathToNetwork({ network, file = '' }) Returns the path to the folder (or file within the folder) for the given network
  • getSource({ network }) Return abi and bytecode for a contract source
  • getSuspensionReasons({ code }) Return mapping of SystemStatus suspension codes to string reasons
  • getSynths({ network }) Return the list of synths for a network
  • getTarget({ network }) Return the information about a contract’s address and source file. The contract names are those specified in docs.synthetix.io/addresses
  • getUsers({ network }) Return the list of user accounts within the Synthetix protocol (e.g. owner, fee, etc)
  • getVersions({ network, byContract = false }) Return the list of deployed versions to the network keyed by tagged version. If byContract is true, it keys by contract name.
  • networks Return the list of supported networks
  • toBytes32 Convert any string to a bytes32 value

Via code

const snx = require('synthetix');  snx.getAST(); /* { 'contracts/AddressResolver.sol':    { imports:       [ 'contracts/Owned.sol',         'contracts/interfaces/IAddressResolver.sol',         'contracts/interfaces/ISynthetix.sol' ],      contracts: { AddressResolver: [Object] },      interfaces: {},      libraries: {} },   'contracts/Owned.sol':    { imports: [],      contracts: { Owned: [Object] },      interfaces: {},      libraries: {} }, */  snx.getAST({ source: 'Synthetix.sol' }); /* { imports:    [ 'contracts/ExternStateToken.sol',      'contracts/MixinResolver.sol',      'contracts/interfaces/ISynthetix.sol',      'contracts/TokenState.sol',      'contracts/interfaces/ISynth.sol',      'contracts/interfaces/IERC20.sol',      'contracts/interfaces/ISystemStatus.sol',      'contracts/interfaces/IExchanger.sol',      'contracts/interfaces/IEtherCollateral.sol',      'contracts/interfaces/IIssuer.sol',      'contracts/interfaces/ISynthetixState.sol',      'contracts/interfaces/IExchangeRates.sol',      'contracts/SupplySchedule.sol',      'contracts/interfaces/IRewardEscrow.sol',      'contracts/interfaces/IHasBalance.sol',      'contracts/interfaces/IRewardsDistribution.sol' ],   contracts:    { Synthetix:       { functions: [Array],         events: [Array],         variables: [Array],         modifiers: [Array],         structs: [],         inherits: [Array] } },   interfaces: {},   libraries: {} } */  // Get the path to the network snx.getPathToNetwork({ network: 'mainnet' }); //'.../Synthetixio/synthetix/publish/deployed/mainnet'  // retrieve an object detailing the contract ABI and bytecode snx.getSource({ network: 'rinkeby', contract: 'Proxy' }); /* {   bytecode: '0..0',   abi: [ ... ] } */  snx.getSuspensionReasons(); /* { 	1: 'System Upgrade', 	2: 'Market Closure', 	3: 'Circuit breaker', 	99: 'Emergency', }; */  // retrieve the array of synths used snx.getSynths({ network: 'rinkeby' }).map(({ name }) => name); // ['sUSD', 'sEUR', ...]  // retrieve an object detailing the contract deployed to the given network. snx.getTarget({ network: 'rinkeby', contract: 'ProxySynthetix' }); /* { 	name: 'ProxySynthetix',   address: '0x322A3346bf24363f451164d96A5b5cd5A7F4c337',   source: 'Proxy',   link: 'https://rinkeby.etherscan.io/address/0x322A3346bf24363f451164d96A5b5cd5A7F4c337',   timestamp: '2019-03-06T23:05:43.914Z',   txn: '', 	network: 'rinkeby' } */  // retrieve the list of system user addresses snx.getUsers({ network: 'mainnet' }); /* [ { name: 'owner',     address: '0xEb3107117FEAd7de89Cd14D463D340A2E6917769' },   { name: 'deployer',     address: '0xDe910777C787903F78C89e7a0bf7F4C435cBB1Fe' },   { name: 'marketClosure',     address: '0xC105Ea57Eb434Fbe44690d7Dec2702e4a2FBFCf7' },   { name: 'oracle',     address: '0xaC1ED4Fabbd5204E02950D68b6FC8c446AC95362' },   { name: 'fee',     address: '0xfeEFEEfeefEeFeefEEFEEfEeFeefEEFeeFEEFEeF' },   { name: 'zero',     address: '0x0000000000000000000000000000000000000000' } ] */  snx.getVersions(); /* { 'v2.21.12-107':    { tag: 'v2.21.12-107',      fulltag: 'v2.21.12-107',      release: 'Hadar',      network: 'kovan',      date: '2020-05-08T12:52:06-04:00',      commit: '19997724bc7eaceb902c523a6742e0bd74fc75cb', 		 contracts: { ReadProxyAddressResolver: [Object] } 		} } */  snx.networks; // [ 'local', 'kovan', 'rinkeby', 'ropsten', 'mainnet' ]  snx.toBytes32('sUSD'); // '0x7355534400000000000000000000000000000000000000000000000000000000'

As a CLI tool

Same as above but as a CLI tool that outputs JSON, using names without the get prefixes:

$ npx synthetix ast contracts/Synth.sol {   "imports": [     "contracts/Owned.sol",     "contracts/ExternStateToken.sol",     "contracts/MixinResolver.sol",     "contracts/interfaces/ISynth.sol",     "contracts/interfaces/IERC20.sol",     "contracts/interfaces/ISystemStatus.sol",     "contracts/interfaces/IFeePool.sol",     "contracts/interfaces/ISynthetix.sol",     "contracts/interfaces/IExchanger.sol",     "contracts/interfaces/IIssue"     # ...   ] }  $ npx synthetix bytes32 sUSD 0x7355534400000000000000000000000000000000000000000000000000000000  $ npx synthetix networks [ 'local', 'kovan', 'rinkeby', 'ropsten', 'mainnet' ]  $ npx synthetix source --network rinkeby --contract Proxy {   "bytecode": "0..0",   "abi": [ ... ] }  $ npx synthetix suspension-reason --code 2 Market Closure  $ npx synthetix synths --network rinkeby --key name ["sUSD", "sEUR", ... ]  $ npx synthetix target --network rinkeby --contract ProxySynthetix {   "name": "ProxySynthetix",   "address": "0x322A3346bf24363f451164d96A5b5cd5A7F4c337",   "source": "Proxy",   "link": "https://rinkeby.etherscan.io/address/0x322A3346bf24363f451164d96A5b5cd5A7F4c337",   "timestamp": "2019-03-06T23:05:43.914Z",   "network": "rinkeby" }  $ npx synthetix users --network mainnet --user oracle {   "name": "oracle",   "address": "0xaC1ED4Fabbd5204E02950D68b6FC8c446AC95362" }  $ npx synthetix versions {   "v2.0-19": {     "tag": "v2.0-19",     "fulltag": "v2.0-19",     "release": "",     "network": "mainnet",     "date": "2019-03-11T18:17:52-04:00",     "commit": "eeb271f4fdd2e615f9dba90503f42b2cb9f9716e",     "contracts": {       "Depot": {         "address": "0x172E09691DfBbC035E37c73B62095caa16Ee2388",         "status": "replaced",         "replaced_in": "v2.18.1"       },       "ExchangeRates": {         "address": "0x73b172756BD5DDf0110Ba8D7b88816Eb639Eb21c",         "status": "replaced",         "replaced_in": "v2.1.11"       },        # ...      }   } }  $ npx synthetix versions --by-contract {   "Depot": [     {       "address": "0x172E09691DfBbC035E37c73B62095caa16Ee2388",       "status": "replaced",       "replaced_in": "v2.18.1"     },     {       "address": "0xE1f64079aDa6Ef07b03982Ca34f1dD7152AA3b86",       "status": "current"     }   ],   "ExchangeRates": [     {       "address": "0x73b172756BD5DDf0110Ba8D7b88816Eb639Eb21c",       "status": "replaced",       "replaced_in": "v2.1.11"     },      # ...   ],    # ... }

#592


Synthetix

<Synthetix><Synthetix><Synthetix><Synthetix><Synthetix><Synthetix><Synthetix><Synthetix>Synthetix - 合成

Synthetix是一个加密支持的合成资产平台。

这是一个多令牌系统,由Synthetix网络令牌SNX提供支持。SNX持有者可以通过Mintr dApp持有SNX股份发行Synts,即链上合成资产。该网络目前支持的合成资产列表不断增加。请参阅MAIN和TESTNETS synth上部署的契约的列表,可以使用synthetix.exchange公司

Synthetix使用代理系统,因此升级不会中断合同的功能。这将平滑用户交互,因为新功能将在用户体验中不受任何干扰地可用。它对整个社区也是透明的,因为每次升级都伴随着宣布这些升级的活动。新版本通过Synthetix改进建议(SIP)系统进行管理,类似于EF的EIP

价格由可信的oracle在链上承诺。转移到分散的oracle将分阶段进行,第一阶段将使用Chainlink完成所有外汇价格的第一阶段。请注意,此存储库正在开发中。

有关最新的系统文档,请参阅docs.synthetix.io文件

<Synthetix>Synthetix - 合成

有关社区指南,请参阅synthetix.community公司

关于本次回购所用分支机构的说明。

当契约的新版本通过所有测试网时,它最终在master中升级,semver反映了版本的主要或次要部分的契约更改(取决于向后兼容性)。补丁更改只是为了更改JavaScript接口。

<Synthetix><Synthetix><Synthetix><Synthetix><Synthetix>

请参见docs.synthetix.io/contracts/testing对于自动化测试方法的概述。

Synthetix - 合成

此回购可以通过npm install来安装,以同时支持这两者节点.js编写应用程序脚本和Solidity合同开发。

💯 有关JavaScript和Solidity的代码示例,请参阅我们的演练:docs.synthetix.io/contracts/walkthrous

所有接口都可以通过路径synthetix/contracts/interfaces获得。

⚡ 在您的代码中,关键是使用可以绑定到不可变代理的IAddressResolver:ReadProxyAddressResolver(在SIP-57中引入)。然后您可以通过获取Synthetix、FeePool、Depot等IAddressResolver.getAddress(bytes32 name)其中name是合同名称的bytes32版本(区分大小写)。或者你可以用IAddressResolver.getSynth(bytes32 synth)其中synth是synth的bytes32名称(例如iETH、sUSD、sDEFI)。

例如,

npm install synthetix

那么您可以编写如下的Solidity(使用通过node_modules链接名为imports的编译器):

与上面相同,但作为一个输出JSON的CLI工具,使用不带get前缀的名称:

Synthetix

DApps

社区

Repo指南

分支

测试

模块用法

示例

节点.jsAPI

通过代码

作为CLI工具

  • mintr.synthetix.io
  • synthetix.exchange公司
  • 仪表板.synthetix.io
  • master代表mainnet和所有testnet上的实时合同。
  • alpha用于最新版本的合同,并为部署到kovan而保留
  • beta用于升级的alpha合同,并保留给部署到rinkeby的人员
  • 发布候选版本用于升级的beta合同,并保留给部署到ropsten的
  • getAST({source,match=/^contracts//})返回所有编译源的抽象语法树(AST)。(可选)添加source以限制到单个协定源,并将match设置为空正则表达式(如果您希望包括第三方契约的所有源AST)
  • getpathtonnetwork({network,file=’})返回给定网络的文件夹(或文件夹中的文件)的路径
  • getSource({network})返回abi和字节码对于合同源
  • getSuspensionReasons({code})返回系统状态挂起代码到字符串原因的映射
  • getSynths({network})返回网络的synth列表
  • getTarget({network})返回有关合同地址和源文件的信息。合同名称为docs.synthetix.io/地址
  • getUsers({network})返回Synthetix协议内的用户帐户列表(例如,所有者、费用等)
  • getVersions({network,byContract=false})将已部署版本的列表返回到由标记版本键控的网络。如果byContract为true,则按契约名称键。
  • networks返回支持的网络列表
  • Synthetix是一个加密支持的合成资产平台。

    这是一个多令牌系统,由Synthetix网络令牌SNX提供支持。SNX持有者可以通过Mintr dApp持有SNX股份发行Synts,即链上合成资产。该网络目前支持的合成资产列表不断增加。请参阅MAIN和TESTNETS synth上部署的契约的列表,可以使用synthetix.exchange公司

    Synthetix使用代理系统,因此升级不会中断合同的功能。这将平滑用户交互,因为新功能将在用户体验中不受任何干扰地可用。它对整个社区也是透明的,因为每次升级都伴随着宣布这些升级的活动。新版本通过Synthetix改进建议(SIP)系统进行管理,类似于EF的EIP

    价格由可信的oracle在链上承诺。转移到分散的oracle将分阶段进行,第一阶段将使用Chainlink完成所有外汇价格的第一阶段。请注意,此存储库正在开发中。

    有关最新的系统文档,请参阅docs.synthetix.io文件

    For the latest system documentation see docs.synthetix.io

    DApps

    • mintr.synthetix.io
    • synthetix.exchange公司
    • 仪表板.synthetix.io

    社区

    <Synthetix>Synthetix - 合成

    有关社区指南,请参阅synthetix.community公司


    Repo指南

    分支

    关于本次回购所用分支机构的说明。

    • master代表mainnet和所有testnet上的实时合同。
    • alpha用于最新版本的合同,并为部署到kovan而保留
    • beta用于升级的alpha合同,并保留给部署到rinkeby的人员
    • 发布候选版本用于升级的beta合同,并保留给部署到ropsten的

    当契约的新版本通过所有测试网时,它最终在master中升级,semver反映了版本的主要或次要部分的契约更改(取决于向后兼容性)。补丁更改只是为了更改JavaScript接口。

    测试

    <Synthetix><Synthetix><Synthetix><Synthetix><Synthetix>

    请参见docs.synthetix.io/contracts/testing对于自动化测试方法的概述。

    Synthetix - 合成

    此回购可以通过npm install来安装,以同时支持这两者节点.js编写应用程序脚本和Solidity合同开发。

    💯 有关JavaScript和Solidity的代码示例,请参阅我们的演练:docs.synthetix.io/contracts/walkthrous

    所有接口都可以通过路径synthetix/contracts/interfaces获得。

    ⚡ 在您的代码中,关键是使用可以绑定到不可变代理的IAddressResolver:ReadProxyAddressResolver(在SIP-57中引入)。然后您可以通过获取Synthetix、FeePool、Depot等IAddressResolver.getAddress(bytes32 name)其中name是合同名称的bytes32版本(区分大小写)。或者你可以用IAddressResolver.getSynth(bytes32 synth)其中synth是synth的bytes32名称(例如iETH、sUSD、sDEFI)。

    例如,

    npm install synthetix

    那么您可以编写如下的Solidity(使用通过node_modules链接名为imports的编译器):

    与上面相同,但作为一个输出JSON的CLI工具,使用不带get前缀的名称:

    Synthetix

    DApps

    社区

    Repo指南

    分支

    测试

    模块用法

    示例

    节点.jsAPI

    通过代码

    作为CLI工具

  • mintr.synthetix.io
  • synthetix.exchange公司
  • 仪表板.synthetix.io
  • master代表mainnet和所有testnet上的实时合同。
  • alpha用于最新版本的合同,并为部署到kovan而保留
  • beta用于升级的alpha合同,并保留给部署到rinkeby的人员
  • 发布候选版本用于升级的beta合同,并保留给部署到ropsten的
  • getAST({source,match=/^contracts//})返回所有编译源的抽象语法树(AST)。(可选)添加source以限制到单个协定源,并将match设置为空正则表达式(如果您希望包括第三方契约的所有源AST)
  • getpathtonnetwork({network,file=’})返回给定网络的文件夹(或文件夹中的文件)的路径
  • getSource({network})返回abi和字节码对于合同源
  • getSuspensionReasons({code})返回系统状态挂起代码到字符串原因的映射
  • getSynths({network})返回网络的synth列表
  • getTarget({network})返回有关合同地址和源文件的信息。合同名称为docs.synthetix.io/地址
  • getUsers({network})返回Synthetix协议内的用户帐户列表(例如,所有者、费用等)
  • getVersions({network,byContract=false})将已部署版本的列表返回到由标记版本键控的网络。如果byContract为true,则按契约名称键。
  • networks返回支持的网络列表
  • 请参见docs.synthetix.io/contracts/testing对于自动化测试方法的概述。

    模块用法

    Synthetix - 合成

    Synthetix - 合成

    示例

    此回购可以通过npm install来安装,以同时支持这两者节点.js编写应用程序脚本和Solidity合同开发。

    节点.jsAPI

    💯 有关JavaScript和Solidity的代码示例,请参阅我们的演练:docs.synthetix.io/contracts/walkthrous

    所有接口都可以通过路径synthetix/contracts/interfaces获得。

    ⚡ 在您的代码中,关键是使用可以绑定到不可变代理的IAddressResolver:ReadProxyAddressResolver(在SIP-57中引入)。然后您可以通过获取Synthetix、FeePool、Depot等IAddressResolver.getAddress(bytes32 name)其中name是合同名称的bytes32版本(区分大小写)。或者你可以用IAddressResolver.getSynth(bytes32 synth)其中synth是synth的bytes32名称(例如iETH、sUSD、sDEFI)。

    例如,

    npm install synthetix

    pragma solidity 0.5.16;  import 'synthetix/contracts/interfaces/IAddressResolver.sol'; import 'synthetix/contracts/interfaces/ISynthetix.sol';   contract MyContract { 	// This should be instantiated with our ReadProxyAddressResolver 	// it's a ReadProxy that won't change, so safe to code it here without a setter 	// see https://docs.synthetix.io/addresses for addresses in mainnet and testnets 	IAddressResolver public synthetixResolver;  	constructor(IAddressResolver _snxResolver) public { 		synthetixResolver = _snxResolver; 	}  	function synthetixIssue() external { 		ISynthetix synthetix = synthetixResolver.getAddress('Synthetix'); 		require(synthetix != address(0), 'Synthetix is missing from Synthetix resolver');  		// Issue for msg.sender = address(MyContract) 		synthetix.issueMaxSynths(); 	}  	function synthetixIssueOnBehalf(address user) external { 		ISynthetix synthetix = synthetixResolver.getAddress('Synthetix'); 		require(synthetix != address(0), 'Synthetix is missing from Synthetix resolver');  		// Note: this will fail if `DelegateApprovals.approveIssueOnBehalf(address(MyContract))` has 		// not yet been invoked by the `user` 		synthetix.issueMaxSynthsOnBehalf(user); 	} }

    通过代码

    • getAST({source,match=/^contracts//})返回所有编译源的抽象语法树(AST)。(可选)添加source以限制到单个协定源,并将match设置为空正则表达式(如果您希望包括第三方契约的所有源AST)
    • getpathtonnetwork({network,file=’})返回给定网络的文件夹(或文件夹中的文件)的路径
    • getSource({network})返回abi和字节码对于合同源
    • getSuspensionReasons({code})返回系统状态挂起代码到字符串原因的映射
    • getSynths({network})返回网络的synth列表
    • getTarget({network})返回有关合同地址和源文件的信息。合同名称为docs.synthetix.io/地址
    • getUsers({network})返回Synthetix协议内的用户帐户列表(例如,所有者、费用等)
    • getVersions({network,byContract=false})将已部署版本的列表返回到由标记版本键控的网络。如果byContract为true,则按契约名称键。
    • networks返回支持的网络列表
    • toBytes32 Convert any string to a bytes32 value

    作为CLI工具

    const snx = require('synthetix');  snx.getAST(); /* { 'contracts/AddressResolver.sol':    { imports:       [ 'contracts/Owned.sol',         'contracts/interfaces/IAddressResolver.sol',         'contracts/interfaces/ISynthetix.sol' ],      contracts: { AddressResolver: [Object] },      interfaces: {},      libraries: {} },   'contracts/Owned.sol':    { imports: [],      contracts: { Owned: [Object] },      interfaces: {},      libraries: {} }, */  snx.getAST({ source: 'Synthetix.sol' }); /* { imports:    [ 'contracts/ExternStateToken.sol',      'contracts/MixinResolver.sol',      'contracts/interfaces/ISynthetix.sol',      'contracts/TokenState.sol',      'contracts/interfaces/ISynth.sol',      'contracts/interfaces/IERC20.sol',      'contracts/interfaces/ISystemStatus.sol',      'contracts/interfaces/IExchanger.sol',      'contracts/interfaces/IEtherCollateral.sol',      'contracts/interfaces/IIssuer.sol',      'contracts/interfaces/ISynthetixState.sol',      'contracts/interfaces/IExchangeRates.sol',      'contracts/SupplySchedule.sol',      'contracts/interfaces/IRewardEscrow.sol',      'contracts/interfaces/IHasBalance.sol',      'contracts/interfaces/IRewardsDistribution.sol' ],   contracts:    { Synthetix:       { functions: [Array],         events: [Array],         variables: [Array],         modifiers: [Array],         structs: [],         inherits: [Array] } },   interfaces: {},   libraries: {} } */  // Get the path to the network snx.getPathToNetwork({ network: 'mainnet' }); //'.../Synthetixio/synthetix/publish/deployed/mainnet'  // retrieve an object detailing the contract ABI and bytecode snx.getSource({ network: 'rinkeby', contract: 'Proxy' }); /* {   bytecode: '0..0',   abi: [ ... ] } */  snx.getSuspensionReasons(); /* { 	1: 'System Upgrade', 	2: 'Market Closure', 	3: 'Circuit breaker', 	99: 'Emergency', }; */  // retrieve the array of synths used snx.getSynths({ network: 'rinkeby' }).map(({ name }) => name); // ['sUSD', 'sEUR', ...]  // retrieve an object detailing the contract deployed to the given network. snx.getTarget({ network: 'rinkeby', contract: 'ProxySynthetix' }); /* { 	name: 'ProxySynthetix',   address: '0x322A3346bf24363f451164d96A5b5cd5A7F4c337',   source: 'Proxy',   link: 'https://rinkeby.etherscan.io/address/0x322A3346bf24363f451164d96A5b5cd5A7F4c337',   timestamp: '2019-03-06T23:05:43.914Z',   txn: '', 	network: 'rinkeby' } */  // retrieve the list of system user addresses snx.getUsers({ network: 'mainnet' }); /* [ { name: 'owner',     address: '0xEb3107117FEAd7de89Cd14D463D340A2E6917769' },   { name: 'deployer',     address: '0xDe910777C787903F78C89e7a0bf7F4C435cBB1Fe' },   { name: 'marketClosure',     address: '0xC105Ea57Eb434Fbe44690d7Dec2702e4a2FBFCf7' },   { name: 'oracle',     address: '0xaC1ED4Fabbd5204E02950D68b6FC8c446AC95362' },   { name: 'fee',     address: '0xfeEFEEfeefEeFeefEEFEEfEeFeefEEFeeFEEFEeF' },   { name: 'zero',     address: '0x0000000000000000000000000000000000000000' } ] */  snx.getVersions(); /* { 'v2.21.12-107':    { tag: 'v2.21.12-107',      fulltag: 'v2.21.12-107',      release: 'Hadar',      network: 'kovan',      date: '2020-05-08T12:52:06-04:00',      commit: '19997724bc7eaceb902c523a6742e0bd74fc75cb', 		 contracts: { ReadProxyAddressResolver: [Object] } 		} } */  snx.networks; // [ 'local', 'kovan', 'rinkeby', 'ropsten', 'mainnet' ]  snx.toBytes32('sUSD'); // '0x7355534400000000000000000000000000000000000000000000000000000000'

    As a CLI tool

    那么您可以编写如下的Solidity(使用通过node_modules链接名为imports的编译器):

    $ npx synthetix ast contracts/Synth.sol {   "imports": [     "contracts/Owned.sol",     "contracts/ExternStateToken.sol",     "contracts/MixinResolver.sol",     "contracts/interfaces/ISynth.sol",     "contracts/interfaces/IERC20.sol",     "contracts/interfaces/ISystemStatus.sol",     "contracts/interfaces/IFeePool.sol",     "contracts/interfaces/ISynthetix.sol",     "contracts/interfaces/IExchanger.sol",     "contracts/interfaces/IIssue"     # ...   ] }  $ npx synthetix bytes32 sUSD 0x7355534400000000000000000000000000000000000000000000000000000000  $ npx synthetix networks [ 'local', 'kovan', 'rinkeby', 'ropsten', 'mainnet' ]  $ npx synthetix source --network rinkeby --contract Proxy {   "bytecode": "0..0",   "abi": [ ... ] }  $ npx synthetix suspension-reason --code 2 Market Closure  $ npx synthetix synths --network rinkeby --key name ["sUSD", "sEUR", ... ]  $ npx synthetix target --network rinkeby --contract ProxySynthetix {   "name": "ProxySynthetix",   "address": "0x322A3346bf24363f451164d96A5b5cd5A7F4c337",   "source": "Proxy",   "link": "https://rinkeby.etherscan.io/address/0x322A3346bf24363f451164d96A5b5cd5A7F4c337",   "timestamp": "2019-03-06T23:05:43.914Z",   "network": "rinkeby" }  $ npx synthetix users --network mainnet --user oracle {   "name": "oracle",   "address": "0xaC1ED4Fabbd5204E02950D68b6FC8c446AC95362" }  $ npx synthetix versions {   "v2.0-19": {     "tag": "v2.0-19",     "fulltag": "v2.0-19",     "release": "",     "network": "mainnet",     "date": "2019-03-11T18:17:52-04:00",     "commit": "eeb271f4fdd2e615f9dba90503f42b2cb9f9716e",     "contracts": {       "Depot": {         "address": "0x172E09691DfBbC035E37c73B62095caa16Ee2388",         "status": "replaced",         "replaced_in": "v2.18.1"       },       "ExchangeRates": {         "address": "0x73b172756BD5DDf0110Ba8D7b88816Eb639Eb21c",         "status": "replaced",         "replaced_in": "v2.1.11"       },        # ...      }   } }  $ npx synthetix versions --by-contract {   "Depot": [     {       "address": "0x172E09691DfBbC035E37c73B62095caa16Ee2388",       "status": "replaced",       "replaced_in": "v2.18.1"     },     {       "address": "0xE1f64079aDa6Ef07b03982Ca34f1dD7152AA3b86",       "status": "current"     }   ],   "ExchangeRates": [     {       "address": "0x73b172756BD5DDf0110Ba8D7b88816Eb639Eb21c",       "status": "replaced",       "replaced_in": "v2.1.11"     },      # ...   ],    # ... }

    #592

    部分转自网络,侵权联系删除区块链源码网

    www.interchains.cc

    https://www.interchains.cc/16505.html

    区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
    区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » Synthetix – 合成区块链毕设代写

    提供最优质的资源集合

    立即查看 了解详情