As far as Rock's contract goes, it's probably similar to Lesnar's in layout - but without the massive downside. It's been said that the downside Lesnar is recieving, is due to his drawing power in UFC and previous drawing history in WWE.
The Rock is probably on a contract that allows leniency for his film career, but with the stipulation that he makes his agreed upon appearances. It might be that WWE wants Rock to work Extreme Rules in a non-wrestling role, so they meet to organise or make alternative arrangements and an agreement is made if Rock's schedule permits it - Rock must then fulfill that agreement by appearing in the agreed role.
As for financial terms, I expect Rock is paid a generous sum for every PPV appearance (he could have easily made $1 million or over, just for Wrestlemania XVIII) and WWE pays for his transportation, accomodation, etc. I don't know whether he would have a downside, but it's a safe bet that he takes around the same amount of money that the likes of John Cena make.
Lesnar's contract is a big deal because he'll recieve a substanial amount of money from merchandise sales and PPV bonuses. $5 million for a minimum of 24 appearances? I'd say he's looking at double that when you add everything else into the equation!
I can imagine that Vince and Co. have begged Dwayne Johnson to do the Marine 3...