You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
550 B
HTML
16 lines
550 B
HTML
<script src="/static/js/vendor/web3-1.3.6.min.js"></script>
|
|
<script type="text/javascript">
|
|
let contractABI = {{ config.CONTRACT_ABI | tojson }};
|
|
let contractAddress = "{{ config.CONTRACT_ADDRESS }}";
|
|
const w3 = new Web3(Web3.givenProvider || "http://127.0.0.1:7545");
|
|
const contract = new w3.eth.Contract(contractABI, contractAddress);
|
|
|
|
async function getMetamaskAccount() {
|
|
const accounts = await window.ethereum.request({
|
|
method: 'eth_requestAccounts',
|
|
});
|
|
const account = accounts[0];
|
|
return account
|
|
}
|
|
</script>
|