How do I call this function from my contract and send ether to it?

abstract contract MainAcceptedOffers {
    function accept(uint _acceptance, address payable _casher) public payable virtual;
contract MainOffers {
    MainAcceptedOffers mainAcceptedOffers;
    constructor(address _mainAcceptedOffers) {
        mainAcceptedOffers = MainAcceptedOffers(_mainAcceptedOffers);
    function accept() {
        mainAcceptedOffers.accept(0, msg.sender);

1 Answer 1


Try - > mainAcceptedOffers.accept.value("the value in Wei")(0, msg.sender);

The smart contract should have ether

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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