Skip to main content
Bumped by Community user
added 9 characters in body
Source Link
goodvibration
  • 26.2k
  • 5
  • 49
  • 89

So the ideia is like this:

contract MyContract {
    uint mydata;
    
    function setData1(uint _data) public {
        mydata = _data; //normal way (msg.sender pays to store _data in mydata (msg.sender needs to have eth))
    }
    
    function setData2(uint _data) public {
        //...
        //here i want that MyContract address ("address(this)") pay and store _data in mydata
        //...
    }
    
    function setData3(uint _data) public {
        mydata = _data;
        //here i want that MyContract pay the transaction from msg.sender
        //...
    }    
}

I know that setData3()setData3() is possible with gas stations, meta transactions and other approach but these aproachesapproaches is other addresses to pay for transaction. I

I want that Contract pay the fee. Is it possible?

In setData2()setData2() is it possible for the contract to save the variable and pay for it in some way? In

In this scenario, I do not need to save the transaction, just to save the variable in some way.

So the ideia is like this:

contract MyContract {
    uint mydata;
    
    function setData1(uint _data) public {
        mydata = _data; //normal way (msg.sender pays to store _data in mydata (msg.sender needs to have eth))
    }
    
    function setData2(uint _data) public {
        //...
        //here i want that MyContract address ("address(this)") pay and store _data in mydata
        //...
    }
    
    function setData3(uint _data) public {
        mydata = _data;
        //here i want that MyContract pay the transaction from msg.sender
        //...
    }    
}

I know that setData3() is possible with gas stations, meta transactions and other approach but these aproaches is other addresses to pay for transaction. I want that Contract pay the fee. Is it possible?

In setData2() is it possible for the contract to save the variable and pay for it in some way? In this scenario, I do not need to save the transaction, just to save the variable in some way.

So the ideia is like this:

contract MyContract {
    uint mydata;
    
    function setData1(uint _data) public {
        mydata = _data; //normal way (msg.sender pays to store _data in mydata (msg.sender needs to have eth))
    }
    
    function setData2(uint _data) public {
        //...
        //here i want that MyContract address ("address(this)") pay and store _data in mydata
        //...
    }
    
    function setData3(uint _data) public {
        mydata = _data;
        //here i want that MyContract pay the transaction from msg.sender
        //...
    }    
}

I know that setData3() is possible with gas stations, meta transactions and other approach but these approaches is other addresses to pay for transaction.

I want that Contract pay the fee. Is it possible?

In setData2() is it possible for the contract to save the variable and pay for it in some way?

In this scenario, I do not need to save the transaction, just to save the variable in some way.

Source Link
john
  • 11
  • 1

Is it possible that the contract pays to store data coming from an address with no eth?

So the ideia is like this:

contract MyContract {
    uint mydata;
    
    function setData1(uint _data) public {
        mydata = _data; //normal way (msg.sender pays to store _data in mydata (msg.sender needs to have eth))
    }
    
    function setData2(uint _data) public {
        //...
        //here i want that MyContract address ("address(this)") pay and store _data in mydata
        //...
    }
    
    function setData3(uint _data) public {
        mydata = _data;
        //here i want that MyContract pay the transaction from msg.sender
        //...
    }    
}

I know that setData3() is possible with gas stations, meta transactions and other approach but these aproaches is other addresses to pay for transaction. I want that Contract pay the fee. Is it possible?

In setData2() is it possible for the contract to save the variable and pay for it in some way? In this scenario, I do not need to save the transaction, just to save the variable in some way.