v2.25.0
What's Changed
- Added ThirdwebContract.Deploy as this SDK's first integration of https://api.thirdweb.com/reference
- Includes various internal changes and improvements to account for the new generated api client.
Example
var serverWallet = await ServerWallet.Create(client: client, label: "TestFromDotnet");
var chainId = 11155111;
var abi = "[ { \"inputs\": [], \"name\": \"welcome\", \"outputs\": [ { \"internalType\": \"string\", \"name\": \"\", \"type\": \"string\" } ], \"stateMutability\": \"pure\", \"type\": \"function\" } ]";
var contractAddress = await ThirdwebContract.Deploy(
client: client,
chainId: chainId ,
serverWalletAddress: await serverWallet.GetAddress(),
bytecode: "6080604052348015600e575f5ffd5b5061014e8061001c5f395ff3fe608060405234801561000f575f5ffd5b5060043610610029575f3560e01c8063b627cf3b1461002d575b5f5ffd5b61003561004b565b60405161004291906100f8565b60405180910390f35b60606040518060400160405280601481526020017f57656c636f6d6520746f20746869726477656221000000000000000000000000815250905090565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6100ca82610088565b6100d48185610092565b93506100e48185602086016100a2565b6100ed816100b0565b840191505092915050565b5f6020820190508181035f83015261011081846100c0565b90509291505056fea264697066735822122001498e9d7d6125ce22613ef32fdb7e8e03bf11ad361d7b00e210b82d7b7e0d4464736f6c634300081e0033",
abi: abi
);
Console.WriteLine($"Contract deployed at: {contractAddress}");
var contract = await ThirdwebContract.Create(client: client, address: contractAddress, chain: chainId, abi: abi);
var welcomeMessage = await contract.Read<string>("welcome");
Console.WriteLine($"Welcome message from deployed contract: {welcomeMessage}");
Expect more new features to keep coming as part of the thirdweb api integration!