173799761 2 年之前
父节点
当前提交
c548913b1b
共有 2 个文件被更改,包括 19 次插入25 次删除
  1. 9 1
      solidity/1.txt
  2. 10 24
      solidity/course2/index.html

+ 9 - 1
solidity/1.txt

@@ -9,4 +9,12 @@ account 1
 0xc839ba2548b7c1edBa062af824d2ec8e13C6c379
 
 account2
-0x4486DE14Bdfc68Af4Be35D19953F8ea26fA8B6cf
+0x4486DE14Bdfc68Af4Be35D19953F8ea26fA8B6cf
+
+源码(https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts
+
+
+https://chatbot.theb.ai/不用注册,翻墙可用
+
+1350000000000
+196243984091

+ 10 - 24
solidity/course2/index.html

@@ -9,35 +9,21 @@
 </head>
 
 <body>
-    <button id="mm">test</button>    
+    <button id="getRawTransaction">getRawTransaction</button> 
+    <div id="result"></div>   
 </body>
 <script type="text/javascript">
-    //const url = 'https://goerli.infura.io/v3/a65939973eea40d2543fd907fa281eeb024936ddcdc3d872249d396faea650a1'
-    //const url = 'https://goerli.infura.io/v3'
-    const url = 'http://127.0.0.1:7545'
-   
+    //https://chainlist.org/   这个网站查 API key
+    const url = 'https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161'
     var web3 = new Web3(new Web3.providers.HttpProvider(url));
-    //var web3 = new Web3()
-    web3.setProvider(url)
-
-    console.log(web3)
-
-    //console.log(web3.isConnected())
-
-    // function trans(){
-    //     console.log('....click')
-    // }
-    //a65939973eea40d2543fd907fa281eeb024936ddcdc3d872249d396faea650a1
-  
-
-
-    const checkAll = document.querySelector('#mm')
 
+    const resultTxt = document.querySelector('#result')
+    const checkAll = document.querySelector('#getRawTransaction')
     checkAll.addEventListener('click', function () {
-        console.log('dddddd')
-        const ret =  web3.eth.getTransaction('0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b§234')
-        //const ret =  web3.eth.accounts
-        console.log(ret)
+       web3.eth.getTransaction('0x01957ea8c7690c58f6125bee78af460a3198db3a79daaaf9e10e195e65726db3').then((res)=>{
+           console.log(res)
+           resultTxt.innerHTML = JSON.stringify(res)
+       });
     })
 
 </script>