-
Notifications
You must be signed in to change notification settings - Fork 4
/
exampleBase.php
69 lines (58 loc) · 1.31 KB
/
exampleBase.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
$dir = dirname(__FILE__);
require($dir . '/vendor/autoload.php');
use Web3\Web3;
$web3 = new Web3('https://bsc-dataseed.binance.org/');
$eth = $web3->eth;
// BSC chain id, remember to set the right chain id
// Find chain id here: https://chainlist.org/
$chainId = 56;
/**
* erc20Json
* Openzeppelin abi from https://github.com/OpenZeppelin/openzeppelin-contracts
*/
$erc20JsonFile = file_get_contents($dir . '/ERC20.json');
$erc20Json = json_decode($erc20JsonFile);
/**
* erc721Json
* Openzeppelin abi from https://github.com/OpenZeppelin/openzeppelin-contracts
*/
$erc721JsonFile = file_get_contents($dir . '/ERC721.json');
$erc721Json = json_decode($erc721JsonFile);
/**
* testPrivateKey
* Never use this in real world
*
* @var string
*/
$testPrivateKey = '';
/**
* testAddress
* Never use this in real world
*
* @var string
*/
$testAddress = '';
/**
* testAddress2
* Never use this in real world
*
* @var string
*/
$testAddress2 = '';
/**
* settings for testing uniswap based DEX
*
* $testUNIAbi
* uniswap router abi
*
* @var string
*
* $testUNIRouterAddress
* uniswap router address
*
* @var string
*/
$uniV2JsonFile = file_get_contents($dir . '/UNIV2Router.json');
$uniV2Json = json_decode($uniV2JsonFile);
$testUNIRouterAddress = '0x10ed43c718714eb63d5aa57b78b54704e256024e';