whitehat0917 / ConnectSmartContract

This is nodejs source to connect smart contract by web3
0 stars 3 forks source link

code: -32000, message: 'insufficient funds for gas * price + value' #2

Open Sv3nskie opened 3 years ago

Sv3nskie commented 3 years ago

Hi,

Thanks for the code, unfortunately it does not work anymore. keeps getting error "code: -32000, message: 'insufficient funds for gas * price + value'" even getting gas price from latest block does not work.

Any idea how to fix this?

Sv3nskie commented 2 years ago

Both are im the same block, a transaction has a nonce number which indicated the order of the transaction, i think it depends on gas. If you send 2 transactions in the same block, the last transaction has more gas then the first ot will be processed first.

On Sun, 28 Nov 2021, 10:46 jackynguyen93, @.***> wrote:

I just wonder how this guy can do something like that, same transaction content but the late transaction is success, not the early one [image: image] https://user-images.githubusercontent.com/14976555/143728638-912a7eae-eb4f-415c-857c-70d04b658db6.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-980834797, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI2FHREB5ZYYJHWMHYDUOGQX7ANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kickboxer commented 2 years ago

Anybody know how to check is axie got banned without graphql?

marco906 commented 2 years ago

@kickboxer Could you tell was the trick how you got result: true response from adding the activity to graphQL? I am currently testing it with the create and cancel Axie sale method (easier and less risk of ban than buy Axie). The interaction with the smart contract works, I can create and cancel auctions for my axies. But I could not successful register the activities in graphQL, always getting false response. I used the header + body data from real firefox activity I saved before, just like mentioned in the other comments.

kickboxer commented 2 years ago

@marco906 nothing special, just make graphql request when I got transaction have. graphql query

const AddActivity = gql`
    mutation AddActivity($action: Action!, $data: ActivityDataInput!) {
        createActivity(action: $action, data: $data) {
            result
            __typename
        }
    }
`
const activity = await addActivity({
      action: 'BuyAxie',
      data: {
          owner: seller, // seller wallet address
          axieId: id, // axie id
          price: currentPrice, // axie price
          txHash: hash, // transaction hash
      }
  });

console.log(activity); // in console i see `result: true`

I am using this graphql url https://graphql-gateway.axieinfinity.com/graphql And I added just authorization header.

But it doesn't help me, all axies got banned. And last 3 days I can't buy any axie - not so much axies under 0.023 and I am always late (other bots faster than me).

image

Sv3nskie commented 2 years ago

I know some bot are getti g data live from the ronin chain, axie website shows all with graphql and there is a delay. So getting directly from node is faster. But not sure how to prevent the blocking. Unfortionatly I have no time.

On Mon, 29 Nov 2021, 17:50 Maksim Mnatsakanov, @.***> wrote:

@marco906 https://github.com/marco906 nothing special, just make graphql request when I got transaction have. graphql query

const AddActivity = gql mutation AddActivity($action: Action!, $data: ActivityDataInput!) { createActivity(action: $action, data: $data) { result __typename } } const activity = await addActivity({ action: 'BuyAxie', data: { owner: seller, // seller wallet address axieId: id, // axie id price: currentPrice, // axie price txHash: hash, // transaction hash } });

console.log(activity); // in console i see result: true

I am using this graphql url https://graphql-gateway.axieinfinity.com/graphql And I added just authorization header.

But it doesn't help me, all axies got banned. And last 3 days I can't buy any axie - not so much axies under 0.023 and I am always late (other bots faster than me).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-981517821, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI47Q5ALSDN6R5D3QXLUONLGRANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

marco906 commented 2 years ago

@kickboxer Thanks for your reply, I have a similar implementation (in python), I will check it again. But as you say, all this does not help if the axies get banned anyway. Is the ban only happening for low prices axies that are below the min costs to breed an axie?

@Sv3nskie An approach would be to have an event listener that listens on the AuctionCreated event of the marketplace contract. But I have no working example at the moment.

@marco906 nothing special, just make graphql request when I got transaction have. graphql query

const AddActivity = gql`
    mutation AddActivity($action: Action!, $data: ActivityDataInput!) {
        createActivity(action: $action, data: $data) {
            result
            __typename
        }
    }
`
const activity = await addActivity({
      action: 'BuyAxie',
      data: {
          owner: seller, // seller wallet address
          axieId: id, // axie id
          price: currentPrice, // axie price
          txHash: hash, // transaction hash
      }
  });

console.log(activity); // in console i see `result: true`

I am using this graphql url https://graphql-gateway.axieinfinity.com/graphql And I added just authorization header.

But it doesn't help me, all axies got banned. And last 3 days I can't buy any axie - not so much axies under 0.023 and I am always late (other bots faster than me).

Sv3nskie commented 2 years ago

I think it would be easy with web3js to lusten to blocks/transactions and check the input code. That will contain the function code first 8 bytes after the hex indicator.

Then just get the data from that I think. But not sure how many transactions are in a block. Might exceed the request amount.

On Mon, 29 Nov 2021, 21:20 marco906, @.***> wrote:

@kickboxer https://github.com/kickboxer Thanks for your reply, I have a similar implementation (in python), I will check it again. But as you say, all this does not help if the axies get banned anyway. Is the ban only happening for low prices axies that are below the min costs to breed an axie?

@Sv3nskie https://github.com/Sv3nskie An approach would be to have an event listener that listens on the AuctionCreated event of the marketplace contract. But I have no working example at the moment.

@marco906 https://github.com/marco906 nothing special, just make graphql request when I got transaction have. graphql query

const AddActivity = gql mutation AddActivity($action: Action!, $data: ActivityDataInput!) { createActivity(action: $action, data: $data) { result __typename } } const activity = await addActivity({ action: 'BuyAxie', data: { owner: seller, // seller wallet address axieId: id, // axie id price: currentPrice, // axie price txHash: hash, // transaction hash } });

console.log(activity); // in console i see result: true

I am using this graphql url https://graphql-gateway.axieinfinity.com/graphql And I added just authorization header.

But it doesn't help me, all axies got banned. And last 3 days I can't buy any axie - not so much axies under 0.023 and I am always late (other bots faster than me).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-981678516, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KIZLIS2OKDPT4VOZK6LUOODZXANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

CallumWingfield commented 2 years ago

@Sv3nskie Has anyone figured out how to not get banned when buying axies?

It seems like one of the big bots is just sending 10s of buy transactions each block, however some of the early block buy transactions fail, and after a few blocks one of their buy transactions succeed. Any idea how their early block transactions fail?