Add ApproveERC20Encode

pull/2/head
Michael Scoff 7 years ago
parent 7e4b9b1b42
commit 5b0988dfe0
  1. 18
      Trust/Vendors/New Group/Commands/ApproveERC20.swift

@ -0,0 +1,18 @@
// Copyright SIX DAY LLC. All rights reserved.
import Foundation
struct ApproveERC20Encode: Web3Request {
typealias Response = String
static let abi = "{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}"
let address: Address
let amount: String
var type: Web3RequestType {
let run = "web3.eth.abi.encodeFunctionCall(\(ApproveERC20Encode.abi), [\"\(address.address)\", \"\(amount)\"])"
return .script(command: run)
}
}
Loading…
Cancel
Save