4

I am trying to write a smart contract where I can get the awards for delegators of a particular stake pool. I need to know if that is right now possible to do using Plutus, if yes, pls suggest me.

1
  • 1
    Hey Kuldeep. Welcome to the forum! I made an attempt to answer your questions, but I think I and the other contributors could answer better if you would be more specific with the type of epoch and stake-pool details you are looking for. Jul 27 at 6:34
1

Okay. I think you are asking a couple different questions:

Is there any keyword to get the epoch details or stake-pool details in Plutus Smart Contract?

It really depends on what information you need. There are ways for a script to validate certain information about an epoch, e.g. check that the current slot is within a defined epoch.

For example, to check if you are past a deadline in a validator:

from slot `contains` posixTimeRangeToSlotRange (txInfoValidRange (scriptContextTxInfo ctx))

will return True if the transaction takes place after a specified slot. And there are ways to convert an epoch to a slot.

There is also limited staking information in the transaction context.


I am trying to write a smart contract where I can get the awards for delegators of a particular stake pool. I need to know if that is right now possible to do using Plutus

A smart contract can't withdraw awards on behalf of other delegators. The awarded ADA will be only be withdrawable by the wallets that have delegated the funds.

However, it is possible for a script to delegate its own funds. So, depending on the behavior you want, you could have a smart contract delegate on behalf of other delegators and get a similar behavior.

Hope that helps :)

1
  • 1
    Sorry if the question was put in a confusing way. Is there any way we can know how much a particular delegator earned (ADA) in an epoch from a particular staking pool. This is to be done using Plutus SC. I hope to be clearer this time. Jul 27 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.