This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ERC20: IERC20 = TERC20.Create(TWeb3.Create( | |
| Sepolia.SetRPC('https://sepolia.infura.io/v3/your-project-id')), // Sepolia testnet | |
| '0xe28a3A4BFbf285676405cF55354f8b504D844f3c'); // TST smart contract address | |
| ERC20.Transfer( | |
| TPrivateKey('24622d680bb9d6d80c4d3fb4b4818e738de64b521948b1b1c85616eeeda54ee1'), // from private key | |
| '0xaDDcedc01C1070bCE0aF7eb853845e7811EB649C', // to public key | |
| 1000000000000000, // 0.001 TST | |
| procedure(hash: TTxHash; err: IError) | |
| begin | |
| TThread.Synchronize(nil, procedure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TAddress.FromName(TWeb3.Create( | |
| Ethereum.SetRPC('https://mainnet.infura.io/v3/your-project-id')), // Ethereum mainnet | |
| 'thecoinoffering.eth', // Ethereum domain name | |
| procedure(addr: TAddress; err: IError) | |
| begin | |
| TThread.Synchronize(nil, procedure | |
| begin | |
| if Assigned(err) then | |
| MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0) | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TAddress.Create('0xa0400ba66b4fe0b13bb909abfd377596c02b6733').ToString( | |
| TWeb3.Create(Ethereum.SetRPC('https://mainnet.infura.io/v3/your-project-id')), | |
| procedure(str: string; err: IError) | |
| begin | |
| TThread.Synchronize(nil, procedure | |
| begin | |
| if Assigned(err) then | |
| MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0) | |
| else | |
| ShowMessage(str); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| web3.eth.call(TWeb3.Create( | |
| Sepolia.SetRPC( // Sepolia test net | |
| 'https://sepolia.infura.io/v3/your-project-id')), // RPC access to Sepolia | |
| '0x643C9Db08aBE4D95e4F2Afc733F78b601b84007A', // smart contract address | |
| 'myFirstHelloWorld()', [], procedure(tup: TTuple; err: IError) | |
| begin | |
| TThread.Synchronize(nil, procedure | |
| begin | |
| if Assigned(err) then | |
| MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity ^0.8.0; | |
| contract HelloWorld { | |
| function myFirstHelloWorld() public pure returns (string memory) { | |
| return 'Hello World!'; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity ^0.8.0; | |
| contract ArithValue { | |
| uint number; | |
| constructor () { | |
| number = 100; | |
| } | |
| function setNumber(uint value) public { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| web3.eth.call(Client, | |
| '0x1a306890df22c0965b0b1515a8082f8301d3d18e', | |
| 'getNumber()', [], procedure(qty: BigInteger; err: IError) | |
| begin | |
| TThread.Synchronize(nil, procedure | |
| begin | |
| if Assigned(err) then | |
| MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0) | |
| else | |
| ShowMessage(qty.ToString); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var | |
| Client: IWeb3; | |
| procedure TForm1.FormCreate(Sender: TObject); | |
| begin | |
| Client := TWeb3.Create(Sepolia.SetRPC('https://sepolia.infura.io/v3/your-project-id')); | |
| end; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| web3.eth.write(Client, | |
| TPrivateKey('b5b1870957d373ef0eeffecc6e4812c0fd08f554b37b233526acc331bf1544f7'), // from private key | |
| '0x1a306890df22c0965b0b1515a8082f8301d3d18e', // to smart contract | |
| 'incrementNumber()', [], | |
| procedure(rcpt: ITxReceipt; err: IError) begin end); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| web3.eth.write(Client, | |
| TPrivateKey('b5b1870957d373ef0eeffecc6e4812c0fd08f554b37b233526acc331bf1544f7'), // from private key | |
| '0x1a306890df22c0965b0b1515a8082f8301d3d18e', // to smart contract | |
| 'setNumber(uint256)', [143], | |
| procedure(rcpt: ITxReceipt; err: IError) begin end); |