aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Buchwald <[email protected]>2020-12-18 13:44:39 -0500
committerAaron Buchwald <[email protected]>2020-12-18 13:44:39 -0500
commit1a3af21dedc790ca0958eb2c93b7e98f5b7f2b77 (patch)
treec776bedfcdc3436a6b5165873e449178ab38cdc8
parenta518d0d8c68812a5c5f7c0395ff380bfa266f493 (diff)
Cleanup
-rw-r--r--examples/arc20/main.go11
-rw-r--r--params/config.go5
2 files changed, 5 insertions, 11 deletions
diff --git a/examples/arc20/main.go b/examples/arc20/main.go
index 303d620..6ad542c 100644
--- a/examples/arc20/main.go
+++ b/examples/arc20/main.go
@@ -40,10 +40,9 @@ func init() {
privateKey = pk
// Extract From Address from the private key
address = crypto.PubkeyToAddress(privateKey.PublicKey)
- // erc20 = common.HexToAddress("0xea75d59faF258F1fdf2b94F158e54D7ad44359B6")
// Address of ARC-20 to deposit funds in
erc20 = common.HexToAddress("0x721F9Af7631605713133ccc502E32eA4d43CDfec")
- // AssetID as a uint256 integer as displayed in Remix of the ARC-20
+ // AssetID of the underlying asset
assetID = common.HexToHash("0x42f0d24c970eb6c567ea63a68b97d8e357a7fc8d9f73489c7761f1382b295db4").Big()
amount = new(big.Int).SetUint64(100)
}
@@ -59,7 +58,7 @@ func createDepositCallData(erc20 common.Address, assetID, amount *big.Int) []byt
data = append(data, erc20.Bytes()...)
data = append(data, common.LeftPadBytes(assetID.Bytes(), 32)...)
data = append(data, common.LeftPadBytes(amount.Bytes(), 32)...)
- data = append(data, functionSignature...) // Add this back in to trigger call to deposit
+ data = append(data, functionSignature...)
fmt.Printf("deposit callData: 0x%x\n", data)
return data
}
@@ -70,7 +69,7 @@ func createDepositTransaction(nonce uint64, erc20 common.Address, assetID, amoun
return types.NewTransaction(nonce, nativeAssetCallAddr, new(big.Int), gasLimit, gasPrice, callData)
}
-// deploy ARC-20 contract with specific assetID
+// Deposit funds into an ARC-20 Contract
func main() {
client, err := ethclient.Dial(uri)
if err != nil {
@@ -83,14 +82,14 @@ func main() {
}
fmt.Printf("Creating deposit transaction from: %s, erc20 address: %s, assetID: %d, amount: %d, nonce: %d\n", address.Hex(), erc20.Hex(), assetID, amount, nonce)
// Create and sign deposit transaction from account that has been funded with sufficient AVAX to
- // pay gas costs and sufficient amount of the native asset to make the deposit
+ // pay gas costs and sufficient amount of [assetID] to make the deposit
tx := createDepositTransaction(nonce, erc20, assetID, amount, gasLimit, gasPrice)
signer := types.NewEIP155Signer(chainID)
signedTx, err := types.SignTx(tx, signer, privateKey)
if err != nil {
panic(err)
}
- // Send the signed transaction to the client
+ // Issue the signed transaction to the client
if err := client.SendTransaction(ctx, signedTx); err != nil {
panic(err)
}
diff --git a/params/config.go b/params/config.go
index 2f59170..f945f47 100644
--- a/params/config.go
+++ b/params/config.go
@@ -502,7 +502,6 @@ func (c *ChainConfig) IsApricot(blockTimestamp *big.Int) bool {
return isForked(c.ApricotBlockTimestamp, blockTimestamp)
}
-// TODO review how this works and see if it will work for a live transition
// CheckCompatible checks whether scheduled fork transitions have been imported
// with a mismatching chain configuration.
func (c *ChainConfig) CheckCompatible(newcfg *ChainConfig, height uint64) *ConfigCompatError {
@@ -542,10 +541,6 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
{name: "istanbulBlock", block: c.IstanbulBlock},
{name: "muirGlacierBlock", block: c.MuirGlacierBlock, optional: true},
{name: "yoloV1Block", block: c.YoloV1Block},
- // TODO figure out how Apricot fits in here.
- // Precompiled contracts start from other end so they are compatible
- // but it may be incompatible (and it was before Apricot as well) due
- // to how the instruction sets are created
} {
if lastFork.name != "" {
// Next one must be higher number