Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

corrected Array Bool issue #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions components/form_new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const Form_new = () => {

function HandleContractAddress(inputAddress:string){
SetContractAddress(inputAddress)
console.log(ContractAddress)
// console.log(ContractAddress)
}

function HandleArrayLength(inputLength:string){
Expand All @@ -40,23 +40,19 @@ export const Form_new = () => {

function HandleProvider(inputProvider:string){
SetProvider(inputProvider)
console.log(Provider)
// console.log(Provider)
}
// function print() {
// console.log("ContractAddress : ",ContractAddress)
// console.log("Provider : ",Provider)
// console.log("QueryList : ",QueryList)
// }

useEffect(() => {
slotReader = new SlotReader(Provider,ContractAddress)
console.log(slotReader)
// console.log(slotReader)
// slotReader.test()
},
[ContractAddress,Provider,[]]);

async function HandleFetch(){
for (let Query of QueryList ) {
console.log(Query.slotNumber,Query.variableType)
// console.log(Query.slotNumber,Query.variableType)
let query_var
if (Query.isArray) {
query_var = Query.variableType + Query.arraylength
Expand All @@ -68,9 +64,9 @@ export const Form_new = () => {
SetOutputList((prevList) =>
[...prevList,{id:Query.id,value:val}]
)
console.log("val",val)
// console.log("val",val)
}
console.log(QueryList)
// console.log(QueryList)
}
function HandleClear() {
SetQueryList([]);
Expand All @@ -86,7 +82,7 @@ export const Form_new = () => {
SetVariableType("uint")
SetSlotNumber("0");
setArrayLength("[]")
setBool(false)
// setBool(false)

}
function HandleClearOutput () {
Expand Down Expand Up @@ -141,7 +137,7 @@ export const Form_new = () => {
<label>Array ?</label>
<input type="checkbox" onChange={e =>
HandleBool()}/>
{Bool? (
{Bool ? (
<div>
<label>ArrayLength</label>
<input name= "ArrayLength" type="string" placeholder="Default-Dynamic" value={ArrayLength} onChange={e =>
Expand All @@ -164,6 +160,9 @@ export const Form_new = () => {
</div>
))}
</div>
{/* <>
Boolean value {Bool ? "True" : " False"}
</> */}

<div>
<button onClick={HandleFetch} >
Expand All @@ -177,11 +176,12 @@ export const Form_new = () => {
Response:
{OutputList.map((output,index)=>(
<div key={index}>
{console.log("output value ====",output.value)}
{/* {console.log("output value ====",output.value)} */}
ID : {output.id? output.id:"null"} ----- Value {output.value? output.value : "null"}
</div>
))}
</div>

{/* <div>
{
check.join(' , ')
Expand Down
21 changes: 20 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"ethers": "^5.7.1",
"next": "12.3.1",
"react": "18.2.0",
"react-dom": "18.2.0"
"react-dom": "18.2.0",
"yarn": "^1.22.19"
},
"devDependencies": {
"@types/node": "18.11.0",
Expand Down
Loading