Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
陈志同 authored Sep 12, 2018
2 parents b7a3afb + 34b2638 commit 5339cbc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion NeoContract/CGAS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ private static bool Transfer(byte[] from, byte[] to, BigInteger amount, byte[] c
//Increase the payee balance
var toAmount = asset.Get(to).AsBigInteger(); //0.1
asset.Put(to, toAmount + amount); //1

SetTxInfo(from, to, amount);
Transferred(from, to, amount);
return true;
Expand Down
8 changes: 4 additions & 4 deletions UnitTests/CGASTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static class CGASTest
static readonly UInt160 User = Wallet.ToScriptHash("AJd31a8rYPEBkY1QSxpsGy8mdU4vTYTD4U");
static readonly byte[] UserScript = "2103ad1d70f140d84a90ad4491cdf175fa64bfa9287a006e8cbd8f8db8500b5205baac".HexToBytes();

//SGAS MintTokens
//CGAS MintTokens
public static void MintTokens()
{
var inputs = new List<CoinReference> {
Expand All @@ -34,7 +34,7 @@ public static void MintTokens()
var outputs = new List<TransactionOutput>{ new TransactionOutput()
{
AssetId = Blockchain.UtilityToken.Hash, //Asset Id, this is GAS
ScriptHash = SgasAddress, //SGAS 地址
ScriptHash = CgasAddress, //CGAS 地址
Value = new Fixed8((long)(1 * (long)Math.Pow(10, 8))) //Value
}}.ToArray();

Expand Down Expand Up @@ -120,7 +120,7 @@ public static void Refund()
var outputs = new List<TransactionOutput>{ new TransactionOutput()
{
AssetId = Blockchain.UtilityToken.Hash, //Asset Id, this is GAS
ScriptHash = SgasAddress, //SGAS 地址
ScriptHash = CgasAddress, //CGAS 地址
Value = new Fixed8((long)(9.99 * (long)Math.Pow(10, 8))) //Value
}}.ToArray();

Expand Down Expand Up @@ -246,7 +246,7 @@ public static void Verify()
var outputs = new List<TransactionOutput>{ new TransactionOutput()
{
AssetId = Blockchain.UtilityToken.Hash, //Asset Id, this is GAS
ScriptHash = User,//SGAS 地址
ScriptHash = User,//CGAS 地址
Value = new Fixed8((long)(1 * (long)Math.Pow(10, 8))) //Value
}}.ToArray();

Expand Down
8 changes: 3 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@ Other notifications realized in the contract:

## 合约说明:

CGAS 是由 NGD(NEO Global Development)发布的符合 NEP-5 规范的合约资产,CGAS 可由 GAS 一比一地对换,并且支持退回操作。该合约的目的是将 GAS 进行全局资产的合约映射,使全局资产 GAS 可以方便地在合约内部流转,支持由合约调用转账。
CGAS 可由 GAS 一比一地对换,并且支持退回操作。该合约的目的是将 GAS 进行全局资产的合约映射,使全局资产 GAS 可以方便地在合约内部流转,支持由合约调用转账。

## 技术介绍:

Script Hash: [0x9121e89e8a0849857262d67c8408601b5e8e0524](https://neotracker.io/contract/9121e89e8a0849857262d67c8408601b5e8e0524)
本项目为 CGAS preview 未在主网进行过部署,由 NGD 部署的 CGAS 参见 [这里](https://github.com/neo-ngd/CGAS-Contract)

CGAS 合约地址:AK4LdT5ZXR9DQZjfk5X6Xy79mE8ad8jKAW
## 技术介绍:

NEP-5 规范中的方法:

Expand Down

0 comments on commit 5339cbc

Please sign in to comment.